compony 0.5.6 → 0.5.8

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.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/Gemfile.lock +37 -29
  4. data/README.md +20 -3
  5. data/VERSION +1 -1
  6. data/compony.gemspec +3 -3
  7. data/doc/ComponentGenerator.html +20 -4
  8. data/doc/Components.html +1 -1
  9. data/doc/ComponentsGenerator.html +1 -1
  10. data/doc/Compony/Component.html +62 -322
  11. data/doc/Compony/ComponentMixins/Default/Labelling.html +1 -1
  12. data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
  13. data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +1 -1
  14. data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
  15. data/doc/Compony/ComponentMixins/Default/Standalone.html +1 -1
  16. data/doc/Compony/ComponentMixins/Default.html +1 -1
  17. data/doc/Compony/ComponentMixins/Resourceful.html +1 -1
  18. data/doc/Compony/ComponentMixins.html +1 -1
  19. data/doc/Compony/Components/Button.html +2 -2
  20. data/doc/Compony/Components/Destroy.html +2 -2
  21. data/doc/Compony/Components/Edit.html +14 -14
  22. data/doc/Compony/Components/Form.html +2 -2
  23. data/doc/Compony/Components/New.html +2 -2
  24. data/doc/Compony/Components/WithForm.html +2 -2
  25. data/doc/Compony/Components.html +1 -1
  26. data/doc/Compony/ControllerMixin.html +1 -1
  27. data/doc/Compony/Engine.html +1 -1
  28. data/doc/Compony/MethodAccessibleHash.html +1 -1
  29. data/doc/Compony/ModelFields/Anchormodel.html +1 -1
  30. data/doc/Compony/ModelFields/Association.html +1 -1
  31. data/doc/Compony/ModelFields/Attachment.html +1 -1
  32. data/doc/Compony/ModelFields/Base.html +1 -1
  33. data/doc/Compony/ModelFields/Boolean.html +1 -1
  34. data/doc/Compony/ModelFields/Color.html +1 -1
  35. data/doc/Compony/ModelFields/Currency.html +1 -1
  36. data/doc/Compony/ModelFields/Date.html +1 -1
  37. data/doc/Compony/ModelFields/Datetime.html +1 -1
  38. data/doc/Compony/ModelFields/Decimal.html +1 -1
  39. data/doc/Compony/ModelFields/Email.html +1 -1
  40. data/doc/Compony/ModelFields/Float.html +1 -1
  41. data/doc/Compony/ModelFields/Integer.html +1 -1
  42. data/doc/Compony/ModelFields/Percentage.html +1 -1
  43. data/doc/Compony/ModelFields/Phone.html +1 -1
  44. data/doc/Compony/ModelFields/RichText.html +2 -2
  45. data/doc/Compony/ModelFields/String.html +1 -1
  46. data/doc/Compony/ModelFields/Text.html +1 -1
  47. data/doc/Compony/ModelFields/Time.html +1 -1
  48. data/doc/Compony/ModelFields/Url.html +1 -1
  49. data/doc/Compony/ModelFields.html +1 -1
  50. data/doc/Compony/ModelMixin.html +1 -1
  51. data/doc/Compony/NaturalOrdering.html +1 -1
  52. data/doc/Compony/RequestContext.html +3 -3
  53. data/doc/Compony/Version.html +1 -1
  54. data/doc/Compony/ViewHelpers.html +27 -13
  55. data/doc/Compony.html +1 -1
  56. data/doc/ComponyController.html +1 -1
  57. data/doc/_index.html +1 -1
  58. data/doc/file.README.html +26 -4
  59. data/doc/index.html +26 -4
  60. data/doc/method_list.html +0 -32
  61. data/doc/top-level-namespace.html +1 -1
  62. data/lib/compony/component.rb +5 -13
  63. data/lib/compony/components/edit.rb +2 -1
  64. data/lib/compony/components/new.rb +1 -1
  65. data/lib/compony/model_fields/rich_text.rb +1 -1
  66. data/lib/compony/request_context.rb +1 -1
  67. data/lib/compony/view_helpers.rb +12 -5
  68. data/lib/generators/component/component_generator.rb +8 -0
  69. data/lib/generators/component/templates/with_base_component.rb.erb +4 -0
  70. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 409a46d747755df0ba164ebf92c9b0905edc185f59211fc15c9b91926a933e12
