rsmp 0.3.1 → 0.3.2
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/Gemfile.lock +1 -1
- data/lib/rsmp/components.rb +10 -0
- data/lib/rsmp/site.rb +5 -1
- data/lib/rsmp/version.rb +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: 3e3cdaa079ff62d328eec49b03368afeabc463dd8e805a3ca6cd8d04237deefa
|
4
|
+
data.tar.gz: e4c49d13767b56e0d0efe552406aac32a714b0ff162e680e65716118b88eb280
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa218c2c4404e1a8fdb06c89a60707004adb83ad63b6f9b41a6f8128b8a251112000a6b4f5e6b0cef4109332171172b9c7171e2b7684741d846eafe4f1b573a9
|
7
|
+
data.tar.gz: c221e735fce70db77cd0772c336904d7ac707d2525270bed8c4559c103fec632c5f66717b2cec98f81facfeb8824f0acda1dd924a68d5d99e126c114e9e26536
|
data/Gemfile.lock
CHANGED
data/lib/rsmp/components.rb
CHANGED
@@ -13,6 +13,7 @@ module RSMP
|
|
13
13
|
|
14
14
|
def setup_components settings
|
15
15
|
return unless settings
|
16
|
+
check_main_component settings
|
16
17
|
settings.each_pair do |type,components_by_type|
|
17
18
|
components_by_type.each_pair do |id,settings|
|
18
19
|
@components[id] = build_component(id:id, type:type, settings:settings)
|
@@ -20,6 +21,15 @@ module RSMP
|
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
24
|
+
def check_main_component settings
|
25
|
+
unless settings['main'] && settings['main'].size >= 1
|
26
|
+
raise ConfigurationError.new("main component must be defined")
|
27
|
+
end
|
28
|
+
if settings['main'].size > 1
|
29
|
+
raise ConfigurationError.new("only one main component can be defined, found #{settings['main'].keys.join(', ')}")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
23
33
|
def add_component component
|
24
34
|
@components[component.c_id] = component
|
25
35
|
end
|
data/lib/rsmp/site.rb
CHANGED
@@ -46,7 +46,11 @@ module RSMP
|
|
46
46
|
}
|
47
47
|
}
|
48
48
|
}
|
49
|
-
|
49
|
+
# only one main component can be defined, so replace the default if options define one
|
50
|
+
if options.dig(:site_settings,'components','main')
|
51
|
+
defaults['components']['main'] = options[:site_settings]['components']['main']
|
52
|
+
end
|
53
|
+
|
50
54
|
@site_settings = defaults.deep_merge options[:site_settings]
|
51
55
|
check_sxl_version
|
52
56
|
setup_components @site_settings['components']
|
data/lib/rsmp/version.rb
CHANGED