aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-12-31 09:09:11 -0800
committerSantiago Pastorino <santiago@wyeworks.com>2012-12-31 09:09:11 -0800
commitcf2dcf4e9f752a4dbb4f477bd1b884863bab5ca4 (patch)
tree8de9a2f087b9db9a20904bf939068049777bd74d
parentb22c527e65a41da59dbfcb078968069c6fae5086 (diff)
parentdbacb95a2187e853c0615f30919a407744162595 (diff)
downloadrails-cf2dcf4e9f752a4dbb4f477bd1b884863bab5ca4.tar.gz
rails-cf2dcf4e9f752a4dbb4f477bd1b884863bab5ca4.tar.bz2
rails-cf2dcf4e9f752a4dbb4f477bd1b884863bab5ca4.zip
Merge pull request #8666 from mekishizufu/fix_lambdas
Fix usage of lambda as a Rack endpoint
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb4
-rw-r--r--railties/test/application/assets_test.rb2
-rw-r--r--railties/test/railties/engine_test.rb2
3 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 3c99932e72..0dc6403ec0 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -315,7 +315,7 @@ module ActionDispatch
# A pattern can also point to a +Rack+ endpoint i.e. anything that
# responds to +call+:
#
- # match 'photos/:id', to: lambda {|hash| [200, {}, "Coming soon"] }
+ # match 'photos/:id', to: lambda {|hash| [200, {}, ["Coming soon"]] }
# match 'photos/:id', to: PhotoRackApp
# # Yes, controller actions are just rack endpoints
# match 'photos/:id', to: PhotosController.action(:show)
@@ -360,7 +360,7 @@ module ActionDispatch
# +call+ or a string representing a controller's action.
#
# match 'path', to: 'controller#action'
- # match 'path', to: lambda { |env| [200, {}, "Success!"] }
+ # match 'path', to: lambda { |env| [200, {}, ["Success!"]] }
# match 'path', to: RackApp
#
# [:on]
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb
index f98915d1cc..638df8ca23 100644
--- a/railties/test/application/assets_test.rb
+++ b/railties/test/application/assets_test.rb
@@ -45,7 +45,7 @@ module ApplicationTests
app_file 'config/routes.rb', <<-RUBY
AppTemplate::Application.routes.draw do
- get '*path', to: lambda { |env| [200, { "Content-Type" => "text/html" }, "Not an asset"] }
+ get '*path', to: lambda { |env| [200, { "Content-Type" => "text/html" }, ["Not an asset"]] }
end
RUBY
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb
index fcbe7b6cda..a4a75fe459 100644
--- a/railties/test/railties/engine_test.rb
+++ b/railties/test/railties/engine_test.rb
@@ -568,7 +568,7 @@ YAML
@plugin.write "lib/bukkits.rb", <<-RUBY
module Bukkits
class Engine < ::Rails::Engine
- endpoint lambda { |env| [200, {'Content-Type' => 'text/html'}, 'hello'] }
+ endpoint lambda { |env| [200, {'Content-Type' => 'text/html'}, ['hello']] }
end
end
RUBY