lib/secret_service.rb in secret_service-0.0.1 vs lib/secret_service.rb in secret_service-0.1.0
- old
+ new
@@ -1,13 +1,34 @@
require "secret_service/version"
require "secret_service/store"
module SecretService
- def self.secret(source_secret, options = {})
- if options[:plain]
- source_secret
- else
+
+ class << self
+
+ def secret(source_secret)
@secrets ||= {}
- @secrets[source_secret] ||= Store.instance.get(source_secret)
+ @secrets[source_secret] ||= Store.new.get(source_secret)
end
+
+ private
+
+ def store
+ @store ||= Store.new
+ end
+
+ def reset
+ @secrets = nil
+ @store = nil
+ end
+
end
+
+ if defined?(Rails::Railtie)
+ class RakeTaskLoader < Rails::Railtie
+ rake_tasks do
+ require 'secret_service/rake_tasks'
+ end
+ end
+ end
+
end