From 1bac88549fc3bfda81e04b2811443a301aa9e781 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 20 Sep 2012 13:15:33 +0200 Subject: moved files into own dir and added main leap_ca.rb Also updated the couchdb.yml.example with more meaningful content --- lib/leap_ca/pool.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/leap_ca/pool.rb (limited to 'lib/leap_ca/pool.rb') 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 -- cgit v1.2.3