class RubyProf::ProfileTask
def run_script(script_path)
def run_script(script_path) run_code = '' RakeFileUtils.verbose(@verbose) do file_name = File.basename(script_path, File.extname(script_path)) case @printer when :flat, :graph, :call_tree file_name += ".txt" when :graph_html file_name += ".html" else file_name += ".txt" end output_file_path = File.join(output_directory, file_name) command_line = @ruby_opts.join(" ") + " --file=" + output_file_path + " " + script_path puts "ruby " + command_line # We have to catch the exeption to continue on. However, # the error message will have been output to STDERR # already by the time we get here so we don't have to # do that again begin ruby command_line rescue => e STDOUT << e << "\n" STDOUT.flush end puts "" puts "" end end