aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-10-16 19:30:05 -0500
committerJoshua Peek <josh@joshpeek.com>2009-10-16 19:33:24 -0500
commit8f2d8f452823791bb2dfbef4044f6cdac9a60a2e (patch)
tree6f608ae718ff91a68a3cb466152203d8984655e2 /railties
parent2f7217c76a68b048b15d2b8d821a2aa569ef924a (diff)
downloadrails-8f2d8f452823791bb2dfbef4044f6cdac9a60a2e.tar.gz
rails-8f2d8f452823791bb2dfbef4044f6cdac9a60a2e.tar.bz2
rails-8f2d8f452823791bb2dfbef4044f6cdac9a60a2e.zip
script/performance/profiler should require environment
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/commands/performance/profiler.rb4
-rwxr-xr-xrailties/lib/rails/generators/rails/app/templates/script/performance/profiler.tt2
2 files changed, 1 insertions, 5 deletions
diff --git a/railties/lib/rails/commands/performance/profiler.rb b/railties/lib/rails/commands/performance/profiler.rb
index 30346dc0e7..aaa075018c 100644
--- a/railties/lib/rails/commands/performance/profiler.rb
+++ b/railties/lib/rails/commands/performance/profiler.rb
@@ -3,10 +3,6 @@ if ARGV.empty?
exit(1)
end
-# Keep the expensive require out of the profile.
-$stderr.puts 'Loading Rails...'
-Rails.initialize! # Initialize the application
-
# Define a method to profile.
if ARGV[1] and ARGV[1].to_i > 1
eval "def profile_me() #{ARGV[1]}.times { #{ARGV[0]} } end"
diff --git a/railties/lib/rails/generators/rails/app/templates/script/performance/profiler.tt b/railties/lib/rails/generators/rails/app/templates/script/performance/profiler.tt
index 39569b4e70..5f4c763f9d 100755
--- a/railties/lib/rails/generators/rails/app/templates/script/performance/profiler.tt
+++ b/railties/lib/rails/generators/rails/app/templates/script/performance/profiler.tt
@@ -1,3 +1,3 @@
<%= shebang %>
-require File.expand_path('../../../config/application', __FILE__)
+require File.expand_path('../../../config/environment', __FILE__)
require 'rails/commands/performance/profiler'