diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-21 11:42:45 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-21 11:42:45 +0000 |
commit | d06239e177efa8a851d1c7f6ef25a03fc257e2b9 (patch) | |
tree | 426b6f2e8ef88baff0976b5b8c97c01864c81fde | |
parent | 5d4829065cfbcc12887dcc00c0070b732dc297bb (diff) | |
download | rails-d06239e177efa8a851d1c7f6ef25a03fc257e2b9.tar.gz rails-d06239e177efa8a851d1c7f6ef25a03fc257e2b9.tar.bz2 rails-d06239e177efa8a851d1c7f6ef25a03fc257e2b9.zip |
Choose a simpler requiring of picking gems or not for library loading
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@961 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/environments/environment.rb | 27 | ||||
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/app_generator.rb | 2 |
2 files changed, 8 insertions, 21 deletions
diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index 0e2a83aca6..d01651a35c 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -16,8 +16,8 @@ ADDITIONAL_LOAD_PATHS.concat %w( app/controllers app/helpers app/apis - config components + config lib vendor vendor/rails/railties @@ -33,26 +33,13 @@ ADDITIONAL_LOAD_PATHS.concat %w( ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } # Require Rails libraries. -rails_files = %w( - actionpack/lib/action_controller - actionpack/lib/action_view - activesupport/lib/active_support - activerecord/lib/active_record - actionmailer/lib/action_mailer - actionwebservice/lib/action_web_service -).collect { |p| File.join(RAILS_ROOT, 'vendor', 'rails', "#{p}.rb") } +require 'rubygems' unless File.directory?("#{RAILS_ROOT}/vendor/rails") -if rails_files.all? { |f| File.file?(f) } - rails_files.each { |f| require f } -else - require 'rubygems' - require_gem 'activesupport' - require_gem 'activerecord' - require_gem 'actionpack' - require_gem 'actionmailer' - require_gem 'actionwebservice' - require_gem 'rails' -end +require 'active_support' +require 'active_record' +require 'action_controller' +require 'action_mailer' +require 'action_web_service' # Environment-specific configuration. require_dependency "environments/#{RAILS_ENV}" diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index 79a14b9387..118dc0858a 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -65,7 +65,7 @@ class AppGenerator < Rails::Generator::Base m.template "html/favicon.ico", "public/favicon.ico" # Javascripts - m.file "javascripts/prototype.js", "public/javascripts/prototype.js" + m.file "html/javascripts/prototype.js", "public/javascripts/prototype.js" # Docs m.file "doc/README_FOR_APP", "doc/README_FOR_APP" |