diff --git a/CHANGELOG.md b/CHANGELOG.md index 894a7002..712501b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Lotus::View View layer for Lotus +## v0.4.2 - 2015-06-23 +### Fixed +- [Tom Kadwill] Ensure views to use methods defined by the associated layout. + ## v0.4.1 - 2015-05-22 ### Added - [Luca Guidi] Introduced `#content` to render optional contents in a different context (eg. a view sets a page specific javascript in the application template footer). diff --git a/lib/lotus/view/rendering/layout_scope.rb b/lib/lotus/view/rendering/layout_scope.rb index e801740a..c6b3794a 100644 --- a/lib/lotus/view/rendering/layout_scope.rb +++ b/lib/lotus/view/rendering/layout_scope.rb @@ -229,6 +229,8 @@ def _options(options) end end + # @since 0.4.2 + # @api private def layout @layout || @layout.class.layout.new(@scope, "") end diff --git a/lib/lotus/view/rendering/scope.rb b/lib/lotus/view/rendering/scope.rb index 449fa00d..64ce0032 100644 --- a/lib/lotus/view/rendering/scope.rb +++ b/lib/lotus/view/rendering/scope.rb @@ -72,6 +72,9 @@ def method_missing(m, *args, &block) end private + + # @since 0.4.2 + # @api private def layout if @view.class.respond_to?(:layout) @view.class.layout.new(self, "") diff --git a/lib/lotus/view/version.rb b/lib/lotus/view/version.rb index afe84887..501e13f3 100644 --- a/lib/lotus/view/version.rb +++ b/lib/lotus/view/version.rb @@ -3,6 +3,6 @@ module View # Defines the version # # @since 0.1.0 - VERSION = '0.4.1'.freeze + VERSION = '0.4.2'.freeze end end diff --git a/test/version_test.rb b/test/version_test.rb index 472c3a57..3f01a0e3 100644 --- a/test/version_test.rb +++ b/test/version_test.rb @@ -2,6 +2,6 @@ describe Lotus::View::VERSION do it 'returns current version' do - Lotus::View::VERSION.must_equal '0.4.1' + Lotus::View::VERSION.must_equal '0.4.2' end end