glue_gun_dsl 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/glue_gun/dsl.rb +8 -4
- data/lib/glue_gun/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a663641fdcec4866446e9d72583c2e3be4e038604cb22466ee094e81fc17bb79
|
4
|
+
data.tar.gz: 7cc36ed0ad6903f243a129fddee1426995364f703505dad2812322e890a14322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10571a6ef7a315f566f5d49140aa0e4743433707ab5c8363d862f7fd318d775e32b6d636fb6698900c0d39706a0da2e77fb35bb3812f919aca4bd1d350df383e
|
7
|
+
data.tar.gz: 8e0754d69e1ae48e7d0c8ca396d8afd747967c51bbaced995af0b82f203b431a2eeaf8c47784a08273ce8b6596acb330964063a31f8cdaf414b8b1a1f35a4e66
|
data/lib/glue_gun/dsl.rb
CHANGED
@@ -121,7 +121,6 @@ module GlueGun
|
|
121
121
|
attribute_methods_module.class_eval do
|
122
122
|
define_method "#{component_type}=" do |init_args|
|
123
123
|
instance_variable_set("@#{component_type}", initialize_dependency(component_type, init_args))
|
124
|
-
# propagate_attribute_change(component_type, value) if initialized?
|
125
124
|
end
|
126
125
|
end
|
127
126
|
end
|
@@ -185,6 +184,11 @@ module GlueGun
|
|
185
184
|
# Build dependency attributes, including sourcing from parent
|
186
185
|
dep_attributes = build_dependency_attributes(option_config, dep_attributes)
|
187
186
|
|
187
|
+
if dep_attributes.key?(:id)
|
188
|
+
raise ArgumentError,
|
189
|
+
"cannot bind attribute 'id' between #{self.class.name} and #{option_config.class_name}. ID is reserved for primary keys in Ruby on Rails"
|
190
|
+
end
|
191
|
+
|
188
192
|
dependency_instance = instantiate_dependency(option_config, dep_attributes)
|
189
193
|
|
190
194
|
# Keep track of dependencies for attribute binding
|
@@ -362,8 +366,8 @@ module GlueGun
|
|
362
366
|
set_default_option_name(:default)
|
363
367
|
end
|
364
368
|
|
365
|
-
def
|
366
|
-
single_option.
|
369
|
+
def bind_attribute(name, default: nil, required: false, source: nil, &block)
|
370
|
+
single_option.bind_attribute(name, default: default, required: required, source: source, &block)
|
367
371
|
end
|
368
372
|
|
369
373
|
def get_option(name)
|
@@ -430,7 +434,7 @@ module GlueGun
|
|
430
434
|
end
|
431
435
|
end
|
432
436
|
|
433
|
-
def
|
437
|
+
def bind_attribute(name, default: nil, required: false, source: nil, &block)
|
434
438
|
attr = ConfigAttr.new(name, default: default, required: required, source: source, &block)
|
435
439
|
@attributes[name.to_sym] = attr
|
436
440
|
end
|
data/lib/glue_gun/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glue_gun_dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Shollenberger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|