diff options
author | Carl Lerche <carllerche@mac.com> | 2009-10-15 14:50:02 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2009-10-15 14:54:12 -0700 |
commit | 97296b11e2c4011ea5522c4de0153f7ffa6a47ae (patch) | |
tree | c21e07dede9bb91108839ccafbbfa29f2e4838d7 /railties/lib/rails/commands | |
parent | e1490d4e4c60211173d51e7b21c16dbe4c2d942a (diff) | |
download | rails-97296b11e2c4011ea5522c4de0153f7ffa6a47ae.tar.gz rails-97296b11e2c4011ea5522c4de0153f7ffa6a47ae.tar.bz2 rails-97296b11e2c4011ea5522c4de0153f7ffa6a47ae.zip |
Have config/application.rb contain the application definition and require that file instead of config/boot.rb or config/environment.rb in script/*.
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/about.rb | 3 | ||||
-rw-r--r-- | railties/lib/rails/commands/destroy.rb | 2 | ||||
-rwxr-xr-x | railties/lib/rails/commands/generate.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/performance/benchmarker.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/performance/profiler.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/runner.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/update.rb | 1 |
7 files changed, 7 insertions, 7 deletions
diff --git a/railties/lib/rails/commands/about.rb b/railties/lib/rails/commands/about.rb index bc2cfcb948..9a05c47390 100644 --- a/railties/lib/rails/commands/about.rb +++ b/railties/lib/rails/commands/about.rb @@ -1,3 +1,4 @@ -require "#{RAILS_ROOT}/config/environment" +require "#{RAILS_ROOT}/config/application" +Rails.application.new require 'rails/info' puts Rails::Info diff --git a/railties/lib/rails/commands/destroy.rb b/railties/lib/rails/commands/destroy.rb index 5013d30b83..860c03e01e 100644 --- a/railties/lib/rails/commands/destroy.rb +++ b/railties/lib/rails/commands/destroy.rb @@ -1,5 +1,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'generators')) -require "#{RAILS_ROOT}/config/environment" +require "#{RAILS_ROOT}/config/application" if ARGV.size == 0 Rails::Generators.help diff --git a/railties/lib/rails/commands/generate.rb b/railties/lib/rails/commands/generate.rb index 32cabcab10..cfa6a51d94 100755 --- a/railties/lib/rails/commands/generate.rb +++ b/railties/lib/rails/commands/generate.rb @@ -1,5 +1,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'generators')) -require "#{RAILS_ROOT}/config/environment" +Rails.application.new if ARGV.size == 0 Rails::Generators.help diff --git a/railties/lib/rails/commands/performance/benchmarker.rb b/railties/lib/rails/commands/performance/benchmarker.rb index e8804fe1bf..5039c5408c 100644 --- a/railties/lib/rails/commands/performance/benchmarker.rb +++ b/railties/lib/rails/commands/performance/benchmarker.rb @@ -10,9 +10,9 @@ rescue ArgumentError N = 1 end -require RAILS_ROOT + '/config/environment' require 'benchmark' include Benchmark +Rails.application.new # Don't include compilation in the benchmark ARGV.each { |expression| eval(expression) } diff --git a/railties/lib/rails/commands/performance/profiler.rb b/railties/lib/rails/commands/performance/profiler.rb index 7df840f197..7274e2dfb7 100644 --- a/railties/lib/rails/commands/performance/profiler.rb +++ b/railties/lib/rails/commands/performance/profiler.rb @@ -5,7 +5,7 @@ end # Keep the expensive require out of the profile. $stderr.puts 'Loading Rails...' -require RAILS_ROOT + '/config/environment' +Rails.application.new # Initialize the application # Define a method to profile. if ARGV[1] and ARGV[1].to_i > 1 diff --git a/railties/lib/rails/commands/runner.rb b/railties/lib/rails/commands/runner.rb index 510128318a..d24f36dd63 100644 --- a/railties/lib/rails/commands/runner.rb +++ b/railties/lib/rails/commands/runner.rb @@ -36,7 +36,7 @@ ARGV.delete(code_or_file) ENV["RAILS_ENV"] = options[:environment] RAILS_ENV.replace(options[:environment]) if defined?(RAILS_ENV) -require RAILS_ROOT + '/config/environment' +Rails.application.new begin if code_or_file.nil? diff --git a/railties/lib/rails/commands/update.rb b/railties/lib/rails/commands/update.rb index f3b3ad0775..85a81cddf0 100644 --- a/railties/lib/rails/commands/update.rb +++ b/railties/lib/rails/commands/update.rb @@ -1,5 +1,4 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'generators')) -require "#{RAILS_ROOT}/config/environment" if ARGV.size == 0 Rails::Generators.help |