Skip to content
Browse files

Move Controllers wrapper module away from environment.rb and into dep…

…endencies.rb

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@627 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent b3767f7 commit dcfd6aa3bd91c93adf6ed47453a084327f018000 @dhh dhh committed
View
4 actionpack/lib/action_controller/dependencies.rb
@@ -85,4 +85,6 @@ def inherited(child)
end
end
end
-end
+end
+
+Controllers = Dependencies::LoadingModule.new(File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers'))) if defined?(RAILS_ROOT)
View
29 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'
View
2 railties/environments/shared.rb
@@ -41,8 +41,6 @@
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
View
2 railties/environments/shared_for_gem.rb
@@ -37,8 +37,6 @@
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
View
7 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'

0 comments on commit dcfd6aa

Please sign in to comment.
Something went wrong with that request. Please try again.