From 7c70430ce063af501154591f114dfc02e559f774 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Tue, 23 Aug 2016 10:24:08 +0900 Subject: Fix broken heredoc indentation caused by rubocop auto-correct All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But heredocs was still kept absolute position. This commit aligns heredocs indentation for consistency. --- actionview/lib/action_view/layouts.rb | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/layouts.rb b/actionview/lib/action_view/layouts.rb index b6bf6b9374..dd5f6e7300 100644 --- a/actionview/lib/action_view/layouts.rb +++ b/actionview/lib/action_view/layouts.rb @@ -290,11 +290,12 @@ module ActionView RUBY end - layout_definition = case _layout - when String - _layout.inspect - when Symbol - <<-RUBY + layout_definition = \ + case _layout + when String + _layout.inspect + when Symbol + <<-RUBY #{_layout}.tap do |layout| return #{default_behavior} if layout.nil? unless layout.is_a?(String) || !layout @@ -303,21 +304,21 @@ module ActionView end end RUBY - when Proc - define_method :_layout_from_proc, &_layout - protected :_layout_from_proc - <<-RUBY + when Proc + define_method :_layout_from_proc, &_layout + protected :_layout_from_proc + <<-RUBY result = _layout_from_proc(#{_layout.arity == 0 ? '' : 'self'}) return #{default_behavior} if result.nil? result RUBY - when false - nil - when true - raise ArgumentError, "Layouts must be specified as a String, Symbol, Proc, false, or nil" - when nil - name_clause - end + when false + nil + when true + raise ArgumentError, "Layouts must be specified as a String, Symbol, Proc, false, or nil" + when nil + name_clause + end self.class_eval <<-RUBY, __FILE__, __LINE__ + 1 def _layout(formats) -- cgit v1.2.3