diff options
author | Azul <azul@riseup.net> | 2012-09-11 15:47:00 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2012-09-11 15:47:00 +0200 |
commit | 2d124b74538f19681c619e4a807f60176ab2d869 (patch) | |
tree | 59fb7bcfb85f255fe2be7363ef331bc3cb9ef390 /lib/pool.rb | |
parent | c0fc5ac5b5d955b1789a58153952e43bb7052b07 (diff) |
Filling the pool with up to 10 certs
Diffstat (limited to 'lib/pool.rb')
-rw-r--r-- | lib/pool.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/pool.rb b/lib/pool.rb new file mode 100644 index 0000000..76c1963 --- /dev/null +++ b/lib/pool.rb @@ -0,0 +1,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 |