4
- data.tar.gz: 0615af9691574db8d6b5e12601da4aff35b1b13c07f06041550a0288be52c261
3
+ metadata.gz: 13adc9eeac8af83115ff6c2c436681af00b3223fa565d038642bef5e27c5589c
4
+ data.tar.gz: c643784b9c0a0d96a07910b56f89c85f430144b8f256b9842aae88d4167f5bca
5
5
  SHA512:
6
- metadata.gz: bc06e6323b5f36cb21559e0153fe60e09699507422f277ceb63550533c68ddcd408502a06058a331065b642cb6f944e2e4f6f755483e4828f2c354195409a226
7
- data.tar.gz: c8727cae55bc20281304911a99c208a75e1ddaf454261290731a6ab8b284cd8720bb245c4114c8854e97c97402287f10c22ba4137921695c3ef25e24f6c8e80f
6
+ metadata.gz: 03627ad9d57ffa7cdb79320f51d39416b2be0f561b3d91a7901fd8cd238fe6a655ef38574ba3e352f4a297f70ec2e5d921df46fba94c53321f5678f0d2fdecd1
7
+ data.tar.gz: 828b6522e93d13b23aa606a8b7ec38102120708c26761df70c1e88bced8a624948c6570bcb4040e595b89414a13e07a4a97625a03ecdacc9aa469988b535ad83
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ # 0.5.8
2
+
3
+ - Apply most recent rubocop recommendations
4
+ - Update rubocop
5
+ - #10: Implement feasibility framework for links
6
+ - Support `BaseComponents`
7
+
8
+ # 0.5.7
9
+
10
+ - Fix a minor bug causing unnecessary param `id` to be added to the path after creating or updating when redirecting back to the index component
11
+
1
12
  # 0.5.6
2
13
 
3
14
  - Allow overriding the label in the view helper `compony_link`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- compony (0.5.4.edge)
4
+ compony (0.5.8.edge)
5
5
  anchormodel (~> 0.2.1)
6
6
  cancancan (~> 3.6.1)
7
7
  dslblend (>= 0.0.3)
@@ -86,31 +86,32 @@ GEM
86
86
  tzinfo (~> 2.0, >= 2.0.5)
87
87
  anchormodel (0.2.2)
88
88
  rails (~> 7.0)
89
- ast (2.4.2)
90
- base64 (0.2.0)
91
- bigdecimal (3.1.4)
89
+ ast (2.4.3)
90
+ base64 (0.3.0)
91
+ bigdecimal (3.2.2)
92
92
  builder (3.2.4)
93
93
  cancancan (3.6.1)
94
- concurrent-ruby (1.3.4)
95
- connection_pool (2.4.1)
94
+ concurrent-ruby (1.3.5)
95
+ connection_pool (2.5.3)
96
96
  crass (1.0.6)
97
97
  date (3.3.3)
98
- drb (2.2.0)
99
- ruby2_keywords
98
+ drb (2.2.3)
100
99
  dslblend (0.0.3)
101
100
  dyny (0.0.3)
102
101
  rails
103
102
  erubi (1.12.0)
104
103
  globalid (1.1.0)
105
104
  activesupport (>= 5.0)
106
- i18n (1.13.0)
105
+ i18n (1.14.7)
107
106
  concurrent-ruby (~> 1.0)
108
107
  io-console (0.6.0)
109
108
  irb (1.14.0)
110
109
  rdoc (>= 4.0.0)
111
110
  reline (>= 0.4.2)
112
- json (2.6.3)
113
- logger (1.6.1)
111
+ json (2.13.2)
112
+ language_server-protocol (3.17.0.5)
113
+ lint_roller (1.1.0)
114
+ logger (1.7.0)
114
115
  loofah (2.21.3)
115
116
  crass (~> 1.0.2)
116
117
  nokogiri (>= 1.12.0)
@@ -122,7 +123,7 @@ GEM
122
123
  marcel (1.0.2)
123
124
  mini_mime (1.1.2)
124
125
  mini_portile2 (2.8.7)
125
- minitest (5.18.0)
126
+ minitest (5.25.5)
126
127
  net-imap (0.3.4)
