11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/chamber/context_resolver.rb', line 11
def resolve
options[:rootpath] ||= Pathname.pwd
options[:rootpath] = Pathname.new(options[:rootpath])
options[:encryption_key] = resolve_encryption_key(options[:encryption_key])
options[:decryption_key] = resolve_decryption_key(options[:decryption_key])
options[:namespaces] ||= []
options[:preset] ||= resolve_preset
if options[:preset] == 'rails'
options[:basepath] ||= options[:rootpath] + 'config'
if options[:namespaces] == []
require options[:rootpath].join('config', 'application')
options[:namespaces] = [::Rails.env]
end
else
options[:basepath] ||= options[:rootpath]
end
options[:basepath] = Pathname.new(options[:basepath])
options[:files] ||= [ options[:basepath] + 'credentials*.yml',
options[:basepath] + 'settings*.yml',
options[:basepath] + 'settings' ]
options
rescue LoadError
options
end
|