aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/abstract_controller.rb1
-rw-r--r--actionpack/lib/abstract_controller/asset_paths.rb9
-rw-r--r--actionpack/lib/abstract_controller/base.rb1
-rw-r--r--actionpack/lib/abstract_controller/rendering.rb1
-rw-r--r--actionpack/lib/action_controller/base.rb4
-rw-r--r--actionpack/lib/action_controller/metal/rack_delegation.rb8
-rw-r--r--actionpack/lib/action_controller/metal/request_forgery_protection.rb1
-rw-r--r--actionpack/lib/action_view/paths.rb1
9 files changed, 22 insertions, 6 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 54c7771f4c..faa0d674dc 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*Rails 3.0.0 [beta 4/release candidate] (unreleased)*
+* Remove middleware laziness [José Valim]
+
* Make session stores rely on request.cookie_jar and change set_session semantics to return the cookie value instead of a boolean. [José Valim]
* OAuth 2: HTTP Token Authorization support to complement Basic and Digest Authorization. [Rick Olson]
diff --git a/actionpack/lib/abstract_controller.rb b/actionpack/lib/abstract_controller.rb
index 2da4dc052c..5990a1bbd0 100644
--- a/actionpack/lib/abstract_controller.rb
+++ b/actionpack/lib/abstract_controller.rb
@@ -20,5 +20,6 @@ module AbstractController
autoload :Logger
autoload :Rendering
autoload :Translation
+ autoload :AssetPaths
autoload :ViewPaths
end
diff --git a/actionpack/lib/abstract_controller/asset_paths.rb b/actionpack/lib/abstract_controller/asset_paths.rb
new file mode 100644
index 0000000000..6d6f6ac607
--- /dev/null
+++ b/actionpack/lib/abstract_controller/asset_paths.rb
@@ -0,0 +1,9 @@
+module AbstractController
+ module AssetPaths
+ extend ActiveSupport::Concern
+
+ included do
+ config_accessor :assets_dir, :javascripts_dir, :stylesheets_dir
+ end
+ end
+end \ No newline at end of file
diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb
index 8500cbd7f2..ff97a7e76a 100644
--- a/actionpack/lib/abstract_controller/base.rb
+++ b/actionpack/lib/abstract_controller/base.rb
@@ -1,4 +1,5 @@
require 'active_support/configurable'
+require 'active_support/core_ext/module/anonymous'
module AbstractController
class Error < StandardError; end
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb
index d2db366140..6e3998aa21 100644
--- a/actionpack/lib/abstract_controller/rendering.rb
+++ b/actionpack/lib/abstract_controller/rendering.rb
@@ -1,4 +1,5 @@
require "abstract_controller/base"
+require "action_view"
module AbstractController
class DoubleRenderError < Error
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 4297d9bbf6..8611d0d3c3 100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -13,6 +13,7 @@ module ActionController
MODULES = [
AbstractController::Layouts,
AbstractController::Translation,
+ AbstractController::AssetPaths,
Helpers,
HideActions,
@@ -66,8 +67,7 @@ module ActionController
@subclasses ||= []
end
- # TODO Move this to the appropriate module
- config_accessor :assets_dir, :asset_path, :javascripts_dir, :stylesheets_dir
+ config_accessor :asset_host, :asset_path
ActiveSupport.run_load_hooks(:action_controller, self)
end
diff --git a/actionpack/lib/action_controller/metal/rack_delegation.rb b/actionpack/lib/action_controller/metal/rack_delegation.rb
index 060117756e..508ea6e2b7 100644
--- a/actionpack/lib/action_controller/metal/rack_delegation.rb
+++ b/actionpack/lib/action_controller/metal/rack_delegation.rb
@@ -8,10 +8,10 @@ module ActionController
delegate :headers, :status=, :location=, :content_type=,
:status, :location, :content_type, :to => "@_response"
- def dispatch(action, request)
- @_response = ActionDispatch::Response.new
- @_response.request = request
- super
+ def dispatch(action, request, response = ActionDispatch::Response.new)
+ @_response ||= response
+ @_response.request ||= request
+ super(action, request)
end
def params
diff --git a/actionpack/lib/action_controller/metal/request_forgery_protection.rb b/actionpack/lib/action_controller/metal/request_forgery_protection.rb
index 2ba0d6e5cd..8c25b147ef 100644
--- a/actionpack/lib/action_controller/metal/request_forgery_protection.rb
+++ b/actionpack/lib/action_controller/metal/request_forgery_protection.rb
@@ -47,6 +47,7 @@ module ActionController #:nodoc:
extend ActiveSupport::Concern
include AbstractController::Helpers
+ include AbstractController::Callbacks
included do
# Sets the token parameter name for RequestForgery. Calling +protect_from_forgery+
diff --git a/actionpack/lib/action_view/paths.rb b/actionpack/lib/action_view/paths.rb
index 35927d09d1..7f5e5d11b8 100644
--- a/actionpack/lib/action_view/paths.rb
+++ b/actionpack/lib/action_view/paths.rb
@@ -31,6 +31,7 @@ module ActionView #:nodoc:
def typecast!
each_with_index do |path, i|
+ path = path.to_s if path.is_a?(Pathname)
next unless path.is_a?(String)
self[i] = FileSystemResolver.new(path)
end