From 69d0f50206bcca5d6b7d9c491637509af434651c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 20 Feb 2005 13:58:03 +0000 Subject: Added support for independent components residing in /components git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@714 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/environments/shared.rb | 7 +++++++ railties/environments/shared_for_gem.rb | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'railties/environments') diff --git a/railties/environments/shared.rb b/railties/environments/shared.rb index 120ac08b2b..2e4e4ade13 100644 --- a/railties/environments/shared.rb +++ b/railties/environments/shared.rb @@ -7,6 +7,7 @@ ADDITIONAL_LOAD_PATHS = ["#{RAILS_ROOT}/test/mocks/#{RAILS_ENV}"] # Then model subdirectories. ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"]) +ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/components/[_a-z]*"]) # Followed by the standard includes. ADDITIONAL_LOAD_PATHS.concat %w( @@ -16,6 +17,7 @@ ADDITIONAL_LOAD_PATHS.concat %w( app/helpers app/apis config + components lib vendor vendor/railties @@ -61,4 +63,9 @@ end [ActionController, ActionMailer].each { |mod| mod::Base.template_root ||= "#{RAILS_ROOT}/app/views/" } ActionController::Routing::Routes.reload +Controllers = Dependencies::LoadingModule.root( + File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers')), + File.expand_path(File.join(RAILS_ROOT, 'components')) +) + # Include your app's configuration here: diff --git a/railties/environments/shared_for_gem.rb b/railties/environments/shared_for_gem.rb index dc424aa6b3..ee77e3341a 100644 --- a/railties/environments/shared_for_gem.rb +++ b/railties/environments/shared_for_gem.rb @@ -7,6 +7,7 @@ ADDITIONAL_LOAD_PATHS = ["#{RAILS_ROOT}/test/mocks/#{RAILS_ENV}"] # Then model subdirectories. ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"]) +ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/components/[_a-z]*"]) # Followed by the standard includes. ADDITIONAL_LOAD_PATHS.concat %w( @@ -16,6 +17,7 @@ ADDITIONAL_LOAD_PATHS.concat %w( app/helpers app/apis config + components lib vendor ).map { |dir| "#{RAILS_ROOT}/#{dir}" } @@ -56,4 +58,9 @@ end [ActionController, ActionMailer].each { |mod| mod::Base.template_root ||= "#{RAILS_ROOT}/app/views/" } ActionController::Routing::Routes.reload +Controllers = Dependencies::LoadingModule.root( + File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers')), + File.expand_path(File.join(RAILS_ROOT, 'components')) +) + # Include your app's configuration here: -- cgit v1.2.3