Move Controllers wrapper module away from environment.rb and into dependencies.rb

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@627 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2005-02-15 16:21:56 +00:00
parent b3767f7f0b
commit dcfd6aa3bd
5 changed files with 38 additions and 6 deletions

View File

@@ -85,4 +85,6 @@ module ActionController #:nodoc:
end
end
end
end
end
Controllers = Dependencies::LoadingModule.new(File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers'))) if defined?(RAILS_ROOT)

View File

@@ -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 File

@@ -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

View File

@@ -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

View File

@@ -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'