hanami-view 2.1.0.rc1 → 2.1.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/hanami-view.gemspec +0 -1
  4. data/lib/hanami/view/cache.rb +8 -1
  5. data/lib/hanami/view/context.rb +5 -0
  6. data/lib/hanami/view/decorated_attributes.rb +8 -0
  7. data/lib/hanami/view/erb/engine.rb +1 -1
  8. data/lib/hanami/view/erb/filters/block.rb +1 -1
  9. data/lib/hanami/view/erb/filters/trimming.rb +1 -1
  10. data/lib/hanami/view/erb/parser.rb +1 -1
  11. data/lib/hanami/view/erb/template.rb +1 -1
  12. data/lib/hanami/view/errors.rb +12 -20
  13. data/lib/hanami/view/exposure.rb +32 -0
  14. data/lib/hanami/view/exposures.rb +19 -0
  15. data/lib/hanami/view/helpers/escape_helper.rb +15 -15
  16. data/lib/hanami/view/helpers/number_formatting_helper.rb +13 -13
  17. data/lib/hanami/view/helpers/tag_helper/tag_builder.rb +21 -21
  18. data/lib/hanami/view/helpers/tag_helper.rb +8 -8
  19. data/lib/hanami/view/html.rb +14 -9
  20. data/lib/hanami/view/html_safe_string_buffer.rb +1 -1
  21. data/lib/hanami/view/part.rb +29 -12
  22. data/lib/hanami/view/part_builder.rb +6 -4
  23. data/lib/hanami/view/path.rb +14 -0
  24. data/lib/hanami/view/rendered.rb +13 -7
  25. data/lib/hanami/view/renderer.rb +17 -0
  26. data/lib/hanami/view/rendering.rb +17 -0
  27. data/lib/hanami/view/rendering_missing.rb +15 -0
  28. data/lib/hanami/view/scope.rb +23 -16
  29. data/lib/hanami/view/scope_builder.rb +5 -3
  30. data/lib/hanami/view/tilt/haml_adapter.rb +2 -0
  31. data/lib/hanami/view/tilt/slim_adapter.rb +2 -0
  32. data/lib/hanami/view/tilt.rb +5 -0
  33. data/lib/hanami/view/version.rb +3 -2
  34. data/lib/hanami/view.rb +69 -30
  35. metadata +3 -18
  36. data/lib/hanami/view/application_view.rb +0 -89
@@ -3,13 +3,22 @@
3
3
  module Hanami
4
4
  class View
5
5
  # @api private
6
+ # @since 2.1.0
6
7
  class Rendering
8
+ # @api private
9
+ # @since 2.1.0
7
10
  attr_reader :config, :format
8
11
 
12
+ # @api private
13
+ # @since 2.1.0
9
14
  attr_reader :inflector, :part_builder, :scope_builder
10
15
 
16
+ # @api private
17
+ # @since 2.1.0
11
18
  attr_reader :context, :renderer
12
19
 
20
+ # @api private
21
+ # @since 2.1.0
13
22
  def initialize(config:, format:, context:)
14
23
  @config = config
15
24
  @format = format
@@ -22,18 +31,26 @@ module Hanami
22
31
  @renderer = Renderer.new(config)
23
32
  end
24
33
 
34
+ # @api private
35
+ # @since 2.1.0
25
36
  def template(name, scope, &block)
26
37
  renderer.template(name, format, scope, &block)
27
38
  end
28
39
 
40
+ # @api private
41
+ # @since 2.1.0
29
42
  def partial(name, scope, &block)
30
43
  renderer.partial(name, format, scope, &block)
31
44
  end
32
45
 
46
+ # @api private
47
+ # @since 2.1.0
33
48
  def part(name, value, as: nil)
34
49
  part_builder.(name, value, as: as, rendering: self)
35
50
  end
36
51
 
52
+ # @api private
53
+ # @since 2.1.0
37
54
  def scope(name = nil, locals) # rubocop:disable Style/OptionalArguments
38
55
  scope_builder.(name, locals: locals, rendering: self)
39
56
  end
@@ -6,31 +6,46 @@ require_relative "errors"
6
6
  module Hanami
7
7
  class View
8
8
  # @api private
9
+ # @since 2.1.0
9
10
  class RenderingMissing
11
+ # @api private
12
+ # @since 2.1.0
10
13
  def format
11
14
  raise RenderingMissingError
12
15
  end
13
16
 
17
+ # @api private
18
+ # @since 2.1.0
14
19
  def context
