Skip to content

Commit

Permalink
Prepare for v2.1.0.beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Sep 29, 2023
1 parent 5532152 commit 15da1b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

View layer for Hanami

## v2.1.0.beta2 (unreleased)
## v2.1.0.beta2 - 2023-10-04

### Added
- [Luca Guidi] Add `Hanami::View::Rendered#match?`, `#match`, and `#include?` to make it more specs friendly
- [Luca Guidi] Add `Hanami::View::Rendered#match?`, `#match`, and `#include?` to make it more specs friendly.
- [Philip Arndt] Make `Hanami::View#call` to accept `layout:` keyword argument to specify the layout to use during the rendering.

## v2.1.0.beta1 - 2023-06-29

Expand Down
6 changes: 6 additions & 0 deletions lib/hanami/view/rendered.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class View
# Output of a View rendering
#
# @api public
# @since 2.1.0
class Rendered
include Dry::Equalizer(:output, :locals)

Expand All @@ -15,16 +16,19 @@ class Rendered
# @return [String]
#
# @api public
# @since 2.1.0
attr_reader :output

# Returns the hash of locals used to render the view
#
# @return [Hash[<Symbol, Hanami::View::Part>] locals hash
#
# @api public
# @since 2.1.0
attr_reader :locals

# @api private
# @since 2.1.0
def initialize(output:, locals:)
@output = output
@locals = locals
Expand All @@ -37,6 +41,7 @@ def initialize(output:, locals:)
# @return [Hanami::View::Part]
#
# @api public
# @since 2.1.0
def [](name)
locals[name]
end
Expand All @@ -46,6 +51,7 @@ def [](name)
# @return [String]
#
# @api public
# @since 2.1.0
def to_s
output
end
Expand Down
2 changes: 1 addition & 1 deletion lib/hanami/view/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
module Hanami
class View
# @api private
VERSION = "2.1.0.beta1"
VERSION = "2.1.0.beta2"
end
end

0 comments on commit 15da1b1

Please sign in to comment.