Class: Secrets

Inherits:
AppConfig show all
Defined in:
lib/secrets.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AppConfig

load, #load

Constructor Details

#initialize(filename = "") ⇒ Secrets

Returns a new instance of Secrets.



31
32
33
# File 'lib/secrets.rb', line 31

def initialize(filename = "")
	@filename = filename.empty? ? Secrets.default_filename : actual_filename_for(filename)
end

Class Method Details

.app_config_pathObject



16
17
18
# File 'lib/secrets.rb', line 16

def app_config_path
	expand_path(Options.get("secrets.path") || default_filename)
end

.config_path_for(env) ⇒ Object



12
13
14
# File 'lib/secrets.rb', line 12

def config_path_for(env)
	File.exist?(ejson_path_for(env)) ? ejson_path_for(env) : json_path_for(env)
end

.default_filenameObject



8
9
10
# File 'lib/secrets.rb', line 8

def default_filename
	config_path_for(Environment.environment)
end