15
20
  raise RenderingMissingError
16
21
  end
17
22
 
23
+ # @api private
24
+ # @since 2.1.0
18
25
  def part(_name, _value, **_options)
19
26
  raise RenderingMissingError
20
27
  end
21
28
 
29
+ # @api private
30
+ # @since 2.1.0
22
31
  def scope(_name = nil, _locals) # rubocop:disable Style/OptionalArguments
23
32
  raise RenderingMissingError
24
33
  end
25
34
 
35
+ # @api private
36
+ # @since 2.1.0
26
37
  def template(_name, _scope)
27
38
  raise RenderingMissingError
28
39
  end
29
40
 
41
+ # @api private
42
+ # @since 2.1.0
30
43
  def partial(_name, _scope)
31
44
  raise RenderingMissingError
32
45
  end
33
46
 
47
+ # @api private
48
+ # @since 2.1.0
34
49
  def inflector
35
50
  @inflector ||= Dry::Inflector.new
36
51
  end
@@ -16,40 +16,43 @@ module Hanami
16
16
  # @see https://dry-rb.org/gems/dry-view/scopes/
17
17
  #
18
18
  # @api public
19
+ # @since 2.1.0
19
20
  class Scope
20
21
  # @api private
21
22
  CONVENIENCE_METHODS = %i[format context locals].freeze
22
23
 
23
24
  include Dry::Equalizer(:_name, :_locals, :_rendering)
24
25
 
25
- # The scope's name
26
+ # Returns the scope's name.
26
27
  #
27
28
  # @return [Symbol]
28
29
  #
29
30
  # @api public
31
+ # @since 2.1.0
30
32
  attr_reader :_name
31
33
 
32
- # The scope's locals
34
+ # Returns the scope's locals
33
35
  #
34
36
  # @overload _locals
35
- # Returns the locals
37
+ # Returns the locals.
36
38
  # @overload locals
37
- # A convenience alias for `#_locals.` Is available unless there is a
38
- # local named `locals`
39
+ # A convenience alias for `#_locals.` Is available unless there is a local named `locals`
39
40
  #
40
41
  # @return [Hash[<Symbol, Object>]
41
42
  #
42
43
  # @api public
44
+ # @since 2.1.0
43
45
  attr_reader :_locals
44
46
 
45
- # The current rendering
47
+ # Returns the current rendering.
46
48
  #
47
49
  # @return [Rendering]
48
50
  #
49
51
  # @api private
52
+ # @since 2.1.0
50
53
  attr_reader :_rendering
51
54
 
52
- # Returns a new Scope instance
55
+ # Returns a new Scope instance.
53
56
  #
54
57
  # @param name [Symbol, nil] scope name
55
58
  # @param locals [Hash<Symbol, Object>] template locals
@@ -58,6 +61,7 @@ module Hanami
58
61
  # @return [Scope]
59
62
  #
60
63
  # @api public
