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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bde8f7bd1ba5585cdc09b030cf1a935ecb739b73
4
- data.tar.gz: 11c73c6983ec77346a8bc1a3121344c09cc8bda8
3
+ metadata.gz: fa5adb621951939a2dc6793f4a42fb7810c54aad
4
+ data.tar.gz: 613bd09e7bd4644814cbb9e412f4fa1a6d67bb1c
5
5
  SHA512:
6
- metadata.gz: 909d88cb900f568044e9c527a00c71eb3edaa78cdf981c7e41dd2dab3d48c3c7db256067d7ddcc25314706012c97af7d9c1a33ba9dec6e8a26eb38f84fed3e7f
7
- data.tar.gz: 5ece03d37c9779e87827c6c7105086ee46cc9660b43b5016baeccfac2a6a4a4aec18cf9c7df34fb0b104ea9d22c0d1a974b0190a891808cd091299be9301b98f
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
- if self.default_path
7
- begin
8
- return self.new.data[key]
9
- rescue => ex
10
- puts ex.to_s
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 ||= self.class.default_path
23
+ if path
24
+ raise "Could not find Appfile at path '#{path}'".red unless File.exist?(path)
25
+ end
26
26
 
27
- raise "Could not find Appfile at path '#{path}'".red unless File.exist?(path)
27
+ path ||= self.class.default_path
28
28
 
29
- full_path = File.expand_path(path)
30
- Dir.chdir(File.expand_path('..', path)) do
31
- # rubocop:disable Lint/Eval
32
- eval(File.read(full_path))
33
- # rubocop:enable Lint/Eval
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
@@ -1,3 +1,3 @@
1
1
  module CredentialsManager
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credentials_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause