lib/encrypted/environment.rb in encrypted-environment-0.1.0 vs lib/encrypted/environment.rb in encrypted-environment-0.2.0
- old
+ new
@@ -7,11 +7,10 @@
module Encrypted
module Environment
EnvironmentError = Class.new(StandardError)
MissingEjson = Class.new(EnvironmentError)
- MissingSecret = Class.new(EnvironmentError)
def self.load_from_ejson(ejson_path, secrets_path: nil, private_key: nil)
decrypt_environment(
ejson_path: ejson_path,
secrets_path: secrets_path,
@@ -49,11 +48,9 @@
# Do nothing
elsif !private_key.nil?
secrets_path = Dir.mktmpdir
should_delete = true
File.write(File.join(secrets_path, public_key), private_key)
- else
- raise MissingSecret
end
yield(secrets_path)
ensure
FileUtils.remove_dir(secrets_path, true) if should_delete