compony 0.6.4 → 0.7.0

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 (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +6 -0
  5. data/VERSION +1 -1
  6. data/compony.gemspec +3 -3
  7. data/doc/ComponentGenerator.html +1 -1
  8. data/doc/Components.html +1 -1
  9. data/doc/ComponentsGenerator.html +1 -1
  10. data/doc/Compony/Component.html +247 -156
  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 +2 -2
  22. data/doc/Compony/Components/Form.html +2 -2
  23. data/doc/Compony/Components/Index.html +2 -2
  24. data/doc/Compony/Components/List.html +2 -2
  25. data/doc/Compony/Components/New.html +2 -2
  26. data/doc/Compony/Components/Show.html +2 -2
  27. data/doc/Compony/Components/WithForm.html +19 -21
  28. data/doc/Compony/Components.html +1 -1
  29. data/doc/Compony/ControllerMixin.html +1 -1
  30. data/doc/Compony/Engine.html +1 -1
  31. data/doc/Compony/MethodAccessibleHash.html +1 -1
  32. data/doc/Compony/ModelFields/Anchormodel.html +1 -1
  33. data/doc/Compony/ModelFields/Association.html +1 -1
  34. data/doc/Compony/ModelFields/Attachment.html +1 -1
  35. data/doc/Compony/ModelFields/Base.html +1 -1
  36. data/doc/Compony/ModelFields/Boolean.html +1 -1
  37. data/doc/Compony/ModelFields/Color.html +1 -1
  38. data/doc/Compony/ModelFields/Currency.html +1 -1
  39. data/doc/Compony/ModelFields/Date.html +1 -1
  40. data/doc/Compony/ModelFields/Datetime.html +1 -1
  41. data/doc/Compony/ModelFields/Decimal.html +1 -1
  42. data/doc/Compony/ModelFields/Email.html +1 -1
  43. data/doc/Compony/ModelFields/Float.html +1 -1
  44. data/doc/Compony/ModelFields/Integer.html +1 -1
  45. data/doc/Compony/ModelFields/Percentage.html +1 -1
  46. data/doc/Compony/ModelFields/Phone.html +1 -1
  47. data/doc/Compony/ModelFields/RichText.html +1 -1
  48. data/doc/Compony/ModelFields/String.html +1 -1
  49. data/doc/Compony/ModelFields/Text.html +1 -1
  50. data/doc/Compony/ModelFields/Time.html +1 -1
  51. data/doc/Compony/ModelFields/Url.html +1 -1
  52. data/doc/Compony/ModelFields.html +1 -1
  53. data/doc/Compony/ModelMixin.html +1 -1
  54. data/doc/Compony/NaturalOrdering.html +1 -1
  55. data/doc/Compony/RequestContext.html +1 -1
  56. data/doc/Compony/Version.html +1 -1
  57. data/doc/Compony/ViewHelpers.html +1 -1
  58. data/doc/Compony.html +44 -42
  59. data/doc/ComponyController.html +1 -1
  60. data/doc/_index.html +1 -1
  61. data/doc/file.README.html +7 -1
  62. data/doc/index.html +7 -1
  63. data/doc/method_list.html +109 -101
  64. data/doc/top-level-namespace.html +1 -1
  65. data/lib/compony/component.rb +30 -8
  66. data/lib/compony/components/with_form.rb +1 -2
  67. data/lib/compony.rb +9 -8
  68. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cab18c62a3fb017fcd38d1395ee42cc17ef70e6d198be09b2a777d43d3ad477
4
- data.tar.gz: 65d1001d7548c596a397e8cb5b187a6784bbceca843d27135c9c270ca94cdbb7
3
+ metadata.gz: 2eb1aa6e1437a93c6ecaba6fe39bca1f38dc9f3c5b2f64bc7bfeaba35b1df531
4
+ data.tar.gz: 58ff003601a8b4cabe7bfcf0dd0669e496778949251abe1022fbbb2d10b6114f
5
5
  SHA512:
6
- metadata.gz: d046b11849a74221e930fd09d3f152ae68541712a128bad628fc6b8ada5c9cbb75a469fa4cdf4054d1edafad6ce2d9545ce82a62cd6cb57823c3c617689062c0
7
- data.tar.gz: 895675d7080bd67b36b6ec69d3415950ae543335292656f29f0f44fedac204091ffda678d9fb74d9cbcc3230f14ccf3500027cdd2a16e2cd8b8377b855c24304
6
+ metadata.gz: 805e0ecdd02f8dbbecd8d28253960d734ad8fc504efbf61c362a579ce6f36cd502067e40f88ea8cf94af8defd84b5cf56a727487bc7d4abbf0d67b6a0a56a0b9
7
+ data.tar.gz: c81f256fa241c2eaad5767f97c257c6ab5754b9c19ce72054fa6dc67e82c951e029575698b8a82b40ba087559ef5af9fb12cc04868c59eec625be5a0743c2f84
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 0.7.0
2
+
3
+ - Rename Component's internal `path` to `id_path` to distinguish it from Rails paths, as well as `path_hash` to `id_path_hash`
4
+ - (internal change): switch `WithForm`'s default `submit_path` block to `Compony.path` logic
5
+ - Implement new component DSL method `path`, closes #13
6
+ - The method allows components to define the path pointing towards them (the default behavior corresponds to that of `Compony.path` of previous versions)
7
+ - Adjust `Compony.path` to instanciate the target component and use the `path` block rather than come up with the path on its own
8
+
9
+ ## Steps to take
10
+
11
+ - If using the methods formerly called `path` or `path_hash`, rename them to `id_path` respectively `id_path_hash`.
12
+
1
13
  # 0.6.4
2
14
 
3
15
  - Replace Feasibility's error message generation in case of dependent errors by a logic that fits fastgettext's modern pluralization
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- compony (0.6.4.edge)
4
+ compony (0.6.5.edge)
5
5
  anchormodel (~> 0.2.1)
6
6
  cancancan (~> 3.6.1)
7
7
  dslblend (>= 0.0.3)
data/README.md CHANGED
@@ -998,6 +998,12 @@ link_to 'See user page', Compony.path(:show, :users, id: 1) # -> 'users/show/1'
998
998
 
999
999
  Note that the generated paths in the example are just for illustration purposes. The paths point to whatever path you configure in the target component's default standalone config. Also, this example is not how you should generate links to components, as is explained in the next subsection.
1000
1000
 
1001
+ #### Customizing path generation
1002
+
1003
+ By implementing `path do ... end` inside the `setup` method of a component, you can override the way paths to that component are generated. Customizing the path generation will affect all mentioned methods mentioned here involving paths, such as `Compony.path`, `compony_link`, `Compony.button`, `compony_button` etc.
1004
+
1005
+ This is an advanced usage. Refer to the default implementation of `Component`'s `path_block` to see an exmple.
1006
+
1001
1007
  ### Generating a link to a component
1002
1008
 
1003
1009
  In order to allow a user to visit another component, don't implement your links and buttons manually. Instead, use Compony's links and buttons, as those extract information from the target component, avoiding redundant code and making refactoring much easier.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.4
1
+ 0.7.0
data/compony.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # This file is auto-generated via: 'rake gemspec'.
3
3
 
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: compony 0.6.4 ruby lib
5
+ # stub: compony 0.7.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "compony".freeze
9
- s.version = "0.6.4".freeze
9
+ s.version = "0.7.0".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
- s.date = "2025-11-10"
14
+ s.date = "2025-11-14"
15
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/Index.html".freeze, "doc/Compony/Components/List.html".freeze, "doc/Compony/Components/New.html".freeze, "doc/Compony/Components/Show.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/index.rb".freeze, "lib/compony/components/list.rb".freeze, "lib/compony/components/new.rb".freeze, "lib/compony/components/show.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/index.rb.erb".freeze, "lib/generators/component/templates/list.rb.erb".freeze, "lib/generators/component/templates/new.rb.erb".freeze, "lib/generators/component/templates/show.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.5.16".freeze
@@ -249,7 +249,7 @@
249
249
  </div>
250
250
 
251
251
  <div id="footer">
252
- Generated on Mon Nov 10 13:15:58 2025 by
252
+ Generated on Fri Nov 14 15:08:17 2025 by
253
253
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
254
254
  0.9.34 (ruby-3.3.5).
255
255
  </div>
data/doc/Components.html CHANGED
@@ -95,7 +95,7 @@
95
95
  </div>
96
96
 
97
97
  <div id="footer">
98
- Generated on Mon Nov 10 13:15:57 2025 by
98
+ Generated on Fri Nov 14 15:08:15 2025 by
99
99
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
100
100
  0.9.34 (ruby-3.3.5).
101
101
  </div>
@@ -193,7 +193,7 @@
193
193
  </div>
194
194
 
195
195
  <div id="footer">
196
- Generated on Mon Nov 10 13:15:58 2025 by
196
+ Generated on Fri Nov 14 15:08:17 2025 by
197
197
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
198
198
  0.9.34 (ruby-3.3.5).
199
199
  </div>