hanami-view 1.3.1 → 1.3.2

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: 5874eb4a86709316ad56f7b0b5b3f357a17bd3589be6b521623fead6de29c7e1
4
- data.tar.gz: 4478e11e9c26052339420c71faa976afff9ecaf6cc1e6c1edae9d8073b645630
3
+ metadata.gz: fd0a6fb3653b9f5fe4cdd34717703207a6c182c1e42734216f610e4ca48af178
4
+ data.tar.gz: e8b8026c3f21b9e465abe869207177df0078a51ed92cb419aececda7c9740e42
5
5
  SHA512:
6
- metadata.gz: ff843f7c979ba90eae003dad974468c1cb058151b317aa07ea09f59066929d547a9fce2687526802fc6263ce69ac9f43781b6d83b98a7d38843c55411a231eff
7
- data.tar.gz: ce83534d86d1ed0e303643a1fcb89ffe7ca37de4d153429df6f25a5229a66b9f725e1b59bdfb6a31bbe6c085a0f6ffaab6ef04e083d2aa311dd0e15617f76160
6
+ metadata.gz: 71935852c2c8a552b581ff9b75df1b237e55deeffdcdb6cbfd39da1a892ab1747f7d932de3a686b56fa57f28ee92a1e403ee963761a85f3340cb347be8309695
7
+ data.tar.gz: 37d252942f79eab521c1d7f43b87faea3d30aa1647c8d7ecbd913c6657cd2f8488000c7107e728ff08f772642876f59356223bd941349fe32ae7f6ebc24e5faf
@@ -1,6 +1,11 @@
1
1
  # Hanami::View
2
2
  View layer for Hanami
3
3
 
4
+ ## v1.3.2 - 2019-09-27
5
+ ### Fixed
6
+ - [Luca Guidi] Ensure rendering scope to work with latest `tilt` changes (`2.0.10`)
7
+ - [Luca Guidi] Ensure `Hanami::View::Rendering::LayoutScope#is_a?` to return consistent results
8
+
4
9
  ## v1.3.1 - 2019-01-18
5
10
  ### Added
6
11
  - [Luca Guidi] Official support for Ruby: MRI 2.6
@@ -1,6 +1,7 @@
1
1
  require 'hanami/view/rendering/null_local'
2
2
  require 'hanami/view/rendering/options'
3
3
  require 'hanami/utils/escape'
4
+ require 'hanami/utils/basic_object'
4
5
 
5
6
  module Hanami
6
7
  module View
@@ -16,7 +17,7 @@ module Hanami
16
17
  # Scope for layout rendering
17
18
  #
18
19
  # @since 0.1.0
19
- class LayoutScope < BasicObject
20
+ class LayoutScope < Utils::BasicObject
20
21
  # Initialize the scope
21
22
  #
22
23
  # @param layout [Hanami::Layout] the layout to render
@@ -32,27 +33,6 @@ module Hanami
32
33
  @locals = nil
33
34
  end
34
35
 
35
- # Returns the classname as string
36
- #
37
- # @return classname
38
- #
39
- # @since 0.3.0
40
- def class
41
- (class << self; self end).superclass
42
- end
43
-
44
- # Returns an inspect String
45
- #
46
- # @return [String] inspect String (contains classname, objectid in hex, available ivars)
47
- #
48
- # @since 0.3.0
49
- def inspect
50
- base = "#<#{ self.class }:#{'%x' % (self.object_id << 1)}"
51
- base << " @layout=\"#{@layout.inspect}\"" if @layout
52
- base << " @scope=\"#{@scope.inspect}\"" if @scope
53
- base << ">"
54
- end
55
-
56
36
  # Render a partial or a template within a layout template.
57
37
  #
58
38
  # @param options [Hash]
@@ -94,7 +74,7 @@ module Hanami
94
74
  # # templates/application.html.erb
95
75
  # #
96
76
  # # Use like this:
97
- # <%= render partial: 'shared/sidebar', { user: current_user } %>
77
+ # <%= render partial: 'shared/sidebar', locals: { user: current_user } %>
98
78
  #
99
79
  # #
100
80
  # # `user` will be available in the scope of the sidebar rendering
@@ -254,6 +234,19 @@ module Hanami
254
234
 
255
235
  private
256
236
 
237
+ # Returns an inspect String
238
+ #
239
+ # @return [String] inspect String (contains classname, objectid in hex, available ivars)
240
+ #
241
+ # @since 1.3.2
242
+ # @api private
243
+ def __inspect
244
+ result = ""
245
+ result += %( @layout="#{@layout.inspect}") if @layout
246
+ result += %( @scope="#{@scope.inspect}") if @scope
247
+ result
248
+ end
249
+
257
250
  # @api private
258
251
  def _options(options)
259
252
  current_locals = locals.reject do |key, _|
@@ -3,6 +3,6 @@ module Hanami
3
3
  # Defines the version
4
4
  #
5
5
  # @since 0.1.0
6
- VERSION = '1.3.1'.freeze
6
+ VERSION = '1.3.2'.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.1
4
+ version: 1.3.2
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-01-18 00:00:00.000000000 Z
11
+ date: 2019-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt
@@ -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.2
157
+ rubygems_version: 3.0.3
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: View layer for Hanami, with a separation between views and templates