credentials_manager 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/credentials_manager/appfile_config.rb +16 -14
- data/lib/credentials_manager/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa5adb621951939a2dc6793f4a42fb7810c54aad
|
4
|
+
data.tar.gz: 613bd09e7bd4644814cbb9e412f4fa1a6d67bb1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55977227d28a0ac05e8de4de59cda0a0424ab62e6aea87178b3a871b9de604945379a70133fe472d953ba7237113facea341213994925234c980e2bfdcc84dc2
|
7
|
+
data.tar.gz: bbdab46bccdfe351e69539742526b0de265d0956969f131fddf3d14736163611aab0353864f716200ffc6cda58cf1b91c66198697ff9406882e8a22b82ba4565
|
@@ -3,13 +3,11 @@ module CredentialsManager
|
|
3
3
|
class AppfileConfig
|
4
4
|
|
5
5
|
def self.try_fetch_value(key)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
return nil
|
12
|
-
end
|
6
|
+
begin
|
7
|
+
return self.new.data[key]
|
8
|
+
rescue => ex
|
9
|
+
puts ex.to_s
|
10
|
+
return nil
|
13
11
|
end
|
14
12
|
nil
|
15
13
|
end
|
@@ -22,15 +20,19 @@ module CredentialsManager
|
|
22
20
|
end
|
23
21
|
|
24
22
|
def initialize(path = nil)
|
25
|
-
path
|
23
|
+
if path
|
24
|
+
raise "Could not find Appfile at path '#{path}'".red unless File.exist?(path)
|
25
|
+
end
|
26
26
|
|
27
|
-
|
27
|
+
path ||= self.class.default_path
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
if path and File.exist?(path) # it might not exist, we still want to use the default values
|
30
|
+
full_path = File.expand_path(path)
|
31
|
+
Dir.chdir(File.expand_path('..', path)) do
|
32
|
+
# rubocop:disable Lint/Eval
|
33
|
+
eval(File.read(full_path))
|
34
|
+
# rubocop:enable Lint/Eval
|
35
|
+
end
|
34
36
|
end
|
35
37
|
|
36
38
|
fallback_to_default_values
|