aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-05-29 17:03:23 -0500
committerJoshua Peek <josh@joshpeek.com>2009-05-29 17:03:23 -0500
commit669fd84910586d4c791b6f5bf4320f68ac7845aa (patch)
treeec246bdf6fe6fc61219c59837c4bec07ba19e267 /actionpack
parentc7c35be8fe30b3e29a5d05edae767f7d6a286911 (diff)
downloadrails-669fd84910586d4c791b6f5bf4320f68ac7845aa.tar.gz
rails-669fd84910586d4c791b6f5bf4320f68ac7845aa.tar.bz2
rails-669fd84910586d4c791b6f5bf4320f68ac7845aa.zip
AS::Concern redefines "include" to lazy include modules as dependencies
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/abstract/benchmarker.rb2
-rw-r--r--actionpack/lib/action_controller/abstract/callbacks.rb2
-rw-r--r--actionpack/lib/action_controller/abstract/helpers.rb2
-rw-r--r--actionpack/lib/action_controller/abstract/layouts.rb2
-rw-r--r--actionpack/lib/action_controller/abstract/renderer.rb2
-rw-r--r--actionpack/lib/action_controller/base/chained/flash.rb2
-rw-r--r--actionpack/lib/action_controller/base/filter_parameter_logging.rb6
-rw-r--r--actionpack/lib/action_controller/base/request_forgery_protection.rb2
-rw-r--r--actionpack/lib/action_controller/base/streaming.rb2
-rw-r--r--actionpack/lib/action_controller/base/verification.rb2
-rw-r--r--actionpack/lib/action_controller/new_base/conditional_get.rb2
-rw-r--r--actionpack/lib/action_controller/new_base/helpers.rb2
-rw-r--r--actionpack/lib/action_controller/new_base/layouts.rb4
-rw-r--r--actionpack/lib/action_controller/new_base/render_options.rb10
-rw-r--r--actionpack/lib/action_controller/new_base/renderer.rb2
-rw-r--r--actionpack/lib/action_controller/new_base/session.rb2
-rw-r--r--actionpack/lib/action_controller/new_base/testing.rb2
-rw-r--r--actionpack/lib/action_controller/new_base/url_for.rb2
18 files changed, 24 insertions, 26 deletions
diff --git a/actionpack/lib/action_controller/abstract/benchmarker.rb b/actionpack/lib/action_controller/abstract/benchmarker.rb
index 6999329144..07294cede3 100644
--- a/actionpack/lib/action_controller/abstract/benchmarker.rb
+++ b/actionpack/lib/action_controller/abstract/benchmarker.rb
@@ -2,7 +2,7 @@ module AbstractController
module Benchmarker
extend ActiveSupport::Concern
- depends_on Logger
+ include Logger
module ClassMethods
def benchmark(title, log_level = ::Logger::DEBUG, use_silence = true)
diff --git a/actionpack/lib/action_controller/abstract/callbacks.rb b/actionpack/lib/action_controller/abstract/callbacks.rb
index 6c67315c58..c6d3413c30 100644
--- a/actionpack/lib/action_controller/abstract/callbacks.rb
+++ b/actionpack/lib/action_controller/abstract/callbacks.rb
@@ -2,7 +2,7 @@ module AbstractController
module Callbacks
extend ActiveSupport::Concern
- depends_on ActiveSupport::NewCallbacks
+ include ActiveSupport::NewCallbacks
included do
define_callbacks :process_action, "response_body"
diff --git a/actionpack/lib/action_controller/abstract/helpers.rb b/actionpack/lib/action_controller/abstract/helpers.rb
index 43832f1e2d..0a2776de9c 100644
--- a/actionpack/lib/action_controller/abstract/helpers.rb
+++ b/actionpack/lib/action_controller/abstract/helpers.rb
@@ -2,7 +2,7 @@ module AbstractController
module Helpers
extend ActiveSupport::Concern
- depends_on Renderer
+ include Renderer
included do
extlib_inheritable_accessor :master_helper_module
diff --git a/actionpack/lib/action_controller/abstract/layouts.rb b/actionpack/lib/action_controller/abstract/layouts.rb
index b3f21f7b22..273063f74b 100644
--- a/actionpack/lib/action_controller/abstract/layouts.rb
+++ b/actionpack/lib/action_controller/abstract/layouts.rb
@@ -2,7 +2,7 @@ module AbstractController
module Layouts
extend ActiveSupport::Concern
- depends_on Renderer
+ include Renderer
included do
extlib_inheritable_accessor :_layout_conditions
diff --git a/actionpack/lib/action_controller/abstract/renderer.rb b/actionpack/lib/action_controller/abstract/renderer.rb
index cd3e87d861..dd58c7cb64 100644
--- a/actionpack/lib/action_controller/abstract/renderer.rb
+++ b/actionpack/lib/action_controller/abstract/renderer.rb
@@ -4,7 +4,7 @@ module AbstractController
module Renderer
extend ActiveSupport::Concern
- depends_on AbstractController::Logger
+ include AbstractController::Logger
included do
attr_internal :formats
diff --git a/actionpack/lib/action_controller/base/chained/flash.rb b/actionpack/lib/action_controller/base/chained/flash.rb
index 04d27bf090..42c6e430ca 100644
--- a/actionpack/lib/action_controller/base/chained/flash.rb
+++ b/actionpack/lib/action_controller/base/chained/flash.rb
@@ -29,7 +29,7 @@ module ActionController #:nodoc:
extend ActiveSupport::Concern
# TODO : Remove the defined? check when new base is the main base
- depends_on Session if defined?(ActionController::Http)
+ include Session if defined?(ActionController::Http)
included do
# TODO : Remove the defined? check when new base is the main base
diff --git a/actionpack/lib/action_controller/base/filter_parameter_logging.rb b/actionpack/lib/action_controller/base/filter_parameter_logging.rb
index 9df286ee24..8370ba6fc0 100644
--- a/actionpack/lib/action_controller/base/filter_parameter_logging.rb
+++ b/actionpack/lib/action_controller/base/filter_parameter_logging.rb
@@ -4,13 +4,11 @@ module ActionController
# TODO : Remove the defined? check when new base is the main base
if defined?(ActionController::Http)
- depends_on AbstractController::Logger
+ include AbstractController::Logger
end
included do
- if defined?(ActionController::Http)
- include InstanceMethodsForNewBase
- end
+ include InstanceMethodsForNewBase
end
module ClassMethods
diff --git a/actionpack/lib/action_controller/base/request_forgery_protection.rb b/actionpack/lib/action_controller/base/request_forgery_protection.rb
index 368c6e9de8..a470c8eec1 100644
--- a/actionpack/lib/action_controller/base/request_forgery_protection.rb
+++ b/actionpack/lib/action_controller/base/request_forgery_protection.rb
@@ -7,7 +7,7 @@ module ActionController #:nodoc:
# TODO : Remove the defined? check when new base is the main base
if defined?(ActionController::Http)
- depends_on AbstractController::Helpers, Session
+ include AbstractController::Helpers, Session
end
included do
diff --git a/actionpack/lib/action_controller/base/streaming.rb b/actionpack/lib/action_controller/base/streaming.rb
index 5f56c95483..73d4bde6c1 100644
--- a/actionpack/lib/action_controller/base/streaming.rb
+++ b/actionpack/lib/action_controller/base/streaming.rb
@@ -6,7 +6,7 @@ module ActionController #:nodoc:
# TODO : Remove the defined? check when new base is the main base
if defined?(ActionController::Http)
- depends_on ActionController::Renderer
+ include ActionController::Renderer
end
DEFAULT_SEND_FILE_OPTIONS = {
diff --git a/actionpack/lib/action_controller/base/verification.rb b/actionpack/lib/action_controller/base/verification.rb
index 31654e36f3..d87b348ed4 100644
--- a/actionpack/lib/action_controller/base/verification.rb
+++ b/actionpack/lib/action_controller/base/verification.rb
@@ -4,7 +4,7 @@ module ActionController #:nodoc:
# TODO : Remove the defined? check when new base is the main base
if defined?(ActionController::Http)
- depends_on AbstractController::Callbacks, Session, Flash, Renderer
+ include AbstractController::Callbacks, Session, Flash, Renderer
end
# This module provides a class-level method for specifying that certain
diff --git a/actionpack/lib/action_controller/new_base/conditional_get.rb b/actionpack/lib/action_controller/new_base/conditional_get.rb
index 8bd6db500b..d287ec4994 100644
--- a/actionpack/lib/action_controller/new_base/conditional_get.rb
+++ b/actionpack/lib/action_controller/new_base/conditional_get.rb
@@ -2,7 +2,7 @@ module ActionController
module ConditionalGet
extend ActiveSupport::Concern
- depends_on RackConvenience
+ include RackConvenience
# Sets the etag, last_modified, or both on the response and renders a
# "304 Not Modified" response if the request is already fresh.
diff --git a/actionpack/lib/action_controller/new_base/helpers.rb b/actionpack/lib/action_controller/new_base/helpers.rb
index c2ebd343e3..e8000be87b 100644
--- a/actionpack/lib/action_controller/new_base/helpers.rb
+++ b/actionpack/lib/action_controller/new_base/helpers.rb
@@ -6,7 +6,7 @@ module ActionController
module Helpers
extend ActiveSupport::Concern
- depends_on AbstractController::Helpers
+ include AbstractController::Helpers
included do
# Set the default directory for helpers
diff --git a/actionpack/lib/action_controller/new_base/layouts.rb b/actionpack/lib/action_controller/new_base/layouts.rb
index 727358c394..0ff71587d6 100644
--- a/actionpack/lib/action_controller/new_base/layouts.rb
+++ b/actionpack/lib/action_controller/new_base/layouts.rb
@@ -2,8 +2,8 @@ module ActionController
module Layouts
extend ActiveSupport::Concern
- depends_on ActionController::Renderer
- depends_on AbstractController::Layouts
+ include ActionController::Renderer
+ include AbstractController::Layouts
module ClassMethods
def _implied_layout_name
diff --git a/actionpack/lib/action_controller/new_base/render_options.rb b/actionpack/lib/action_controller/new_base/render_options.rb
index 04b954134f..fc9a02626f 100644
--- a/actionpack/lib/action_controller/new_base/render_options.rb
+++ b/actionpack/lib/action_controller/new_base/render_options.rb
@@ -39,7 +39,7 @@ module ActionController
module RenderOption #:nodoc:
def self.extended(base)
base.extend ActiveSupport::Concern
- base.depends_on ::ActionController::RenderOptions
+ base.send :include, ::ActionController::RenderOptions
def base.register_renderer(name)
included { _add_render_option(name) }
@@ -94,10 +94,10 @@ module ActionController
module All
extend ActiveSupport::Concern
- depends_on ActionController::Renderers::Json
- depends_on ActionController::Renderers::Js
- depends_on ActionController::Renderers::Xml
- depends_on ActionController::Renderers::RJS
+ include ActionController::Renderers::Json
+ include ActionController::Renderers::Js
+ include ActionController::Renderers::Xml
+ include ActionController::Renderers::RJS
end
end
end
diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb
index e132d4fdbb..2fab501302 100644
--- a/actionpack/lib/action_controller/new_base/renderer.rb
+++ b/actionpack/lib/action_controller/new_base/renderer.rb
@@ -2,7 +2,7 @@ module ActionController
module Renderer
extend ActiveSupport::Concern
- depends_on AbstractController::Renderer
+ include AbstractController::Renderer
def process_action(*)
self.formats = request.formats.map {|x| x.to_sym}
diff --git a/actionpack/lib/action_controller/new_base/session.rb b/actionpack/lib/action_controller/new_base/session.rb
index a585630230..bcedd6e1c7 100644
--- a/actionpack/lib/action_controller/new_base/session.rb
+++ b/actionpack/lib/action_controller/new_base/session.rb
@@ -2,7 +2,7 @@ module ActionController
module Session
extend ActiveSupport::Concern
- depends_on RackConvenience
+ include RackConvenience
def session
@_request.session
diff --git a/actionpack/lib/action_controller/new_base/testing.rb b/actionpack/lib/action_controller/new_base/testing.rb
index e8d210d149..a4a1116d9e 100644
--- a/actionpack/lib/action_controller/new_base/testing.rb
+++ b/actionpack/lib/action_controller/new_base/testing.rb
@@ -2,7 +2,7 @@ module ActionController
module Testing
extend ActiveSupport::Concern
- depends_on RackConvenience
+ include RackConvenience
# OMG MEGA HAX
def process_with_new_base_test(request, response)
diff --git a/actionpack/lib/action_controller/new_base/url_for.rb b/actionpack/lib/action_controller/new_base/url_for.rb
index 902cac4d15..7119c14cd3 100644
--- a/actionpack/lib/action_controller/new_base/url_for.rb
+++ b/actionpack/lib/action_controller/new_base/url_for.rb
@@ -2,7 +2,7 @@ module ActionController
module UrlFor
extend ActiveSupport::Concern
- depends_on RackConvenience
+ include RackConvenience
def process_action(*)
initialize_current_url