From 8f2d8f452823791bb2dfbef4044f6cdac9a60a2e Mon Sep 17 00:00:00 2001
From: Joshua Peek <josh@joshpeek.com>
Date: Fri, 16 Oct 2009 19:30:05 -0500
Subject: script/performance/profiler should require environment

---
 railties/lib/rails/commands/performance/profiler.rb                   | 4 ----
 .../generators/rails/app/templates/script/performance/profiler.tt     | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

(limited to 'railties/lib/rails')

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'
-- 
cgit v1.2.3