From 63fff600accb41b56a3e6ac403d9b1732de3086d Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 6 Aug 2016 19:36:34 +0200 Subject: modernizes hash syntax in actionview --- actionview/lib/action_view/renderer/abstract_renderer.rb | 2 +- actionview/lib/action_view/renderer/streaming_template_renderer.rb | 2 +- actionview/lib/action_view/renderer/template_renderer.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'actionview/lib/action_view/renderer') diff --git a/actionview/lib/action_view/renderer/abstract_renderer.rb b/actionview/lib/action_view/renderer/abstract_renderer.rb index 1dddf53df0..baff791987 100644 --- a/actionview/lib/action_view/renderer/abstract_renderer.rb +++ b/actionview/lib/action_view/renderer/abstract_renderer.rb @@ -15,7 +15,7 @@ module ActionView # that new object is called in turn. This abstracts the setup and rendering # into a separate classes for partials and templates. class AbstractRenderer #:nodoc: - delegate :find_template, :find_file, :template_exists?, :any_templates?, :with_fallbacks, :with_layout_format, :formats, :to => :@lookup_context + delegate :find_template, :find_file, :template_exists?, :any_templates?, :with_fallbacks, :with_layout_format, :formats, to: :@lookup_context def initialize(lookup_context) @lookup_context = lookup_context diff --git a/actionview/lib/action_view/renderer/streaming_template_renderer.rb b/actionview/lib/action_view/renderer/streaming_template_renderer.rb index 5587d59834..f49cf589f8 100644 --- a/actionview/lib/action_view/renderer/streaming_template_renderer.rb +++ b/actionview/lib/action_view/renderer/streaming_template_renderer.rb @@ -64,7 +64,7 @@ module ActionView output = ActionView::StreamingBuffer.new(buffer) yielder = lambda { |*name| view._layout_for(*name) } - instrument(:template, :identifier => template.identifier, :layout => layout.try(:virtual_path)) do + instrument(:template, identifier: template.identifier, layout: layout.try(:virtual_path)) do fiber = Fiber.new do if layout layout.render(view, locals, output, &yielder) diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb index fcc8ff3d6a..333413c4a1 100644 --- a/actionview/lib/action_view/renderer/template_renderer.rb +++ b/actionview/lib/action_view/renderer/template_renderer.rb @@ -32,7 +32,7 @@ module ActionView with_fallbacks { find_file(options[:file], nil, false, keys, @details) } elsif options.key?(:inline) handler = Template.handler_for_extension(options[:type] || "erb") - Template.new(options[:inline], "inline template", handler, :locals => keys) + Template.new(options[:inline], "inline template", handler, locals: keys) elsif options.key?(:template) if options[:template].respond_to?(:render) options[:template] @@ -50,7 +50,7 @@ module ActionView view, locals = @view, locals || {} render_with_layout(layout_name, locals) do |layout| - instrument(:template, :identifier => template.identifier, :layout => layout.try(:virtual_path)) do + instrument(:template, identifier: template.identifier, layout: layout.try(:virtual_path)) do template.render(view, locals) { |*name| view._layout_for(*name) } end end @@ -89,7 +89,7 @@ module ActionView find_template(layout, nil, false, [], details) end rescue ActionView::MissingTemplate - all_details = @details.merge(:formats => @lookup_context.default_formats) + all_details = @details.merge(formats: @lookup_context.default_formats) raise unless template_exists?(layout, nil, false, [], all_details) end when Proc -- cgit v1.2.3