summaryrefslogtreecommitdiff
path: root/lib/leap_ca/pool.rb
blob: 76c196373685951a23f489d8189eb8b4c8a9cf75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'yaml'

module LeapCA
  class Pool
    def initialize(filename)
      @config = YAML.load(File.open(filename, 'r'))
    end

    def fill
      while Cert.count < self.size do
        Cert.create!
      end
    end

    def size
      @config[:size] ||= 10
    end
  end
end