compony 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/VERSION +1 -1
  4. data/compony.gemspec +4 -4
  5. data/doc/ComponentGenerator.html +3 -3
  6. data/doc/Components.html +3 -3
  7. data/doc/ComponentsGenerator.html +3 -3
  8. data/doc/Compony/Component.html +3 -3
  9. data/doc/Compony/ComponentMixins/Default/Labelling.html +3 -3
  10. data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +3 -3
  11. data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +3 -3
  12. data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +3 -3
  13. data/doc/Compony/ComponentMixins/Default/Standalone.html +3 -3
  14. data/doc/Compony/ComponentMixins/Default.html +3 -3
  15. data/doc/Compony/ComponentMixins/Resourceful.html +3 -3
  16. data/doc/Compony/ComponentMixins.html +3 -3
  17. data/doc/Compony/Components/Button.html +3 -3
  18. data/doc/Compony/Components/Destroy.html +3 -3
  19. data/doc/Compony/Components/Edit.html +3 -3
  20. data/doc/Compony/Components/Form.html +3 -3
  21. data/doc/Compony/Components/New.html +3 -3
  22. data/doc/Compony/Components/WithForm.html +3 -3
  23. data/doc/Compony/Components.html +3 -3
  24. data/doc/Compony/ControllerMixin.html +3 -3
  25. data/doc/Compony/Engine.html +3 -3
  26. data/doc/Compony/MethodAccessibleHash.html +3 -3
  27. data/doc/Compony/ModelFields/Anchormodel.html +3 -3
  28. data/doc/Compony/ModelFields/Association.html +3 -3
  29. data/doc/Compony/ModelFields/Attachment.html +3 -3
  30. data/doc/Compony/ModelFields/Base.html +3 -3
  31. data/doc/Compony/ModelFields/Boolean.html +3 -3
  32. data/doc/Compony/ModelFields/Color.html +3 -3
  33. data/doc/Compony/ModelFields/Currency.html +3 -3
  34. data/doc/Compony/ModelFields/Date.html +3 -3
  35. data/doc/Compony/ModelFields/Datetime.html +3 -3
  36. data/doc/Compony/ModelFields/Decimal.html +3 -3
  37. data/doc/Compony/ModelFields/Email.html +3 -3
  38. data/doc/Compony/ModelFields/Float.html +3 -3
  39. data/doc/Compony/ModelFields/Integer.html +3 -3
  40. data/doc/Compony/ModelFields/Percentage.html +3 -3
  41. data/doc/Compony/ModelFields/Phone.html +3 -3
  42. data/doc/Compony/ModelFields/RichText.html +3 -3
  43. data/doc/Compony/ModelFields/String.html +3 -3
  44. data/doc/Compony/ModelFields/Text.html +3 -3
  45. data/doc/Compony/ModelFields/Time.html +3 -3
  46. data/doc/Compony/ModelFields/Url.html +3 -3
  47. data/doc/Compony/ModelFields.html +3 -3
  48. data/doc/Compony/ModelMixin.html +3 -3
  49. data/doc/Compony/NaturalOrdering.html +3 -3
  50. data/doc/Compony/RequestContext.html +72 -5
  51. data/doc/Compony/Version.html +3 -3
  52. data/doc/Compony/ViewHelpers.html +3 -3
  53. data/doc/Compony.html +3 -3
  54. data/doc/ComponyController.html +3 -3
  55. data/doc/_index.html +4 -4
  56. data/doc/file.README.html +3 -3
  57. data/doc/frames.html +10 -5
  58. data/doc/index.html +3 -3
  59. data/doc/method_list.html +151 -143
  60. data/doc/top-level-namespace.html +3 -3
  61. data/lib/compony/request_context.rb +8 -1
  62. metadata +3 -3
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Documentation by YARD 0.9.34
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -102,9 +102,9 @@
102
102
  </div>
103
103
 
104
104
  <div id="footer">
105
- Generated on Sat Jun 1 14:22:42 2024 by
105
+ Generated on Mon Jun 3 15:20:40 2024 by
106
106
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
107
- 0.9.34 (ruby-3.2.2).
107
+ 0.9.36 (ruby-3.2.2).
108
108
  </div>
109
109
 
110
110
  </div>
@@ -45,7 +45,9 @@ module Compony
45
45
  # Renders a content block from the current component.
46
46
  def content(name)
47
47
  name = name.to_sym
48
- content_block = component.content_blocks.find { |el| el.name == name } || fail("Content block #{name.inspect} not found in #{component.inspect}.")
48
+ content_block = component.content_blocks.find { |el| el.name == name }
49
+ return false if content_block.nil?
50
+
49
51
  # We have to clear Rails' output_buffer to prevent double rendering of blocks. To achieve this, a fresh render context is instanciated.
50
52
  concat controller.render_to_string(
51
53
  type: :dyny,
@@ -54,6 +56,11 @@ module Compony
54
56
  Compony::RequestContext.new(render_component, render_controller, helpers: self, locals: local_assigns).evaluate_with_backfire(&render_block.payload)
55
57
  RUBY
56
58
  )
59
+ return true
60
+ end
61
+
62
+ def content!(name)
63
+ content(name) || fail("Content block #{name.inspect} not found in #{component.inspect}.")
57
64
  end
58
65
  end
59
66
  end
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.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Kalbermatter
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-06-01 00:00:00.000000000 Z
12
+ date: 2024-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yard
@@ -330,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
330
  - !ruby/object:Gem::Version
331
331
  version: '0'
332
332
  requirements: []
333
- rubygems_version: 3.5.9
333
+ rubygems_version: 3.5.11
334
334
  signing_key:
335
335
  specification_version: 4
336
336
  summary: Compony is a Gem that allows you to write your Rails application in component-style