127
128
  date
128
129
  net-protocol
@@ -136,13 +137,15 @@ GEM
136
137
  nokogiri (1.15.0)
137
138
  mini_portile2 (~> 2.8.2)
138
139
  racc (~> 1.4)
139
- parallel (1.23.0)
140
- parser (3.2.2.1)
140
+ parallel (1.27.0)
141
+ parser (3.3.9.0)
141
142
  ast (~> 2.4.1)
143
+ racc
144
+ prism (1.4.0)
142
145
  psych (5.1.1.1)
143
146
  stringio
144
147
  racc (1.6.2)
145
- rack (2.2.7)
148
+ rack (2.2.17)
146
149
  rack-session (1.0.1)
147
150
  rack (< 3)
148
151
  rack-test (2.1.0)
@@ -183,34 +186,37 @@ GEM
183
186
  rake (13.0.6)
184
187
  rdoc (6.6.0)
185
188
  psych (>= 4.0.0)
186
- regexp_parser (2.8.0)
189
+ regexp_parser (2.11.2)
187
190
  reline (0.5.10)
188
191
  io-console (~> 0.5)
189
192
  request_store (1.7.0)
190
193
  rack (>= 1.4)
191
- rexml (3.2.5)
192
- rubocop (1.51.0)
194
+ rubocop (1.79.2)
193
195
  json (~> 2.3)
196
+ language_server-protocol (~> 3.17.0.2)
197
+ lint_roller (~> 1.1.0)
194
198
  parallel (~> 1.10)
195
- parser (>= 3.2.0.0)
199
+ parser (>= 3.3.0.2)
196
200
  rainbow (>= 2.2.2, < 4.0)
197
- regexp_parser (>= 1.8, < 3.0)
198
- rexml (>= 3.2.5, < 4.0)
199
- rubocop-ast (>= 1.28.0, < 2.0)
201
+ regexp_parser (>= 2.9.3, < 3.0)
202
+ rubocop-ast (>= 1.46.0, < 2.0)
200
203
  ruby-progressbar (~> 1.7)
201
- unicode-display_width (>= 2.4.0, < 3.0)
202
- rubocop-ast (1.28.1)
203
- parser (>= 3.2.1.0)
204
- rubocop-rails (2.19.1)
204
+ unicode-display_width (>= 2.4.0, < 4.0)
205
+ rubocop-ast (1.46.0)
206
+ parser (>= 3.3.7.2)
207
+ prism (~> 1.4)
208
+ rubocop-rails (2.33.3)
205
209
  activesupport (>= 4.2.0)
210
+ lint_roller (~> 1.1)
206
211
  rack (>= 1.1)
207
- rubocop (>= 1.33.0, < 2.0)
212
+ rubocop (>= 1.75.0, < 2.0)
213
+ rubocop-ast (>= 1.44.0, < 2.0)
208
214
  ruby-progressbar (1.13.0)
209
215
  ruby2_keywords (0.0.4)
210
216
  schemacop (3.0.24)
211
217
  activesupport (>= 4.0)
212
218
  ruby2_keywords (= 0.0.4)
213
- securerandom (0.3.1)
219
+ securerandom (0.4.1)
214
220
  simple_form (5.3.1)
215
221
  actionpack (>= 5.2)
216
222
  activemodel (>= 5.2)
@@ -219,7 +225,9 @@ GEM
219
225
  timeout (0.4.1)
220
226
  tzinfo (2.0.6)
221
227
  concurrent-ruby (~> 1.0)
222
- unicode-display_width (2.4.2)
228
+ unicode-display_width (3.1.5)
229
+ unicode-emoji (~> 4.0, >= 4.0.4)
230
+ unicode-emoji (4.0.4)
223
231
  useragent (0.16.10)
224
232
  webrick (1.8.1)
225
233
  websocket-driver (0.7.5)
data/README.md CHANGED
@@ -1199,14 +1199,15 @@ prevent [:create_booking, :destroy_booking], 'the event is already over' do
1199
1199
  end
