takelage 0.16.0 → 0.17.0
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/takelage/lib/config.rb +21 -4
- data/lib/takelage/version +1 -1
- 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: d7143b5ce147127b3a0cf4ebf69dcb673e0e031fd163c3992fa602a5d03293b3
|
4
|
+
data.tar.gz: 545368ec9301049e782727636a3fd281c332d190990337b989ea652a1b8e58ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaad0481173e35a0146e02c69929938331d23527e1c1fb809d8df214b51f8d319e272d7ae2efda2017bd113e4bc6b15ea73b89aac48523b04fc8456e2ef25634
|
7
|
+
data.tar.gz: d35e4e3fa76dd58740f719e5ac7aad48ae27d1094becfbffefffdc6188fa1ab141c0d5a0392e3a58dcafa190d5e65063e1d160756a9f696e2cd8b70bb2065bd8
|
data/lib/takelage/lib/config.rb
CHANGED
@@ -38,16 +38,33 @@ module ConfigModule
|
|
38
38
|
def configured?(config_keys)
|
39
39
|
@configured = true
|
40
40
|
config_keys.each do |config_key|
|
41
|
-
unless
|
42
|
-
|
43
|
-
@configured = false
|
44
|
-
end
|
41
|
+
next unless _check_key_defined? config_key
|
42
|
+
next unless _check_key_set? config_key
|
45
43
|
end
|
46
44
|
@configured
|
47
45
|
end
|
48
46
|
|
49
47
|
private
|
50
48
|
|
49
|
+
# Check if config key is defined.
|
50
|
+
def _check_key_defined?(config_key)
|
51
|
+
return true if TakelageConfig.instance.active.key? config_key
|
52
|
+
|
53
|
+
log.error "Undefined config key. Please configure \"#{config_key}\""
|
54
|
+
@configured = false
|
55
|
+
false
|
56
|
+
end
|
57
|
+
|
58
|
+
# Check if config key is nil or empty
|
59
|
+
def _check_key_set?(config_key)
|
60
|
+
takel_config_key = TakelageConfig.instance.active[config_key]
|
61
|
+
return true unless takel_config_key.nil? || takel_config_key.empty?
|
62
|
+
|
63
|
+
log.error "Unset config key. Please configure \"#{config_key}\""
|
64
|
+
@configured = false
|
65
|
+
false
|
66
|
+
end
|
67
|
+
|
51
68
|
# Read default config file in lib.
|
52
69
|
def _config_read_default
|
53
70
|
default_file = File.expand_path("#{File.dirname(__FILE__)}/../default.yml")
|
data/lib/takelage/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.17.0
|