hanami-view 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd0a6fb3653b9f5fe4cdd34717703207a6c182c1e42734216f610e4ca48af178
4
- data.tar.gz: e8b8026c3f21b9e465abe869207177df0078a51ed92cb419aececda7c9740e42
3
+ metadata.gz: 72a528dac2dcd264c024a20cfdb74eeed51ffe1a94afa29ea407e273f16add51
4
+ data.tar.gz: 699740c375290f05449c8daed600cd8e64ececfeb9b5bf4e107ff83092f17cfe
5
5
  SHA512:
6
- metadata.gz: 71935852c2c8a552b581ff9b75df1b237e55deeffdcdb6cbfd39da1a892ab1747f7d932de3a686b56fa57f28ee92a1e403ee963761a85f3340cb347be8309695
7
- data.tar.gz: 37d252942f79eab521c1d7f43b87faea3d30aa1647c8d7ecbd913c6657cd2f8488000c7107e728ff08f772642876f59356223bd941349fe32ae7f6ebc24e5faf
6
+ metadata.gz: e29c5e88308af381939a32cc1516a4fad5b4522117f82a0dd1c7c6dcf1ef81e37a08b15d6d82f1b7dff564c22dff17eafa89f9aceade70365545929396a6b7b8
7
+ data.tar.gz: ccb17de1053dcf123762cf2b10ee680e0c0a0998a05469b0dc4e9f8dea23ea26df1d34432fca3975c571690d51138160d74cad0bedf2ccc27e4032c1f9f474ca
@@ -1,6 +1,14 @@
1
1
  # Hanami::View
2
2
  View layer for Hanami
3
3
 
4
+ ## v1.3.3 - 2019-01-07
5
+ ### Added
6
+ - [Luca Guidi] Official support for Ruby: MRI 2.7
7
+ - [unleashy] Allow `LayoutScope#render` to accept a block (e.g. `<%= render(partial: "shared/sidebar") { %(<div id="sidebar"></div>) } %>` or `<%= render(partial: "shared/sidebar", &Sidebar.new) %>`)
8
+
9
+ ### Fixed
10
+ - [MITSUBOSHI] `Hanami::View::Rendering::TemplateName`: Fix frozen string literal error
11
+
4
12
  ## v1.3.2 - 2019-09-27
5
13
  ### Fixed
6
14
  - [Luca Guidi] Ensure rendering scope to work with latest `tilt` changes (`2.0.10`)
data/README.md CHANGED
@@ -17,7 +17,7 @@ Like all the other Hanami components, it can be used as a standalone framework o
17
17
  ## Status
18
18
 
19
19
  [![Gem Version](https://badge.fury.io/rb/hanami-view.svg)](https://badge.fury.io/rb/hanami-view)
20
- [![TravisCI](https://travis-ci.org/hanami/view.svg?branch=master)](https://travis-ci.org/hanami/view)
20
+ [![Build Status](https://ci.hanamirb.org/api/badges/hanami/view/status.svg)](https://ci.hanamirb.org/hanami/view)
21
21
  [![CircleCI](https://circleci.com/gh/hanami/view/tree/master.svg?style=svg)](https://circleci.com/gh/hanami/view/tree/master)
22
22
  [![Test Coverage](https://codecov.io/gh/hanami/view/branch/master/graph/badge.svg)](https://codecov.io/gh/hanami/view)
23
23
  [![Depfu](https://badges.depfu.com/badges/4f5c8868d047d206f33893bc9194812d/overview.svg)](https://depfu.com/github/hanami/view?project=Bundler)
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_development_dependency 'bundler', '>= 1.6', '< 3'
26
26
  spec.add_development_dependency 'rspec', '~> 3.7'
27
- spec.add_development_dependency 'rake', '~> 12'
27
+ spec.add_development_dependency 'rake', '~> 13'
28
28
  end
@@ -78,8 +78,22 @@ module Hanami
78
78
  #
79
79
  # #
80
80
  # # `user` will be available in the scope of the sidebar rendering
81
- def render(options)
82
- renderer(options).render
81
+ #
82
+ # @example Rendering partial, passing a block
83
+ # # Given a partial under:
84
+ # # templates/shared/_sidebar.html.erb
85
+ # #
86
+ # # In the layout template:
87
+ # # templates/application.html.erb
88
+ # #
89
+ # # Use like this:
90
+ # <%= render(partial: 'shared/sidebar') { ... } %>
91
+ #
92
+ # #
93
+ # # Then if you call `yield` inside the partial, it will call the
94
+ # # passed block.
95
+ def render(options, &block)
96
+ renderer(options).render(&block)
83
97
  end
84
98
 
85
99
  # Returns the requested format.
@@ -90,7 +90,7 @@ module Hanami
90
90
  # @see Hanami::View::Rendering#render
91
91
  def resolve(context)
92
92
  view, template = @registry.fetch(format(context)) { @registry[DEFAULT_FORMAT] }
93
- view.new(template, context)
93
+ view.new(template, **context)
94
94
  end
95
95
 
96
96
  private
@@ -40,8 +40,8 @@ module Hanami
40
40
  #
41
41
  # @api private
42
42
  # @since 0.1.0
43
- def render
44
- (template or raise_missing_template_error).render(scope)
43
+ def render(&block)
44
+ (template or raise_missing_template_error).render(scope, &block)
45
45
  end
46
46
 
47
47
  protected
@@ -42,7 +42,7 @@ module Hanami
42
42
  # @since 0.2.0
43
43
  # @api private
44
44
  def replace!(token)
45
- @name.gsub!(%r{\A#{ token }#{ NAMESPACE_SEPARATOR }}, '')
45
+ @name = @name.gsub(%r{\A#{ token }#{ NAMESPACE_SEPARATOR }}, '')
46
46
  end
47
47
  end
48
48
  end
@@ -3,6 +3,6 @@ module Hanami
3
3
  # Defines the version
4
4
  #
5
5
  # @since 0.1.0
6
- VERSION = '1.3.2'.freeze
6
+ VERSION = '1.3.3'.freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-view
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-27 00:00:00.000000000 Z
11
+ date: 2020-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt
@@ -84,14 +84,14 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '12'
87
+ version: '13'
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '12'
94
+ version: '13'
95
95
  description: View layer for Hanami
96
96
  email:
97
97
  - me@lucaguidi.com
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements: []
157
- rubygems_version: 3.0.3
157
+ rubygems_version: 3.1.2
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: View layer for Hanami, with a separation between views and templates