compony 0.10.0 → 0.10.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/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/compony.gemspec +3 -3
- data/doc/ComponentGenerator.html +1 -1
- data/doc/Components.html +1 -1
- data/doc/ComponentsGenerator.html +1 -1
- data/doc/Compony/Component.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Labelling.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone.html +1 -1
- data/doc/Compony/ComponentMixins/Default.html +1 -1
- data/doc/Compony/ComponentMixins/Resourceful.html +1 -1
- data/doc/Compony/ComponentMixins.html +1 -1
- data/doc/Compony/Components/Buttons/CssButton.html +1 -1
- data/doc/Compony/Components/Buttons/Link.html +1 -1
- data/doc/Compony/Components/Buttons.html +1 -1
- data/doc/Compony/Components/Destroy.html +1 -1
- data/doc/Compony/Components/Edit.html +1 -1
- data/doc/Compony/Components/Form.html +1 -1
- data/doc/Compony/Components/Index.html +1 -1
- data/doc/Compony/Components/List.html +1 -1
- data/doc/Compony/Components/New.html +1 -1
- data/doc/Compony/Components/Show.html +1 -1
- data/doc/Compony/Components/WithForm.html +1 -1
- data/doc/Compony/Components.html +1 -1
- data/doc/Compony/ControllerMixin.html +1 -1
- data/doc/Compony/Engine.html +1 -1
- data/doc/Compony/Intent.html +77 -63
- data/doc/Compony/ManageIntentsDsl.html +413 -0
- data/doc/Compony/MethodAccessibleHash.html +1 -1
- data/doc/Compony/ModelFields/Anchormodel.html +1 -1
- data/doc/Compony/ModelFields/Association.html +1 -1
- data/doc/Compony/ModelFields/Attachment.html +1 -1
- data/doc/Compony/ModelFields/Base.html +1 -1
- data/doc/Compony/ModelFields/Boolean.html +1 -1
- data/doc/Compony/ModelFields/Color.html +1 -1
- data/doc/Compony/ModelFields/Currency.html +1 -1
- data/doc/Compony/ModelFields/Date.html +1 -1
- data/doc/Compony/ModelFields/Datetime.html +1 -1
- data/doc/Compony/ModelFields/Decimal.html +1 -1
- data/doc/Compony/ModelFields/Email.html +1 -1
- data/doc/Compony/ModelFields/Float.html +1 -1
- data/doc/Compony/ModelFields/Integer.html +1 -1
- data/doc/Compony/ModelFields/Percentage.html +1 -1
- data/doc/Compony/ModelFields/Phone.html +1 -1
- data/doc/Compony/ModelFields/RichText.html +1 -1
- data/doc/Compony/ModelFields/String.html +1 -1
- data/doc/Compony/ModelFields/Text.html +1 -1
- data/doc/Compony/ModelFields/Time.html +1 -1
- data/doc/Compony/ModelFields/Url.html +1 -1
- data/doc/Compony/ModelFields.html +1 -1
- data/doc/Compony/ModelMixin.html +1 -1
- data/doc/Compony/NaturalOrdering.html +1 -1
- data/doc/Compony/RequestContext.html +1 -1
- data/doc/Compony/Version.html +1 -1
- data/doc/Compony/ViewHelpers.html +1 -1
- data/doc/Compony/VirtualModel.html +1 -1
- data/doc/Compony.html +1 -1
- data/doc/ComponyController.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/intent.rb +8 -1
- data/lib/compony/manage_intents_dsl.rb +6 -4
- metadata +2 -1
|
@@ -1084,7 +1084,7 @@
|
|
|
1084
1084
|
</div>
|
|
1085
1085
|
|
|
1086
1086
|
<div id="footer">
|
|
1087
|
-
Generated on Mon Dec 8
|
|
1087
|
+
Generated on Mon Dec 8 18:10:35 2025 by
|
|
1088
1088
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1089
1089
|
0.9.34 (ruby-3.3.5).
|
|
1090
1090
|
</div>
|
data/doc/Compony/Version.html
CHANGED
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
</div>
|
|
130
130
|
|
|
131
131
|
<div id="footer">
|
|
132
|
-
Generated on Mon Dec 8
|
|
132
|
+
Generated on Mon Dec 8 18:10:34 2025 by
|
|
133
133
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
134
134
|
0.9.34 (ruby-3.3.5).
|
|
135
135
|
</div>
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
</div>
|
|
223
223
|
|
|
224
224
|
<div id="footer">
|
|
225
|
-
Generated on Mon Dec 8
|
|
225
|
+
Generated on Mon Dec 8 18:10:34 2025 by
|
|
226
226
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
227
227
|
0.9.34 (ruby-3.3.5).
|
|
228
228
|
</div>
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
</div>
|
|
143
143
|
|
|
144
144
|
<div id="footer">
|
|
145
|
-
Generated on Mon Dec 8
|
|
145
|
+
Generated on Mon Dec 8 18:10:35 2025 by
|
|
146
146
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
147
147
|
0.9.34 (ruby-3.3.5).
|
|
148
148
|
</div>
|
data/doc/Compony.html
CHANGED
|
@@ -1674,7 +1674,7 @@
|
|
|
1674
1674
|
</div>
|
|
1675
1675
|
|
|
1676
1676
|
<div id="footer">
|
|
1677
|
-
Generated on Mon Dec 8
|
|
1677
|
+
Generated on Mon Dec 8 18:10:34 2025 by
|
|
1678
1678
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1679
1679
|
0.9.34 (ruby-3.3.5).
|
|
1680
1680
|
</div>
|
data/doc/ComponyController.html
CHANGED
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
</div>
|
|
115
115
|
|
|
116
116
|
<div id="footer">
|
|
117
|
-
Generated on Mon Dec 8
|
|
117
|
+
Generated on Mon Dec 8 18:10:35 2025 by
|
|
118
118
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
119
119
|
0.9.34 (ruby-3.3.5).
|
|
120
120
|
</div>
|
data/doc/_index.html
CHANGED
|
@@ -622,7 +622,7 @@
|
|
|
622
622
|
</div>
|
|
623
623
|
|
|
624
624
|
<div id="footer">
|
|
625
|
-
Generated on Mon Dec 8
|
|
625
|
+
Generated on Mon Dec 8 18:10:34 2025 by
|
|
626
626
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
627
627
|
0.9.34 (ruby-3.3.5).
|
|
628
628
|
</div>
|
data/doc/file.README.html
CHANGED
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
</div></div>
|
|
200
200
|
|
|
201
201
|
<div id="footer">
|
|
202
|
-
Generated on Mon Dec 8
|
|
202
|
+
Generated on Mon Dec 8 18:10:34 2025 by
|
|
203
203
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
204
204
|
0.9.34 (ruby-3.3.5).
|
|
205
205
|
</div>
|
data/doc/index.html
CHANGED
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
</div></div>
|
|
200
200
|
|
|
201
201
|
<div id="footer">
|
|
202
|
-
Generated on Mon Dec 8
|
|
202
|
+
Generated on Mon Dec 8 18:10:34 2025 by
|
|
203
203
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
204
204
|
0.9.34 (ruby-3.3.5).
|
|
205
205
|
</div>
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
</div>
|
|
103
103
|
|
|
104
104
|
<div id="footer">
|
|
105
|
-
Generated on Mon Dec 8
|
|
105
|
+
Generated on Mon Dec 8 18:10:34 2025 by
|
|
106
106
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
107
107
|
0.9.34 (ruby-3.3.5).
|
|
108
108
|
</div>
|
data/lib/compony/intent.rb
CHANGED
|
@@ -51,7 +51,13 @@ module Compony
|
|
|
51
51
|
@comp_class = comp_name_or_cst_or_class
|
|
52
52
|
else
|
|
53
53
|
# Build the constant from the first two arguments
|
|
54
|
-
family_underscore_str =
|
|
54
|
+
family_underscore_str = if !(model_or_family_name_or_cst.is_a?(String) || model_or_family_name_or_cst.is_a?(Symbol)) && @data.respond_to?(:model_name)
|
|
55
|
+
# Determine the component family from the data
|
|
56
|
+
@data.model_name.plural
|
|
57
|
+
else
|
|
58
|
+
# Determine the component family from the given argument
|
|
59
|
+
model_or_family_name_or_cst.to_s.underscore
|
|
60
|
+
end
|
|
55
61
|
constant_str = "::Components::#{family_underscore_str.camelize}::#{comp_name_or_cst_or_class.to_s.camelize}"
|
|
56
62
|
@comp_class = constant_str.constantize
|
|
57
63
|
end
|
|
@@ -88,6 +94,7 @@ module Compony
|
|
|
88
94
|
# @param model [ApplicationRecord] If given and non-nil, will override the model passed to the component's path block
|
|
89
95
|
# @param standalone_name [Symbol] If given and non-nil, will override the `standalone_name` passed to the component's path block
|
|
90
96
|
def path(model = nil, *, standalone_name: nil, **path_opt_overrides)
|
|
97
|
+
return @path if @path.present?
|
|
91
98
|
return nil if @comp_class.nil?
|
|
92
99
|
path_opts = @path_opts.deep_merge(path_opt_overrides)
|
|
93
100
|
comp.path(model || (model? ? @data : nil), standalone_name: standalone_name || @standalone_name, **path_opts)
|
|
@@ -12,11 +12,13 @@ module Compony
|
|
|
12
12
|
# Adds or replaces an intent to those exposed by the component based on the intent name (override the name if you need to avoid a naming collision).
|
|
13
13
|
# Intents specified this way can be retrieved and rendered by the parent component or by calling `root_intents` in case of standalone access.
|
|
14
14
|
# @param [Symbol] before If specified, will insert the intent before the other. When replacing, an element keeps its position unless `before:`` is passed.
|
|
15
|
-
def add(
|
|
16
|
-
intent = Compony.intent(
|
|
15
|
+
def add(*args, before: nil, **kwargs)
|
|
16
|
+
intent = Compony.intent(*args, **@intent_opts, **kwargs)
|
|
17
17
|
@exposed_intents.natural_push(intent.name, intent, before:)
|
|
18
|
-
rescue NameError # Ignore if the component is not actually defined
|
|
19
|
-
|
|
18
|
+
rescue NameError => e # Ignore if the component is not actually defined
|
|
19
|
+
Rails.logger.debug do
|
|
20
|
+
"Skipping intent for arguments #{args.inspect}, #{kwargs.inspect}: #{e.inspect}."
|
|
21
|
+
end
|
|
20
22
|
end
|
|
21
23
|
|
|
22
24
|
# DSL method
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: compony
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.10.
|
|
4
|
+
version: 0.10.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sandro Kalbermatter
|
|
@@ -218,6 +218,7 @@ files:
|
|
|
218
218
|
- doc/Compony/Engine.html
|
|
219
219
|
- doc/Compony/ExposedIntentsDsl.html
|
|
220
220
|
- doc/Compony/Intent.html
|
|
221
|
+
- doc/Compony/ManageIntentsDsl.html
|
|
221
222
|
- doc/Compony/MethodAccessibleHash.html
|
|
222
223
|
- doc/Compony/ModelFields.html
|
|
223
224
|
- doc/Compony/ModelFields/Anchormodel.html
|