aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-05-07 10:29:22 -0500
committerJoshua Peek <josh@joshpeek.com>2009-05-07 10:29:22 -0500
commit2854535b02bcee3668bda02c76c3105fc24730d3 (patch)
treeb78660942bdc6f532a1109da57ee40d7d31cf603 /actionpack
parent783deae99a4850f597135146b19e7ee4622da94e (diff)
downloadrails-2854535b02bcee3668bda02c76c3105fc24730d3.tar.gz
rails-2854535b02bcee3668bda02c76c3105fc24730d3.tar.bz2
rails-2854535b02bcee3668bda02c76c3105fc24730d3.zip
Make module dependency DSL opt in
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/abstract/helpers.rb2
-rw-r--r--actionpack/lib/action_controller/abstract/layouts.rb5
-rw-r--r--actionpack/lib/action_controller/abstract/logger.rb2
-rw-r--r--actionpack/lib/action_controller/abstract/renderer.rb2
-rw-r--r--actionpack/lib/action_controller/new_base/layouts.rb2
-rw-r--r--actionpack/lib/action_controller/new_base/renderer.rb2
-rw-r--r--actionpack/test/abstract_controller/callbacks_test.rb2
-rw-r--r--actionpack/test/abstract_controller/layouts_test.rb6
-rw-r--r--actionpack/test/new_base/test_helper.rb14
9 files changed, 24 insertions, 13 deletions
diff --git a/actionpack/lib/action_controller/abstract/helpers.rb b/actionpack/lib/action_controller/abstract/helpers.rb
index 1f0b38417b..ffcae29ddc 100644
--- a/actionpack/lib/action_controller/abstract/helpers.rb
+++ b/actionpack/lib/action_controller/abstract/helpers.rb
@@ -1,5 +1,7 @@
module AbstractController
module Helpers
+ extend ActiveSupport::DependencyModule
+
depends_on Renderer
setup do
diff --git a/actionpack/lib/action_controller/abstract/layouts.rb b/actionpack/lib/action_controller/abstract/layouts.rb
index 0039e67c5a..76130f8dc0 100644
--- a/actionpack/lib/action_controller/abstract/layouts.rb
+++ b/actionpack/lib/action_controller/abstract/layouts.rb
@@ -1,8 +1,9 @@
module AbstractController
module Layouts
-
+ extend ActiveSupport::DependencyModule
+
depends_on Renderer
-
+
module ClassMethods
def layout(layout)
unless [String, Symbol, FalseClass, NilClass].include?(layout.class)
diff --git a/actionpack/lib/action_controller/abstract/logger.rb b/actionpack/lib/action_controller/abstract/logger.rb
index 4117369bd4..bdb8defa0c 100644
--- a/actionpack/lib/action_controller/abstract/logger.rb
+++ b/actionpack/lib/action_controller/abstract/logger.rb
@@ -1,5 +1,7 @@
module AbstractController
module Logger
+ extend ActiveSupport::DependencyModule
+
setup do
cattr_accessor :logger
end
diff --git a/actionpack/lib/action_controller/abstract/renderer.rb b/actionpack/lib/action_controller/abstract/renderer.rb
index e31accbbfc..531eb28dcb 100644
--- a/actionpack/lib/action_controller/abstract/renderer.rb
+++ b/actionpack/lib/action_controller/abstract/renderer.rb
@@ -2,6 +2,8 @@ require "action_controller/abstract/logger"
module AbstractController
module Renderer
+ extend ActiveSupport::DependencyModule
+
depends_on AbstractController::Logger
setup do
diff --git a/actionpack/lib/action_controller/new_base/layouts.rb b/actionpack/lib/action_controller/new_base/layouts.rb
index a8e0809ac6..89d24fe92d 100644
--- a/actionpack/lib/action_controller/new_base/layouts.rb
+++ b/actionpack/lib/action_controller/new_base/layouts.rb
@@ -1,5 +1,7 @@
module ActionController
module Layouts
+ extend ActiveSupport::DependencyModule
+
depends_on ActionController::Renderer
depends_on AbstractController::Layouts
diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb
index ed34c46aed..be4ea54c3b 100644
--- a/actionpack/lib/action_controller/new_base/renderer.rb
+++ b/actionpack/lib/action_controller/new_base/renderer.rb
@@ -1,5 +1,7 @@
module ActionController
module Renderer
+ extend ActiveSupport::DependencyModule
+
depends_on AbstractController::Renderer
def initialize(*)
diff --git a/actionpack/test/abstract_controller/callbacks_test.rb b/actionpack/test/abstract_controller/callbacks_test.rb
index 5fce30f478..89243b631e 100644
--- a/actionpack/test/abstract_controller/callbacks_test.rb
+++ b/actionpack/test/abstract_controller/callbacks_test.rb
@@ -4,7 +4,7 @@ module AbstractController
module Testing
class ControllerWithCallbacks < AbstractController::Base
- use AbstractController::Callbacks
+ include AbstractController::Callbacks
end
class Callback1 < ControllerWithCallbacks
diff --git a/actionpack/test/abstract_controller/layouts_test.rb b/actionpack/test/abstract_controller/layouts_test.rb
index 3d4570bfef..a305a30a54 100644
--- a/actionpack/test/abstract_controller/layouts_test.rb
+++ b/actionpack/test/abstract_controller/layouts_test.rb
@@ -5,9 +5,9 @@ module AbstractControllerTests
# Base controller for these tests
class Base < AbstractController::Base
- use AbstractController::Renderer
- use AbstractController::Layouts
-
+ include AbstractController::Renderer
+ include AbstractController::Layouts
+
self.view_paths = [ActionView::FixtureTemplate::FixturePath.new(
"layouts/hello.erb" => "With String <%= yield %>",
"layouts/hello_override.erb" => "With Override <%= yield %>",
diff --git a/actionpack/test/new_base/test_helper.rb b/actionpack/test/new_base/test_helper.rb
index d29449ddc1..89c29d9af3 100644
--- a/actionpack/test/new_base/test_helper.rb
+++ b/actionpack/test/new_base/test_helper.rb
@@ -26,14 +26,14 @@ require 'rack/test'
module ActionController
class Base2 < AbstractBase
- use AbstractController::Callbacks
- use AbstractController::Helpers
- use AbstractController::Logger
+ include AbstractController::Callbacks
+ include AbstractController::Helpers
+ include AbstractController::Logger
- use ActionController::HideActions
- use ActionController::UrlFor
- use ActionController::Renderer
- use ActionController::Layouts
+ include ActionController::HideActions
+ include ActionController::UrlFor
+ include ActionController::Renderer
+ include ActionController::Layouts
def self.inherited(klass)
::ActionController::Base2.subclasses << klass.to_s