diff options
author | Azul <azul@riseup.net> | 2012-09-20 13:15:33 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2012-09-20 13:17:17 +0200 |
commit | 1bac88549fc3bfda81e04b2811443a301aa9e781 (patch) | |
tree | 1d646219965216479e5c770d82eec543a80044aa /lib/leap_ca/pool.rb | |
parent | 15354c284879c734ca9bd87450d715dcdbe8aec2 (diff) |
moved files into own dir and added main leap_ca.rb
Also updated the couchdb.yml.example with more meaningful content
Diffstat (limited to 'lib/leap_ca/pool.rb')
-rw-r--r-- | lib/leap_ca/pool.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/leap_ca/pool.rb b/lib/leap_ca/pool.rb new file mode 100644 index 0000000..76c1963 --- /dev/null +++ b/lib/leap_ca/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 |