aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_controller/dependencies.rb4
-rw-r--r--activesupport/lib/active_support.rb29
-rw-r--r--railties/environments/shared.rb2
-rw-r--r--railties/environments/shared_for_gem.rb2
-rw-r--r--railties/lib/rails_generator.rb7
5 files changed, 38 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/dependencies.rb b/actionpack/lib/action_controller/dependencies.rb
index 8bc013db66..abf6ca7417 100644
--- a/actionpack/lib/action_controller/dependencies.rb
+++ b/actionpack/lib/action_controller/dependencies.rb
@@ -85,4 +85,6 @@ module ActionController #:nodoc:
end
end
end
-end \ No newline at end of file
+end
+
+Controllers = Dependencies::LoadingModule.new(File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers'))) if defined?(RAILS_ROOT) \ No newline at end of file
diff --git a/activesupport/lib/active_support.rb b/activesupport/lib/active_support.rb
new file mode 100644
index 0000000000..30034a316e
--- /dev/null
+++ b/activesupport/lib/active_support.rb
@@ -0,0 +1,29 @@
+#--
+# Copyright (c) 2005 David Heinemeier Hansson
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#++
+
+$:.unshift(File.dirname(__FILE__))
+
+require 'active_support/core_ext'
+require 'active_support/clean_logger'
+require 'active_support/misc'
+require 'active_support/dependencies'
diff --git a/railties/environments/shared.rb b/railties/environments/shared.rb
index bccc9c3e21..2d37714831 100644
--- a/railties/environments/shared.rb
+++ b/railties/environments/shared.rb
@@ -41,8 +41,6 @@ require_dependency "environments/#{RAILS_ENV}"
ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
ActiveRecord::Base.establish_connection
-Controllers = Dependencies::LoadingModule.new(File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers')))
-
# Configure defaults if the included environment did not.
begin
diff --git a/railties/environments/shared_for_gem.rb b/railties/environments/shared_for_gem.rb
index f58d974cc1..057f664396 100644
--- a/railties/environments/shared_for_gem.rb
+++ b/railties/environments/shared_for_gem.rb
@@ -37,8 +37,6 @@ require_dependency "environments/#{RAILS_ENV}"
ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
ActiveRecord::Base.establish_connection
-Controllers = Dependencies::LoadingModule.new(File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers')))
-
# Configure defaults if the included environment did not.
begin
diff --git a/railties/lib/rails_generator.rb b/railties/lib/rails_generator.rb
index 3e7f459345..8268f3f5f0 100644
--- a/railties/lib/rails_generator.rb
+++ b/railties/lib/rails_generator.rb
@@ -23,7 +23,12 @@
$:.unshift(File.dirname(__FILE__))
-require 'active_support'
+begin
+ require 'active_support'
+rescue LoadError
+ require 'rubygems'
+ require_gem 'activesupport'
+end
require 'rails_generator/base'
require 'rails_generator/lookup'