aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/initializer.rb10
-rw-r--r--railties/lib/rails/backtrace_cleaner.rb3
-rw-r--r--railties/lib/rails/plugin.rb5
-rw-r--r--railties/test/boot_test.rb1
-rw-r--r--railties/test/gem_dependency_test.rb1
5 files changed, 12 insertions, 8 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index b3b409dc4d..1bd7baed62 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -5,12 +5,9 @@ require 'pathname'
$LOAD_PATH.unshift File.dirname(__FILE__)
require 'railties_path'
require 'rails/version'
-require 'rails/plugin/locator'
-require 'rails/plugin/loader'
require 'rails/gem_dependency'
require 'rails/rack'
-
RAILS_ENV = (ENV['RAILS_ENV'] || 'development').dup unless defined?(RAILS_ENV)
module Rails
@@ -244,6 +241,7 @@ module Rails
# Set the paths from which Rails will automatically load source files, and
# the load_once paths.
def set_autoload_paths
+ require 'active_support/dependencies'
ActiveSupport::Dependencies.load_paths = configuration.load_paths.uniq
ActiveSupport::Dependencies.load_once_paths = configuration.load_once_paths.uniq
@@ -263,6 +261,8 @@ module Rails
# list. By default, all frameworks (Active Record, Active Support,
# Action Pack, Action Mailer, and Active Resource) are loaded.
def require_frameworks
+ require 'active_support'
+ require 'active_support/core/all'
configuration.frameworks.each { |framework| require(framework.to_s) }
rescue LoadError => e
# Re-raise as RuntimeError because Mongrel would swallow LoadError.
@@ -289,10 +289,12 @@ module Rails
# Adds all load paths from plugins to the global set of load paths, so that
# code from plugins can be required (explicitly or automatically via ActiveSupport::Dependencies).
def add_plugin_load_paths
+ require 'active_support/dependencies'
plugin_loader.add_plugin_load_paths
end
def add_gem_load_paths
+ require 'rails/gem_dependency'
Rails::GemDependency.add_frozen_gem_path
unless @configuration.gems.empty?
require "rubygems"
@@ -1037,12 +1039,14 @@ Run `rake gems:install` to install the missing gems.
end
def default_plugin_locators
+ require 'rails/plugin/locator'
locators = []
locators << Plugin::GemLocator if defined? Gem
locators << Plugin::FileSystemLocator
end
def default_plugin_loader
+ require 'rails/plugin/loader'
Plugin::Loader
end
diff --git a/railties/lib/rails/backtrace_cleaner.rb b/railties/lib/rails/backtrace_cleaner.rb
index 923ed8b31d..1605429e8b 100644
--- a/railties/lib/rails/backtrace_cleaner.rb
+++ b/railties/lib/rails/backtrace_cleaner.rb
@@ -1,3 +1,6 @@
+require 'active_support/backtrace_cleaner'
+require 'rails/gem_dependency'
+
module Rails
class BacktraceCleaner < ActiveSupport::BacktraceCleaner
ERB_METHOD_SIG = /:in `_run_erb_.*/
diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb
index bc28bec57e..0f924724cd 100644
--- a/railties/lib/rails/plugin.rb
+++ b/railties/lib/rails/plugin.rb
@@ -1,8 +1,3 @@
-require 'active_support'
-require 'active_support/core_ext/kernel/reporting'
-require 'active_support/core_ext/symbol'
-require 'active_support/dependencies'
-
module Rails
# The Plugin class should be an object which provides the following methods:
#
diff --git a/railties/test/boot_test.rb b/railties/test/boot_test.rb
index 08fcc82e6f..2dd68857c3 100644
--- a/railties/test/boot_test.rb
+++ b/railties/test/boot_test.rb
@@ -1,6 +1,7 @@
require 'abstract_unit'
require 'initializer'
require "#{File.dirname(__FILE__)}/../environments/boot"
+require 'rails/gem_dependency'
class BootTest < Test::Unit::TestCase
def test_boot_returns_if_booted
diff --git a/railties/test/gem_dependency_test.rb b/railties/test/gem_dependency_test.rb
index d9cd5148a3..da7bda9bee 100644
--- a/railties/test/gem_dependency_test.rb
+++ b/railties/test/gem_dependency_test.rb
@@ -1,4 +1,5 @@
require 'plugin_test_helper'
+require 'rails/gem_dependency'
class Rails::GemDependency
public :install_command, :unpack_command