64
+ # @since 2.1.0
61
65
  def initialize(
62
66
  name: nil,
63
67
  locals: Dry::Core::Constants::EMPTY_HASH,
@@ -69,14 +73,14 @@ module Hanami
69
73
  end
70
74
 
71
75
  # @overload render(partial_name, **locals, &block)
72
- # Renders a partial using the scope
76
+ # Renders a partial using the scope.
73
77
  #
74
78
  # @param partial_name [Symbol, String] partial name
75
79
  # @param locals [Hash<Symbol, Object>] partial locals
76
80
  # @yieldreturn [String] string content to include where the partial calls `yield`
77
81
  #
78
82
  # @overload render(**locals, &block)
79
- # Renders a partial (named after the scope's own name) using the scope
83
+ # Renders a partial (named after the scope's own name) using the scope.
80
84
  #
81
85
  # @param locals[Hash<Symbol, Object>] partial locals
82
86
  # @yieldreturn [String] string content to include where the partial calls `yield`
@@ -84,6 +88,7 @@ module Hanami
84
88
  # @return [String] the rendered partial output
85
89
  #
86
90
  # @api public
91
+ # @since 2.1.0
87
92
  def render(partial_name = nil, **locals, &block)
88
93
  partial_name ||= _name
89
94
 
@@ -98,7 +103,7 @@ module Hanami
98
103
  _rendering.partial(partial_name, _render_scope(**locals), &block)
99
104
  end
100
105
 
101
- # Build a new scope using a scope class matching the provided name
106
+ # Builds a new scope using a scope class matching the provided name.
102
107
  #
103
108
  # @param name [Symbol, Class] scope name (or class)
104
109
  # @param locals [Hash<Symbol, Object>] scope locals
@@ -106,11 +111,12 @@ module Hanami
106
111
  # @return [Scope]
107
112
  #
108
113
  # @api public
114
+ # @since 2.1.0
109
115
  def scope(name = nil, **locals)
110
116
  _rendering.scope(name, locals)
111
117
  end
112
118
 
113
- # The template format for the current render environment.
119
+ # Returns the template format for the current render environment.
114
120
  #
115
121
  # @overload _format
116
122
  # Returns the format.
@@ -121,11 +127,12 @@ module Hanami
121
127
  # @return [Symbol] format
122
128
  #
123
129
  # @api public
130
+ # @since 2.1.0
124
131
  def _format
125
132
  _rendering.format
126
133
  end
127
134
 
128
- # The context object for the current render environment
135
+ # Returns the context object for the current render environment.
129
136
  #
130
137
  # @overload _context
131
138
  # Returns the context.
@@ -136,6 +143,7 @@ module Hanami
136
143
  # @return [Context] context
137
144
  #
138
145
  # @api public
146
+ # @since 2.1.0
139
147
  def _context
140
148
  _rendering.context
141
149
  end
@@ -144,10 +152,9 @@ module Hanami
144
152
 
145
153
  # Handles missing methods, according to the following rules:
146
154
  #
147
- # 1. If there is a local with a name matching the method, it returns the
148
- # local.
149
- # 2. If the `context` responds to the method, then it will be sent the
150
- # method and all its arguments.
155
+ # 1. If there is a local with a name matching the method, it returns the local.
156
+ # 2. If the `context` responds to the method, then it will be sent the method and all its
157
+ # arguments.
151
158
  def method_missing(name, *args, &block)
152
159
  if _locals.key?(name)
153
160
  _locals[name]
@@ -4,17 +4,19 @@ module Hanami
4
4
  class View
5
5
  # Builds scope objects via matching classes
6
6
  #
7
- # @api private
7
+ # @api public
8
+ # @since 2.1.0
8
9
  class ScopeBuilder
9
10
  class << self
10
- # Returns a new scope using a class matching the name
11
+ # Returns a new scope using a class matching the name.
11
12
  #
12
13
  # @param name [Symbol, Class] scope name
13
14
  # @param locals [Hash<Symbol, Object>] locals hash
14
15
  #
15
16
  # @return [Hanami::View::Scope]
16
17
  #
17
- # @api private
18
+ # @api public
19
+ # @since 2.1.0
18
20
  def call(name = nil, locals:, rendering:) # rubocop:disable Style/OptionalArguments
19
21
  klass = scope_class(name, rendering: rendering)
20
22
 
@@ -6,6 +6,7 @@ module Hanami
6
6
  class View
7
7
  module Tilt
8
8
  # @api private
9
+ # @since 2.1.0
9
10
  module HamlAdapter
10
11
  # Add options to Haml::Engine to match the options from its default generator.
11
12
  #
@@ -29,6 +30,7 @@ module Hanami
29
30
  #
30
31
  # @see Hanami::View::Tilt
31
32
  # @api private
33
+ # @since 2.1.0
32
34
  Template = Temple::Templates::Tilt(
33
35
  ::Haml::Engine,
34
36
  use_html_safe: true,
@@ -6,6 +6,7 @@ module Hanami
6
6
  class View
7
7
  module Tilt
8
8
  # @api private
9
+ # @since 2.1.0
9
10
  module SlimAdapter
10
11
  # Add options to Slim::Engine to match the options from its default generator.
11
12
  #
@@ -29,6 +30,7 @@ module Hanami
29
30
  #
30
31
  # @see Hanami::View::Tilt
31
32
  # @api private
33
+ # @since 2.1.0
32
34
  Template = Temple::Templates::Tilt(
33
35
  ::Slim::Engine,
34
36
  use_html_safe: true,
@@ -5,7 +5,10 @@ require "tilt"
5
5
  module Hanami
6
6
  class View
7
7
  # @api private
8
+ # @since 2.1.0
8
9
  module Tilt
10
+ # @api private
11
+ # @since 2.1.0
9
12
  Mapping = ::Tilt.default_mapping.dup.tap { |mapping|
10
13
  # If "slim" has been required before "hanami/view", unregister Slim's non-lazy registered
11
14
  # template, so our own template adapter (using register_lazy below) can take precedence.
@@ -25,6 +28,8 @@ module Hanami
25
28
  }
26
29
 
27
30
  class << self
31
+ # @api private
32
+ # @since 2.1.0
28
33
  def [](path, mapping, options)
29
34
  with_mapping(mapping).new(path, options)
30
35
  end
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Hanami
4
4
  class View
5
- # @api private
6
- VERSION = "2.1.0.rc1"
5
+ # @api public
6
+ # @since 2.1.0
7
+ VERSION = "2.1.0.rc2"
7
8
  end
8
9
  end
data/lib/hanami/view.rb CHANGED
@@ -9,22 +9,20 @@ require_relative "view/errors"
9
9
  require_relative "view/html"
10
10
 
11
11
  module Hanami
12
- # A standalone, template-based view rendering system that offers everything
13
- # you need to write well-factored view code.
12
+ # A standalone, template-based view rendering system that offers everything you need to write
13
+ # well-factored view code.
14
14
  #
15
- # This represents a single view, holding the configuration and exposures
16
- # necessary for rendering its template.
15
+ # This represents a single view, holding the configuration and exposures necessary for rendering
16
+ # its template.
17
17
  #
18
- # @abstract Subclass this and provide your own configuration and exposures to
19
- # define your own view (along with a custom `#initialize` if you wish to
20
- # inject dependencies into your subclass)
21
- #
22
- # @see https://dry-rb.org/gems/dry-view/
18
+ # @abstract Subclass this and provide your own configuration and exposures to define your own view
19
+ # (along with a custom `#initialize` if you wish to inject dependencies into your subclass)
23
20
  #
24
21
  # @api public
22
+ # @since 2.1.0
25
23
  class View
26
- # @since 2.1.0
27
24
  # @api private
25
+ # @since 2.1.0
28
26
  def self.gem_loader
29
27
  @gem_loader ||= Zeitwerk::Loader.new.tap do |loader|
30
28
  root = File.expand_path("..", __dir__)
@@ -47,6 +45,7 @@ module Hanami
47
45
  gem_loader.setup
48
46
 
49
47
  # @api private
48
+ # @since 2.1.0
50
49
  DEFAULT_RENDERER_OPTIONS = {default_encoding: "utf-8"}.freeze
51
50
 
52
51
  include Dry::Equalizer(:config, :exposures)
@@ -67,6 +66,7 @@ module Hanami
67
66
  # @param paths [String, Path, Array<String, Path>] the paths
68
67
  #
69
68
  # @api public
69
+ # @since 2.1.0
70
70
  # @!scope class
71
71
  setting :paths, constructor: -> paths {
72
72
  Array(paths).map { |path| Path[path] }
@@ -80,6 +80,7 @@ module Hanami
80
80
  #
81
81
  # @param name [String] template name
82
82
  # @api public
83
+ # @since 2.1.0
83
84
  # @!scope class
84
85
  setting :template
85
86
 
@@ -95,6 +96,7 @@ module Hanami
95
96
  #
96
97
  # @param base_path [String, nil] base templates path
97
98
  # @api public
99
+ # @since 2.1.0
98
100
  # @!scope class
99
101
  setting :template_inference_base
100
102
 
@@ -107,6 +109,7 @@ module Hanami
107
109
  #
108
110
  # @param name [String, FalseClass, nil] layout name, or false to indicate no layout
109
111
  # @api public
112
+ # @since 2.1.0
110
113
  # @!scope class
111
114
  setting :layout, default: false
112
115
 
@@ -116,6 +119,7 @@ module Hanami
116
119
  #
117
120
  # @param dir [String] directory name
118
121
  # @api public
122
+ # @since 2.1.0
119
123
  # @!scope class
120
124
  setting :layouts_dir, default: "layouts"
121
125
 
@@ -129,6 +133,7 @@ module Hanami
129
133
  #
130
134
  # @param scope_class [Class] scope class (inheriting from `Hanami::View::Scope`)
131
135
  # @api public
136
+ # @since 2.1.0
132
137
  # @!scope class
133
138
  setting :scope
134
139
 
@@ -142,6 +147,7 @@ module Hanami
142
147
  #
143
148
  # @param context [Hanami::View::Context] context object
144
149
  # @api public
150
+ # @since 2.1.0
145
151
  # @!scope class
146
152
  setting :default_context, default: Context.new.freeze
147
153
 
@@ -152,9 +158,17 @@ module Hanami
152
158
  #
153
159
  # @param format [Symbol]
154
160
  # @api public
161
+ # @since 2.1.0
155
162
  # @!scope class
156
163
  setting :default_format, default: :html
157
164
 
165
+ # @overload config.part_class=(part_class)
166
+ # Set a custom default part class.
167
+ #
168
+ # @param part_class [Class]
169
+ # @api public
170
+ # @since 2.1.0
171
+ # @!scope class
158
172
  setting :part_class, default: Part
159
173
 
160
174
  # @overload config.scope_namespace=(namespace)
@@ -165,19 +179,26 @@ module Hanami
165
179
  # @see Scope
166
180
  #
167
181
  # @api public
182
+ # @since 2.1.0
168
183
  # @!scope class
169
184
  setting :part_namespace
170
185
 
171
186
  # @overload config.part_builder=(part_builder)
172
187
  # Set a custom part builder class
173
188
  #
174
- # @see https://dry-rb.org/gems/dry-view/parts/
175
- #
176
189
  # @param part_builder [Class]
177
190
  # @api public
191
+ # @since 2.1.0
178
192
  # @!scope class
179
193
  setting :part_builder, default: PartBuilder
180
194
 
195
+ # @overload config.scope_class=(scope_class)
196
+ # Set a custom default scope class.
197
+ #
198
+ # @param scope_class [Class]
199
+ # @api public
200
+ # @since 2.1.0
201
+ # @!scope class
181
202
  setting :scope_class, default: Scope
182
203
 
183
204
  # @overload config.scope_namespace=(namespace)
@@ -188,6 +209,7 @@ module Hanami
188
209
  # @see Scope
189
210
  #
190
211
  # @api public
212
+ # @since 2.1.0
191
213
  # @!scope class
192
214
  setting :scope_namespace
193
215
 
@@ -198,6 +220,7 @@ module Hanami
198
220
  #
199
221
  # @param scope_builder [Class]
200
222
  # @api public
223
+ # @since 2.1.0
201
224
  # @!scope class
202
225
  setting :scope_builder, default: ScopeBuilder
203
226
 
@@ -208,6 +231,7 @@ module Hanami
208
231
  #
209
232
  # @param inflector
210
233
  # @api public
234
+ # @since 2.1.0
211
235
  # @!scope class
212
236
  setting :inflector, default: Dry::Inflector.new
213
237
 
@@ -223,6 +247,7 @@ module Hanami
223
247
  #
224
248
  # @param options [Hash] renderer options
225
249
  # @api public
250
+ # @since 2.1.0
226
251
  # @!scope class
227
252
  setting :renderer_options, default: DEFAULT_RENDERER_OPTIONS, constructor: -> options {
228
253
  DEFAULT_RENDERER_OPTIONS.merge(options.to_h).freeze
@@ -241,12 +266,14 @@ module Hanami
241
266
  #
242
267
  # @param mapping [Hash<Symbol, Class>] engine mapping
243
268
  # @api public
269
+ # @since 2.1.0
244
270
  # @!scope class
245
271
  setting :renderer_engine_mapping, default: {}
246
272
 
247
273
  # @!endgroup
248
274
 
249
275
  # @api private
276
+ # @since 2.1.0
250
277
  def self.inherited(klass)
251
278
  super
252
279
 
@@ -365,6 +392,7 @@ module Hanami
365
392
  # @see https://dry-rb.org/gems/dry-view/exposures/
366
393
  #
367
394
  # @api public
395
+ # @since 2.1.0
368
396
  def self.expose(*names, **options, &block)
369
397
  if names.length == 1
370
398
  exposures.add(names.first, block, **options)
@@ -375,7 +403,10 @@ module Hanami
375
403
  end
376
404
  end
377
405
 
406
+ # @see expose
407
+ #
378
408
  # @api public
409
+ # @since 2.1.0
379
410
  def self.private_expose(*names, **options, &block)
380
411
  expose(*names, **options, private: true, &block)
381
412
  end
@@ -385,6 +416,7 @@ module Hanami
385
416
  #
386
417
  # @return [Exposures]
387
418
  # @api private
419
+ # @since 2.1.0
388
420
  def self.exposures
389
421
  @exposures ||= Exposures.new
390
422
  end
@@ -467,7 +499,10 @@ module Hanami
467
499
  # # <%= greeting %>
468
500
  # # <%= copyright(Time.now.utc) %>
469
501
  #
470
- # MyView.new.(message: "Hello") # => "HELLO!"
502
+ # MyView.new.call(message: "Hello") # => "HELLO!"
503
+ #
504
+ # @api public
505
+ # @since 2.1.0
471
506
  def self.scope(scope_class = nil, &block)
472
507
  scope_class ||= config.scope || config.scope_class
473
508
 
@@ -477,23 +512,24 @@ module Hanami
477
512
  # @!endgroup
478
513
 
479
514
  # @api private
515
+ # @since 2.1.0
480
516
  def self.layout_path(layout)
481
517
  File.join(*[config.layouts_dir, layout].compact)
482
518
  end
483
519
 
484
520
  # @api private
521
+ # @since 2.1.0
485
522
  def self.cache
486
523
  Cache
487
524
  end
488
525
 
489
- # Returns an instance of the view. This binds the defined exposures to the
490
- # view instance.
526
+ # Returns an instance of the view. This binds the defined exposures to the view instance.
491
527
  #
492
- # Subclasses can define their own `#initialize` to accept injected
493
- # dependencies, but must call `super()` to ensure the standard view
494
- # initialization can proceed.
528
+ # Subclasses can define their own `#initialize` to accept injected dependencies, but must call
529
+ # `super()` to ensure the standard view initialization can proceed.
495
530
  #
496
531
  # @api public
532
+ # @since 2.1.0
497
533
  def initialize
498
534
  self.class.config.finalize!
499
535
  ensure_config
@@ -501,22 +537,25 @@ module Hanami
501
537
  @exposures = self.class.exposures.bind(self)
502
538
  end
503
539
 
504
- # The view's configuration
540
+ # Returns the view's configuration.
505
541
  #
506
- # @api private
542
+ # @api public
543
+ # @since 2.1.0
507
544
  def config
508
545
  self.class.config
509
546
  end
510
547
 
511
- # The view's bound exposures
548
+ # Returns the view's bound exposures.
512
549
  #
513
550
  # @return [Exposures]
551
+ #
514
552
  # @api private
553
+ # @since 2.1.0
515
554
  def exposures
516
555
  @exposures
517
556
  end
518
557
 
519
- # Render the view
558
+ # Renders the view.
520
559
  #
521
560
  # @param format [Symbol] template format to use
522
561
  # @param context [Context] context object to use
@@ -524,7 +563,9 @@ module Hanami
524
563
  # @param input input data for preparing exposure values
525
564
  #
526
565
  # @return [Rendered] rendered view object
566
+ #
527
567
  # @api public
568
+ # @since 2.1.0
528
569
  def call(format: config.default_format, context: config.default_context, layout: config.layout, **input)
529
570
  rendering = self.rendering(format: format, context: context)
530
571
 
@@ -532,19 +573,17 @@ module Hanami
532
573
  output = rendering.template(config.template, rendering.scope(config.scope, locals))
533
574
 
534
575
  if layout
535
- begin
536
- output = rendering.template(
537
- self.class.layout_path(layout),
538
- rendering.scope(config.scope, layout_locals(locals))
539
- ) { output }
540
- rescue TemplateNotFoundError
541
- raise LayoutNotFoundError.new(layout, config.paths)
542
- end
576
+ output = rendering.template(
577
+ self.class.layout_path(layout),
578
+ rendering.scope(config.scope, layout_locals(locals))
579
+ ) { output }
543
580
  end
544
581
 
545
582
  Rendered.new(output: output, locals: locals)
546
583
  end
547
584
 
585
+ # @api private
586
+ # @since 2.1.0
548
587
  def rendering(format: config.default_format, context: config.default_context)
549
588
  Rendering.new(config: config, format: format, context: context)
550
589
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-view
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.rc1
4
+ version: 2.1.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Riley
@@ -9,22 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-11-01 00:00:00.000000000 Z
12
+ date: 2023-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: concurrent-ruby
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '1.0'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: '1.0'
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: dry-configurable
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -177,7 +163,6 @@ files:
177
163
  - hanami-view.gemspec
178
164
  - lib/hanami-view.rb
179
165
  - lib/hanami/view.rb
180
- - lib/hanami/view/application_view.rb
181
166
  - lib/hanami/view/cache.rb
182
167
  - lib/hanami/view/context.rb
183
168
  - lib/hanami/view/context_helpers/content_helpers.rb
@@ -233,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
218
  - !ruby/object:Gem::Version
234
219
  version: 1.3.1
235
220
  requirements: []
236
- rubygems_version: 3.4.13
221
+ rubygems_version: 3.4.21
237
222
  signing_key:
238
223
  specification_version: 4
239
224
  summary: A complete, standalone view rendering system that gives you everything you