render_with_areas 0.2.0 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e40e1a834bfecabbae9b50b3508dd2b1567327f72cfb89b6fe7178f7cf5b541b
4
- data.tar.gz: 6e0796a4efc87e36d22b019313985bc6861c8560acd7f7017f055a4b54a250c1
3
+ metadata.gz: 3dafd0bad80028e844608619520405c7ad32f173b77aa5bc99f949043ec6caa4
4
+ data.tar.gz: 654336d018c37ab4a60e2bd9bcd798593b1651084f44b01e1db26108f6dde348
5
5
  SHA512:
6
- metadata.gz: 84c2be06dd77a231c72c74ca9af43b343cad3906f57dea933ec1d9d4070cbe4cd2e803422cb467ca6d07544c2a558a44cea54ca75f2a1a303d9341ddf0ec5b96
7
- data.tar.gz: f7cc5e5d7499f7c633908dda0232e5ff3d0cc513240feb2ead9b9443afadc66a837c05c2f088a1468bbf6a1723140a78dc5bca66a47799cd735c603ef409a7a1
6
+ metadata.gz: f1f48260c388b56df9957c054570e183bca51eefc13b214e8a2f6b613a41120d4f4580b7b460997995a7b281dd460f295ae26bc71fffef389a44d4bf7162cc48
7
+ data.tar.gz: 3fe47279f12637392e150b70d089995f9a44fc41fd355c51efc781461a2985a5cddc7f67eaeda4b75e24886461ff7070315f7a4a3674ab31d24f566699593557
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- render_with_areas (0.2.0)
4
+ render_with_areas (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -32,6 +32,7 @@ GEM
32
32
  unicode-display_width (2.4.2)
33
33
 
34
34
  PLATFORMS
35
+ arm64-darwin-24
35
36
  x86_64-darwin-21
36
37
 
37
38
  DEPENDENCIES
data/README.md CHANGED
@@ -32,7 +32,7 @@ Example:
32
32
  </header>
33
33
 
34
34
  <main>
35
- <%= content %>
35
+ <%= yield %>
36
36
  </main>
37
37
 
38
38
  <footer class="modal__footer">
@@ -42,12 +42,12 @@ Example:
42
42
 
43
43
  <!-- app/views/posts/show.html.erb -->
44
44
 
45
- <%= render_with_areas do |layout| %>
45
+ <%= render_with_areas 'ui/modal' do |layout| %>
46
46
  <% layout.with :header do %>
47
47
  <h1>Modal Title</h1>
48
48
  <% end %>
49
49
 
50
- This will show up as "content"
50
+ This will be yielded as default content
51
51
 
52
52
  <% layout.with :footer do %>
53
53
  This will show up in the modal footer.
@@ -56,8 +56,8 @@ Example:
56
56
 
57
57
 
58
58
  <!-- also supports locals, strings -->
59
- <%= render_with_areas, title: "Modal Title" do |layout| %>
60
- This will show up as "content"
59
+ <%= render_with_areas 'path/to/partial', title: "Modal Title" do |layout| %>
60
+ This will be yielded as default content
61
61
 
62
62
  <% layout.with :footer, "Footer" %>
63
63
  <% end %>
@@ -7,12 +7,13 @@ module RenderWithAreas
7
7
 
8
8
  def render_in(_view_context, &block)
9
9
  @view_context = _view_context
10
- locals[:content] = view_context.capture(self, &block)
11
- view_context.render partial: partial_path, locals: locals
10
+ captured = view_context.capture(self, &block)
11
+ view_context.render(partial_path, locals) { captured }
12
12
  end
13
13
 
14
14
  def with(area, content = nil, &block)
15
15
  locals[area] = content || view_context.capture(&block)
16
+ nil
16
17
  end
17
18
 
18
19
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RenderWithAreas
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: render_with_areas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: Easy rendering of partials with multiple content areas
14
13
  email:
@@ -36,7 +35,6 @@ metadata:
36
35
  homepage_uri: https://github.com/balvig/render_with_areas
37
36
  source_code_uri: https://github.com/balvig/render_with_areas
38
37
  changelog_uri: https://github.com/balvig/render_with_areas/blob/main/CHANGELOG.md
39
- post_install_message:
40
38
  rdoc_options: []
41
39
  require_paths:
42
40
  - lib
@@ -51,8 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
49
  - !ruby/object:Gem::Version
52
50
  version: '0'
53
51
  requirements: []
54
- rubygems_version: 3.4.6
55
- signing_key:
52
+ rubygems_version: 3.7.2
56
53
  specification_version: 4
57
54
  summary: Easy rendering of partials with multiple content areas
58
55
  test_files: []