glue_gun_dsl 0.1.11 → 0.1.13
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
- data/lib/glue_gun.rb +1 -0
- 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: a744558606a85cbfc6641c33ba4aae92925712e9ee8b30555aad1309773def0e
|
4
|
+
data.tar.gz: 49d3742eccba3ed436ee950b74c8aa5627d5a36ac1cca8fafe625904f9cd567d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fd64a4f71a0fd2fee778ce93609bbda6bbf38aff76feeeb9c8bd8d427c75def7c83471ac091cf40dbcc6f7ca16070ed2a89cf1d19e3e1d3eb48c2196d213edf
|
7
|
+
data.tar.gz: 46e927fdfe42d553b6ee39e069cfea564fa2d10afd6548618d5bfd1b35db964024d0156a84986f126f85929b78a89de31c3994f61b43780906a3b3cf0b0c2194
|
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
data/lib/glue_gun.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.13
|
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
|