script/performance/profiler should require environment

This commit is contained in:
Joshua Peek
2009-10-16 19:30:05 -05:00
parent 2f7217c76a
commit 8f2d8f4528
2 changed files with 1 additions and 5 deletions

View File

@@ -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"

View File

@@ -1,3 +1,3 @@
<%= shebang %>
require File.expand_path('../../../config/application', __FILE__)
require File.expand_path('../../../config/environment', __FILE__)
require 'rails/commands/performance/profiler'