glue_gun_dsl 0.1.8 → 0.1.9
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/glue_gun/dsl.rb +14 -16
- data/lib/glue_gun/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: 7b7b46d98a9c33d613f4a0c6aa3cd0b7b43f73f2117eadbed6a3ed3146536880
|
4
|
+
data.tar.gz: 7ec3d164ae20f7ecd12aa85d826bffc0adeed0de2faf1b0e8e52c403bb8a032e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ea5e725ad6f9367807b69f7f82a5c5fef8ad3578f1394f9bf9407135e599e7ffa797efa80d76842ce7fc4ff5c114b81d090c831d3d90966d34e087c390deb99
|
7
|
+
data.tar.gz: 219174af57c3c3fc4a1b9ab242ead40375c11fe9ee58a3dc084db6bc6615b6d2c908237f1b21eec55059382eac6421f4a649549a657194b6ef3e1293a14298a7
|
data/lib/glue_gun/dsl.rb
CHANGED
@@ -81,7 +81,7 @@ module GlueGun
|
|
81
81
|
|
82
82
|
attribute_methods_module.class_eval do
|
83
83
|
define_method "#{name}=" do |value|
|
84
|
-
super(value)
|
84
|
+
value = super(value)
|
85
85
|
propagate_attribute_change(name, value) if initialized?
|
86
86
|
end
|
87
87
|
end
|
@@ -181,21 +181,19 @@ module GlueGun
|
|
181
181
|
def build_dependency_attributes(option_config, dep_attributes)
|
182
182
|
option_config.attributes.each do |attr_name, attr_config|
|
183
183
|
# If the attribute is already provided, use it
|
184
|
-
if dep_attributes.key?(attr_name)
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
dep_attributes[attr_name] = value
|
198
|
-
end
|
184
|
+
value = if dep_attributes.key?(attr_name)
|
185
|
+
dep_attributes[attr_name]
|
186
|
+
elsif attr_config.source && respond_to?(attr_config.source)
|
187
|
+
send(attr_config.source)
|
188
|
+
elsif respond_to?(attr_name)
|
189
|
+
send(attr_name)
|
190
|
+
else
|
191
|
+
attr_config.default
|
192
|
+
end
|
193
|
+
|
194
|
+
value = attr_config.process_value(value, self) if attr_config.respond_to?(:process_value)
|
195
|
+
|
196
|
+
dep_attributes[attr_name] = value
|
199
197
|
|
200
198
|
# After getting the value, check if it's required and nil
|
201
199
|
if value.nil? && attr_config.required
|
data/lib/glue_gun/version.rb
CHANGED