rdm 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rdm/settings.rb +5 -5
- data/lib/rdm/source.rb +2 -2
- data/lib/rdm/source_parser.rb +4 -4
- data/lib/rdm/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: 2a03482e98c87a881ac4ec5599126868ae5e9f5e
|
4
|
+
data.tar.gz: 560f6dce4b59903cbf5bc7308def2f9c5990a3f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 979ab6e554eba662cfffb9a94e3c713e862b10144997fbac30020b5e4bf4f2a6f2d51e10191471c7f9fc0a3dda0c7937789cffeff62946375d64fec21fd4b8fb
|
7
|
+
data.tar.gz: cf2f6e0b5972663bac717b05659ea17ae1841c50635c4bc67c400bd75c422722477f3056ba2da5d491238dcf9335b1bb62efc14ad9f4e27a8150b388d434ad8c
|
data/lib/rdm/settings.rb
CHANGED
@@ -14,16 +14,16 @@ class Rdm::Settings
|
|
14
14
|
end
|
15
15
|
|
16
16
|
SETTING_KEYS.each do |key|
|
17
|
-
define_method(key) do |value = nil|
|
18
|
-
fetch_setting key, value
|
17
|
+
define_method(key) do |value = nil, &block|
|
18
|
+
fetch_setting key, value, &block
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
def fetch_setting(key, value = nil)
|
23
|
-
if value.nil?
|
22
|
+
def fetch_setting(key, value = nil, &block)
|
23
|
+
if value.nil? && !block_given?
|
24
24
|
read_setting(key)
|
25
25
|
else
|
26
|
-
write_setting(key, value)
|
26
|
+
write_setting(key, value || block)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
data/lib/rdm/source.rb
CHANGED
@@ -3,6 +3,8 @@ class Rdm::Source
|
|
3
3
|
|
4
4
|
def initialize(root_path:)
|
5
5
|
@root_path = root_path
|
6
|
+
@config_names = []
|
7
|
+
@package_paths = []
|
6
8
|
end
|
7
9
|
|
8
10
|
# Set setup block for source
|
@@ -14,14 +16,12 @@ class Rdm::Source
|
|
14
16
|
# Add config to list of known configs
|
15
17
|
# @param config_name [String] Config name
|
16
18
|
def config(config_name)
|
17
|
-
@config_names ||= []
|
18
19
|
@config_names << config_name.to_s
|
19
20
|
end
|
20
21
|
|
21
22
|
# Add package to list of known packages
|
22
23
|
# @param package_path [String] Package path
|
23
24
|
def package(package_path)
|
24
|
-
@package_paths ||= []
|
25
25
|
@package_paths << package_path
|
26
26
|
end
|
27
27
|
|
data/lib/rdm/source_parser.rb
CHANGED
@@ -58,14 +58,14 @@ class Rdm::SourceParser
|
|
58
58
|
private
|
59
59
|
# Make sure that all required settings are in place
|
60
60
|
def validate_rdm_settings!
|
61
|
-
if
|
61
|
+
if settings.read_setting(:role).nil?
|
62
62
|
raise SourceValidationError.new(
|
63
|
-
"Please
|
63
|
+
"Please add `role` setting in Rdm.packages. E.g. \r\n setup do\r\n role { ENV['RAILS_ENV'] }\r\n end"
|
64
64
|
)
|
65
65
|
end
|
66
|
-
if
|
66
|
+
if settings.read_setting(:config_path).nil?
|
67
67
|
raise SourceValidationError.new(
|
68
|
-
"Please
|
68
|
+
"Please add `config_path` setting in Rdm.packages. E.g. \r\n setup do\r\n config_path :configs_dir/:config_name/default.yml'\r\n end"
|
69
69
|
)
|
70
70
|
end
|
71
71
|
end
|
data/lib/rdm/version.rb
CHANGED