hanami-view 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/hanami/view/rendering/layout_scope.rb +16 -23
- data/lib/hanami/view/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd0a6fb3653b9f5fe4cdd34717703207a6c182c1e42734216f610e4ca48af178
|
4
|
+
data.tar.gz: e8b8026c3f21b9e465abe869207177df0078a51ed92cb419aececda7c9740e42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71935852c2c8a552b581ff9b75df1b237e55deeffdcdb6cbfd39da1a892ab1747f7d932de3a686b56fa57f28ee92a1e403ee963761a85f3340cb347be8309695
|
7
|
+
data.tar.gz: 37d252942f79eab521c1d7f43b87faea3d30aa1647c8d7ecbd913c6657cd2f8488000c7107e728ff08f772642876f59356223bd941349fe32ae7f6ebc24e5faf
|
data/CHANGELOG.md
CHANGED
@@ -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, _|
|
data/lib/hanami/view/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|