nub 0.0.132 → 0.0.134
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/nub/config.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8202cbd6a49793c08e975943cf7d8e80ec1345628e77fe323df81a2338883a7
|
4
|
+
data.tar.gz: c226fce75f1440932e151ac6b78f600be86c58ba85003fe1e314bcde8ed0c815
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de93ba1fe7f36ba854949fd118683d2a2acc6dfc91944cf0c7c598aab4893605edcbf2bed990c31aa326dae7fab8e3111edb4d8f5fb9920f200bc6f9e513b261
|
7
|
+
data.tar.gz: a0e4512271c10503a7c9bd3a98addd4808318b42610c3ed0c6c9d129d0d0b2d65ed1c0b9c5e019c9d8b3358af2be808770bf2f18c0d1fc290e6f108f8839c767
|
data/lib/nub/config.rb
CHANGED
@@ -42,11 +42,15 @@ module Config
|
|
42
42
|
|
43
43
|
# Determine caller's file path to look for sidecar config
|
44
44
|
caller_path = caller_locations(1, 1).first.path
|
45
|
-
|
46
|
-
if !File.exists?(
|
47
|
-
|
45
|
+
path = File.expand_path(File.join(File.dirname(caller_path), config))
|
46
|
+
if !File.exists?(path)
|
47
|
+
path = "/home/#{User.name}/.config/#{config.split('/').first}"
|
48
48
|
end
|
49
49
|
|
50
|
+
# Don't reload if its already been done
|
51
|
+
return Config if @@path == path
|
52
|
+
@@path = path
|
53
|
+
|
50
54
|
# Open the config file or create in memory yml
|
51
55
|
begin
|
52
56
|
@@yml = File.exists?(@@path) ? YAML.load_file(@@path) : {}
|