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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d171bf5b89935cfbb7f73b6add32d1a2a98a6ec84d657eff4500d8de1aaa57d2
4
- data.tar.gz: e9290e534a44f9ca5a8b64340e47c9ff7a186c45e39b500a363c6186451fae99
3
+ metadata.gz: 7b7b46d98a9c33d613f4a0c6aa3cd0b7b43f73f2117eadbed6a3ed3146536880
4
+ data.tar.gz: 7ec3d164ae20f7ecd12aa85d826bffc0adeed0de2faf1b0e8e52c403bb8a032e
5
5
  SHA512:
6
- metadata.gz: 589a3cc8f145665ef33cc2ba98f4b503fec3eab9a187bd03a7c6582641218a6947711b98971f76e98c67f2f9df350a9426228a77ee69d3dcd96062316734a7c3
7
- data.tar.gz: 766fcd59efebfd026696da619e1c399f5c53f5878bea1f4c7ef4580b0c8141b403c6787a6e5be0dff7a78f203ee9e9444c0652523ede6e9542b25e0710da8da1
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
- value = dep_attributes[attr_name]
186
- else
187
- value = if attr_config.source && respond_to?(attr_config.source)
188
- send(attr_config.source)
189
- elsif respond_to?(attr_name)
190
- send(attr_name)
191
- else
192
- attr_config.default
193
- end
194
-
195
- value = attr_config.process_value(value, self) if attr_config.respond_to?(:process_value)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GlueGun
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glue_gun_dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Shollenberger