1200
1200
  ```
1201
1201
 
1202
- **Note that the feasibility framework currently only affects buttons pointing to actions, not the action itself.** If a user were to issue the HTTP call manually, the component happily responds and performs the action. This is why you should always back important preventions with an appropriate Rails model validation:
1202
+ **Note that the feasibility framework currently only affects buttons/links pointing to actions, not the action itself.** If a user were to issue the HTTP call manually, the component happily responds and performs the action. This is why you should always back important preventions with an appropriate Rails model validation:
1203
1203
 
1204
1204
  - The Rails model validation prevents that invalid data can be saved to the database.
1205
- - The feasibility framework disables buttons and explains to guide the user.
1205
+ - The feasibility framework disables buttons and links and explains to guide the user.
1206
+ - Links are disabled by changing the href to `'#'` and adding the `.disabled` class, which is useful when bootstrap is used.
1206
1207
  - Authorization is orthogonal to this, limiting the actions of a specific user.
1207
1208
  - If an action is both prevented and not authorized, the authorization "wins" and the action button is not shown at all.
1208
1209
 
1209
- Compony has a feature that auto-detects feasibility. In particular, it checks for `dependent` relations in the `has_one`/`has_many` relations and disables delete buttons that point to objects that have dependent objects that cannot automatically be destroyed.
1210
+ Compony has a feature that auto-detects feasibility of some actions. In particular, it checks for `dependent` relations in the `has_one`/`has_many` relations and disables delete buttons that point to objects that have dependent objects that cannot automatically be destroyed.
1210
1211
 
1211
1212
  To disable auto detection, call `skip_autodetect_feasibilities` in your model.
1212
1213
 
@@ -1512,6 +1513,22 @@ To make your life easier and coding faster, Compony comes with two generators:
1512
1513
  - The generator can also be called via its alternative form `rails g component users/new`.
1513
1514
  - `rails g components Users` will generate a set of the most used components.
1514
1515
 
1516
+ ### Support for custom base components
1517
+
1518
+ If your application has many components that share the same functionality, it may be a good idea to create a custom base component, which acts as an abstract class.
1519
+
1520
+ Examples:
1521
+
1522
+ - Perhaps you have code shared in all of your `New` components. In this case, create `BaseComponents::New` and inherit from `Compony::Components::New`. In `setup` of your base component, you can now perform all the configurations needed. Now you may inherit from it: `class Components::Users::New < BaseComponents::New`.
1523
+ - Perhaps you often implement the same kind of component, for instance an index component displaying a filterable list. In this case, create `BaseComponents::Index` and inherit as follows: `class Components::Users::Index < BaseComponents::Index`.
1524
+
1525
+ Compony has the following convention:
1526
+
1527
+ - implement a custom base component in the directory `app/compony/base_components/your_component.rb`
1528
+ - name the class `BaseComponents::YourComponent` where `BaseComponents` is typically a module simple meant for namespacing
1529
+
1530
+ When respecting these conventions, compony's generators will automatically make generated classes inherit from the suitable base component if one is available. In the example above, `rails g component Users::Index` will automatically make the generated class inherit from `BaseComponent::Index`.
1531
+
1515
1532
  ## Internal datastructures
1516
1533
 
1517
1534
  Compony has a few internal data structures that are worth mentioning. Especially when building your own UI framework on top of Compony, these might come in handy.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.6
1
+ 0.5.8
data/compony.gemspec CHANGED
@@ -2,17 +2,17 @@
2
2
  # This file is auto-generated via: 'rake gemspec'.
3
3
 
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: compony 0.5.6 ruby lib
5
+ # stub: compony 0.5.8 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "compony".freeze
9
- s.version = "0.5.6".freeze
9
+ s.version = "0.5.8".freeze
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Sandro Kalbermatter".freeze, "contributors".freeze]
14
14
  s.date = "1980-01-02"
15
- s.files = [".gitignore".freeze, ".ruby-version".freeze, ".yardopts".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "Gemfile.lock".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "TODO.md".freeze, "VERSION".freeze, "app/controllers/compony_controller.rb".freeze, "compony.gemspec".freeze, "config/locales/de.yml".freeze, "config/locales/en.yml".freeze, "config/locales/fr.yml".freeze, "config/routes.rb".freeze, "doc/ComponentGenerator.html".freeze, "doc/Components.html".freeze, "doc/ComponentsGenerator.html".freeze, "doc/Compony.html".freeze, "doc/Compony/Component.html".freeze, "doc/Compony/ComponentMixins.html".freeze, "doc/Compony/ComponentMixins/Default.html".freeze, "doc/Compony/ComponentMixins/Default/Labelling.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html".freeze, "doc/Compony/ComponentMixins/Resourceful.html".freeze, "doc/Compony/Components.html".freeze, "doc/Compony/Components/Button.html".freeze, "doc/Compony/Components/Destroy.html".freeze, "doc/Compony/Components/Edit.html".freeze, "doc/Compony/Components/Form.html".freeze, "doc/Compony/Components/New.html".freeze, "doc/Compony/Components/WithForm.html".freeze, "doc/Compony/ControllerMixin.html".freeze, "doc/Compony/Engine.html".freeze, "doc/Compony/MethodAccessibleHash.html".freeze, "doc/Compony/ModelFields.html".freeze, "doc/Compony/ModelFields/Anchormodel.html".freeze, "doc/Compony/ModelFields/Association.html".freeze, "doc/Compony/ModelFields/Attachment.html".freeze, "doc/Compony/ModelFields/Base.html".freeze, "doc/Compony/ModelFields/Boolean.html".freeze, "doc/Compony/ModelFields/Color.html".freeze, "doc/Compony/ModelFields/Currency.html".freeze, "doc/Compony/ModelFields/Date.html".freeze, "doc/Compony/ModelFields/Datetime.html".freeze, "doc/Compony/ModelFields/Decimal.html".freeze, "doc/Compony/ModelFields/Email.html".freeze, "doc/Compony/ModelFields/Float.html".freeze, "doc/Compony/ModelFields/Integer.html".freeze, "doc/Compony/ModelFields/Percentage.html".freeze, "doc/Compony/ModelFields/Phone.html".freeze, "doc/Compony/ModelFields/RichText.html".freeze, "doc/Compony/ModelFields/String.html".freeze, "doc/Compony/ModelFields/Text.html".freeze, "doc/Compony/ModelFields/Time.html".freeze, "doc/Compony/ModelFields/Url.html".freeze, "doc/Compony/ModelMixin.html".freeze, "doc/Compony/NaturalOrdering.html".freeze, "doc/Compony/RequestContext.html".freeze, "doc/Compony/Version.html".freeze, "doc/Compony/ViewHelpers.html".freeze, "doc/ComponyController.html".freeze, "doc/_index.html".freeze, "doc/class_list.html".freeze, "doc/css/common.css".freeze, "doc/css/full_list.css".freeze, "doc/css/style.css".freeze, "doc/file.README.html".freeze, "doc/file_list.html".freeze, "doc/frames.html".freeze, "doc/imgs/intro-example-destroy.png".freeze, "doc/imgs/intro-example-edit.png".freeze, "doc/imgs/intro-example-index.png".freeze, "doc/imgs/intro-example-new.png".freeze, "doc/imgs/intro-example-show.png".freeze, "doc/index.html".freeze, "doc/js/app.js".freeze, "doc/js/full_list.js".freeze, "doc/js/jquery.js".freeze, "doc/method_list.html".freeze, "doc/resourceful_lifecycle.graphml".freeze, "doc/resourceful_lifecycle.pdf".freeze, "doc/resourceful_lifecycle.png".freeze, "doc/top-level-namespace.html".freeze, "lib/compony.rb".freeze, "lib/compony/component.rb".freeze, "lib/compony/component_mixins/default/labelling.rb".freeze, "lib/compony/component_mixins/default/standalone.rb".freeze, "lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/standalone_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/verb_dsl.rb".freeze, "lib/compony/component_mixins/resourceful.rb".freeze, "lib/compony/components/button.rb".freeze, "lib/compony/components/destroy.rb".freeze, "lib/compony/components/edit.rb".freeze, "lib/compony/components/form.rb".freeze, "lib/compony/components/new.rb".freeze, "lib/compony/components/with_form.rb".freeze, "lib/compony/controller_mixin.rb".freeze, "lib/compony/engine.rb".freeze, "lib/compony/method_accessible_hash.rb".freeze, "lib/compony/model_fields/anchormodel.rb".freeze, "lib/compony/model_fields/association.rb".freeze, "lib/compony/model_fields/attachment.rb".freeze, "lib/compony/model_fields/base.rb".freeze, "lib/compony/model_fields/boolean.rb".freeze, "lib/compony/model_fields/color.rb".freeze, "lib/compony/model_fields/currency.rb".freeze, "lib/compony/model_fields/date.rb".freeze, "lib/compony/model_fields/datetime.rb".freeze, "lib/compony/model_fields/decimal.rb".freeze, "lib/compony/model_fields/email.rb".freeze, "lib/compony/model_fields/float.rb".freeze, "lib/compony/model_fields/integer.rb".freeze, "lib/compony/model_fields/percentage.rb".freeze, "lib/compony/model_fields/phone.rb".freeze, "lib/compony/model_fields/rich_text.rb".freeze, "lib/compony/model_fields/string.rb".freeze, "lib/compony/model_fields/text.rb".freeze, "lib/compony/model_fields/time.rb".freeze, "lib/compony/model_fields/url.rb".freeze, "lib/compony/model_mixin.rb".freeze, "lib/compony/natural_ordering.rb".freeze, "lib/compony/request_context.rb".freeze, "lib/compony/version.rb".freeze, "lib/compony/view_helpers.rb".freeze, "lib/generators/component/USAGE".freeze, "lib/generators/component/component_generator.rb".freeze, "lib/generators/component/templates/component.rb.erb".freeze, "lib/generators/component/templates/destroy.rb.erb".freeze, "lib/generators/component/templates/edit.rb.erb".freeze, "lib/generators/component/templates/form.rb.erb".freeze, "lib/generators/component/templates/new.rb.erb".freeze, "lib/generators/components/USAGE".freeze, "lib/generators/components/components_generator.rb".freeze, "logo.svg".freeze]
15
+ s.files = [".gitignore".freeze, ".ruby-version".freeze, ".yardopts".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "Gemfile.lock".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "TODO.md".freeze, "VERSION".freeze, "app/controllers/compony_controller.rb".freeze, "compony.gemspec".freeze, "config/locales/de.yml".freeze, "config/locales/en.yml".freeze, "config/locales/fr.yml".freeze, "config/routes.rb".freeze, "doc/ComponentGenerator.html".freeze, "doc/Components.html".freeze, "doc/ComponentsGenerator.html".freeze, "doc/Compony.html".freeze, "doc/Compony/Component.html".freeze, "doc/Compony/ComponentMixins.html".freeze, "doc/Compony/ComponentMixins/Default.html".freeze, "doc/Compony/ComponentMixins/Default/Labelling.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html".freeze, "doc/Compony/ComponentMixins/Resourceful.html".freeze, "doc/Compony/Components.html".freeze, "doc/Compony/Components/Button.html".freeze, "doc/Compony/Components/Destroy.html".freeze, "doc/Compony/Components/Edit.html".freeze, "doc/Compony/Components/Form.html".freeze, "doc/Compony/Components/New.html".freeze, "doc/Compony/Components/WithForm.html".freeze, "doc/Compony/ControllerMixin.html".freeze, "doc/Compony/Engine.html".freeze, "doc/Compony/MethodAccessibleHash.html".freeze, "doc/Compony/ModelFields.html".freeze, "doc/Compony/ModelFields/Anchormodel.html".freeze, "doc/Compony/ModelFields/Association.html".freeze, "doc/Compony/ModelFields/Attachment.html".freeze, "doc/Compony/ModelFields/Base.html".freeze, "doc/Compony/ModelFields/Boolean.html".freeze, "doc/Compony/ModelFields/Color.html".freeze, "doc/Compony/ModelFields/Currency.html".freeze, "doc/Compony/ModelFields/Date.html".freeze, "doc/Compony/ModelFields/Datetime.html".freeze, "doc/Compony/ModelFields/Decimal.html".freeze, "doc/Compony/ModelFields/Email.html".freeze, "doc/Compony/ModelFields/Float.html".freeze, "doc/Compony/ModelFields/Integer.html".freeze, "doc/Compony/ModelFields/Percentage.html".freeze, "doc/Compony/ModelFields/Phone.html".freeze, "doc/Compony/ModelFields/RichText.html".freeze, "doc/Compony/ModelFields/String.html".freeze, "doc/Compony/ModelFields/Text.html".freeze, "doc/Compony/ModelFields/Time.html".freeze, "doc/Compony/ModelFields/Url.html".freeze, "doc/Compony/ModelMixin.html".freeze, "doc/Compony/NaturalOrdering.html".freeze, "doc/Compony/RequestContext.html".freeze, "doc/Compony/Version.html".freeze, "doc/Compony/ViewHelpers.html".freeze, "doc/ComponyController.html".freeze, "doc/_index.html".freeze, "doc/class_list.html".freeze, "doc/css/common.css".freeze, "doc/css/full_list.css".freeze, "doc/css/style.css".freeze, "doc/file.README.html".freeze, "doc/file_list.html".freeze, "doc/frames.html".freeze, "doc/imgs/intro-example-destroy.png".freeze, "doc/imgs/intro-example-edit.png".freeze, "doc/imgs/intro-example-index.png".freeze, "doc/imgs/intro-example-new.png".freeze, "doc/imgs/intro-example-show.png".freeze, "doc/index.html".freeze, "doc/js/app.js".freeze, "doc/js/full_list.js".freeze, "doc/js/jquery.js".freeze, "doc/method_list.html".freeze, "doc/resourceful_lifecycle.graphml".freeze, "doc/resourceful_lifecycle.pdf".freeze, "doc/resourceful_lifecycle.png".freeze, "doc/top-level-namespace.html".freeze, "lib/compony.rb".freeze, "lib/compony/component.rb".freeze, "lib/compony/component_mixins/default/labelling.rb".freeze, "lib/compony/component_mixins/default/standalone.rb".freeze, "lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/standalone_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/verb_dsl.rb".freeze, "lib/compony/component_mixins/resourceful.rb".freeze, "lib/compony/components/button.rb".freeze, "lib/compony/components/destroy.rb".freeze, "lib/compony/components/edit.rb".freeze, "lib/compony/components/form.rb".freeze, "lib/compony/components/new.rb".freeze, "lib/compony/components/with_form.rb".freeze, "lib/compony/controller_mixin.rb".freeze, "lib/compony/engine.rb".freeze, "lib/compony/method_accessible_hash.rb".freeze, "lib/compony/model_fields/anchormodel.rb".freeze, "lib/compony/model_fields/association.rb".freeze, "lib/compony/model_fields/attachment.rb".freeze, "lib/compony/model_fields/base.rb".freeze, "lib/compony/model_fields/boolean.rb".freeze, "lib/compony/model_fields/color.rb".freeze, "lib/compony/model_fields/currency.rb".freeze, "lib/compony/model_fields/date.rb".freeze, "lib/compony/model_fields/datetime.rb".freeze, "lib/compony/model_fields/decimal.rb".freeze, "lib/compony/model_fields/email.rb".freeze, "lib/compony/model_fields/float.rb".freeze, "lib/compony/model_fields/integer.rb".freeze, "lib/compony/model_fields/percentage.rb".freeze, "lib/compony/model_fields/phone.rb".freeze, "lib/compony/model_fields/rich_text.rb".freeze, "lib/compony/model_fields/string.rb".freeze, "lib/compony/model_fields/text.rb".freeze, "lib/compony/model_fields/time.rb".freeze, "lib/compony/model_fields/url.rb".freeze, "lib/compony/model_mixin.rb".freeze, "lib/compony/natural_ordering.rb".freeze, "lib/compony/request_context.rb".freeze, "lib/compony/version.rb".freeze, "lib/compony/view_helpers.rb".freeze, "lib/generators/component/USAGE".freeze, "lib/generators/component/component_generator.rb".freeze, "lib/generators/component/templates/component.rb.erb".freeze, "lib/generators/component/templates/destroy.rb.erb".freeze, "lib/generators/component/templates/edit.rb.erb".freeze, "lib/generators/component/templates/form.rb.erb".freeze, "lib/generators/component/templates/new.rb.erb".freeze, "lib/generators/component/templates/with_base_component.rb.erb".freeze, "lib/generators/components/USAGE".freeze, "lib/generators/components/components_generator.rb".freeze, "logo.svg".freeze]
16
16
  s.required_ruby_version = Gem::Requirement.new(">= 3.3.5".freeze)
17
17
  s.rubygems_version = "3.6.9".freeze
18
18
  s.summary = "Compony is a Gem that allows you to write your Rails application in component-style fashion. It combines a controller action and route along \\ with its view into a single Ruby class. This allows writing much DRYer code, using inheritance even in views and much easier refactoring for your Rails \\ applications, helping you to keep the code clean as the application evolves.".freeze
@@ -184,7 +184,15 @@
184
184
  22
185
185
  23
186
186
  24
187
- 25</pre>
187
+ 25
188
+ 26
189
+ 27
190
+ 28
191
+ 29
192
+ 30
193
+ 31
194
+ 32
195
+ 33</pre>
188
196
  </td>
189
197
  <td>
190
198
  <pre class="code"><span class="info file"># File 'lib/generators/component/component_generator.rb', line 4</span>
@@ -198,7 +206,14 @@
198
206
  </span> <span class='ivar'>@comp_cst</span> <span class='op'>=</span> <span class='ivar'>@comp</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span> <span class='comment'># Tolerate singular and plural
199
207
  </span> <span class='ivar'>@args</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span>
200
208
 
201
- <span class='kw'>case</span> <span class='ivar'>@comp_cst</span>
209
+ <span class='comment'># If BaseComponents::ComponentAboutToBeGenerated is present, inherit from that
210
+ </span> <span class='kw'>if</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>BaseComponents</span><span class='period'>.</span><span class='id identifier rubyid_const_defined?'>const_defined?</span><span class='lparen'>(</span><span class='ivar'>@comp_cst</span><span class='rparen'>)</span><span class='rparen'>)</span>
211
+ <span class='ivar'>@parent_base_component_class</span> <span class='op'>=</span> <span class='const'>BaseComponents</span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='ivar'>@comp_cst</span><span class='rparen'>)</span>
212
+ <span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>with_base_component.rb.erb</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>app/components/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@family</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@comp</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>&quot;</span></span>
213
+ <span class='kw'>return</span>
214
+ <span class='kw'>end</span>
215
+ <span class='comment'># If a Compony component with the specified name exists, inherit from that
216
+ </span> <span class='kw'>case</span> <span class='ivar'>@comp_cst</span>
202
217
  <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Destroy</span><span class='tstring_end'>&#39;</span></span>
203
218
  <span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>destroy.rb.erb</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>app/components/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@family</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@comp</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>&quot;</span></span>
204
219
  <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Edit</span><span class='tstring_end'>&#39;</span></span>
@@ -208,7 +223,8 @@
208
223
  <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>New</span><span class='tstring_end'>&#39;</span></span>
209
224
  <span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>new.rb.erb</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>app/components/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@family</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@comp</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>&quot;</span></span>
210
225
  <span class='kw'>else</span>
211
- <span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>component.rb.erb</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>app/components/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@family</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@comp</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>&quot;</span></span>
226
+ <span class='comment'># Inherit from regular component
227
+ </span> <span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>component.rb.erb</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>app/components/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@family</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@comp</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>&quot;</span></span>
212
228
  <span class='kw'>end</span>
213
229
  <span class='kw'>end</span></pre>
214
230
  </td>
@@ -221,7 +237,7 @@
221
237
  </div>
222
238
 
223
239
  <div id="footer">
224
- Generated on Thu Jul 10 11:04:51 2025 by
240
+ Generated on Thu Aug 28 14:18:37 2025 by
225
241
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
226
242
  0.9.37 (ruby-3.3.5).
227
243
  </div>
data/doc/Components.html CHANGED
@@ -95,7 +95,7 @@
95
95
  </div>
96
96
 
97
97
  <div id="footer">
98
- Generated on Thu Jul 10 11:04:51 2025 by
98
+ Generated on Thu Aug 28 14:18:36 2025 by
99
99
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
100
100
  0.9.37 (ruby-3.3.5).
101
101
  </div>
@@ -193,7 +193,7 @@
193
193
  </div>
194
194
 
195
195
  <div id="footer">
196
- Generated on Thu Jul 10 11:04:51 2025 by
196
+ Generated on Thu Aug 28 14:18:37 2025 by
197
197
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
198
198
  0.9.37 (ruby-3.3.5).
199
199
  </div>