nub 0.0.34 → 0.0.35
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 +9 -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: 14efb7fa976af799cce7a81dc1c380a9693fc9e7662d79c4db611011b44dbf9f
|
4
|
+
data.tar.gz: 718d3542289f23b057c6278e9c9f17e0ab6a16184cbabada6f44136c2e4dd915
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 805fd25ade06515accbf5d82616200d21e2c84447512a761bbfb8aeb85634440ce5c8e79cae9b15bfcfc72eb871716a2dc69d2aa8ff953c762749f7b4d099876
|
7
|
+
data.tar.gz: df51f2ac8b2c5d129a75dbe796d27c887f89471b1c0b8b7a315e2f86eedd8c88bc170e8050611e5adbb44db27b05e3de5b144df591b14c0cde53a7cfd668f5b1
|
data/lib/nub/config.rb
CHANGED
@@ -38,9 +38,15 @@ module Config
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# Singleton new alternate
|
41
|
-
# @param
|
42
|
-
def self.init(
|
43
|
-
|
41
|
+
# @param config [String] name or path of the config file
|
42
|
+
def self.init(config)
|
43
|
+
|
44
|
+
# Determine caller's file path to look for sidecar config
|
45
|
+
caller_path = caller_locations(1, 1).first.path
|
46
|
+
@path = File.expand_path(File.join(File.dirname(caller_path), config))
|
47
|
+
if !File.exists?(@path)
|
48
|
+
@path = "/home/#{User.name}/.config/#{config.split('/').first}"
|
49
|
+
end
|
44
50
|
|
45
51
|
# Open the config file or create in memory yml
|
46
52
|
begin
|