From de1060f4e02925c12004f2ae4dd3f28cdb6a8e04 Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Mon, 17 Sep 2012 10:07:08 -0500 Subject: Rename .rb template handler to .ruby to avoid conflicts with mustache views classes --- actionpack/CHANGELOG.md | 2 +- actionpack/lib/action_view/template/handlers.rb | 2 +- actionpack/test/fixtures/ruby_template.rb | 2 -- actionpack/test/fixtures/ruby_template.ruby | 2 ++ actionpack/test/template/render_test.rb | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 actionpack/test/fixtures/ruby_template.rb create mode 100644 actionpack/test/fixtures/ruby_template.ruby diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 239e4445d3..f6ada64f23 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -18,7 +18,7 @@ *Sergey Nartimov* -* Add .rb template handler, this handler simply allows arbitrary Ruby code as a template. *Guillermo Iguaran* +* Add .ruby template handler, this handler simply allows arbitrary Ruby code as a template. *Guillermo Iguaran* * Add `separator` option for `ActionView::Helpers::TextHelper#excerpt`: diff --git a/actionpack/lib/action_view/template/handlers.rb b/actionpack/lib/action_view/template/handlers.rb index 52e032bbd8..6b57d4bb89 100644 --- a/actionpack/lib/action_view/template/handlers.rb +++ b/actionpack/lib/action_view/template/handlers.rb @@ -10,7 +10,7 @@ module ActionView #:nodoc: base.register_default_template_handler :erb, ERB.new base.register_template_handler :builder, Builder.new base.register_template_handler :raw, Raw.new - base.register_template_handler :rb, :source.to_proc + base.register_template_handler :ruby, :source.to_proc end @@template_handlers = {} diff --git a/actionpack/test/fixtures/ruby_template.rb b/actionpack/test/fixtures/ruby_template.rb deleted file mode 100644 index 5097bce47c..0000000000 --- a/actionpack/test/fixtures/ruby_template.rb +++ /dev/null @@ -1,2 +0,0 @@ -body = "" -body << ["Hello", "from", "Ruby", "code"].join(" ") diff --git a/actionpack/test/fixtures/ruby_template.ruby b/actionpack/test/fixtures/ruby_template.ruby new file mode 100644 index 0000000000..5097bce47c --- /dev/null +++ b/actionpack/test/fixtures/ruby_template.ruby @@ -0,0 +1,2 @@ +body = "" +body << ["Hello", "from", "Ruby", "code"].join(" ") diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 6279abaae5..d113b401da 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -97,12 +97,12 @@ module RenderTestCases assert_equal %q;Here are some characters: !@#$%^&*()-="'}{`; + "\n", @view.render(:template => "plain_text_with_characters") end - def test_render_rb_template_with_handlers + def test_render_ruby_template_with_handlers assert_equal "Hello from Ruby code", @view.render(:template => "ruby_template") end - def test_render_rb_template_inline - assert_equal '4', @view.render(:inline => "(2**2).to_s", :type => :rb) + def test_render_ruby_template_inline + assert_equal '4', @view.render(:inline => "(2**2).to_s", :type => :ruby) end def test_render_file_with_localization_on_context_level -- cgit v1.2.3