Service
This is a service plugin for ruby-prof command line tool.
Default script files to run via ruby-prof.
Shell out to ruby-prof.
TODO: Need to create an index.html file to link to all the others.
# File lib/plugins/syckle/rubyprof.rb, line 39 def analyize files = scripts.map{ |s| Dir[s] }.flatten # create output directory if needed mkdir_p(output) unless File.exist?(output) # if nothing is out-of-date if outofdate?(output, *files) or force? # make a profile for each script files.each do |file| fname = output + "#{File.basename(file)}.html" if outofdate?(output, file) or force? sh "ruby-prof #{options} -m 1 -p graph_html -f #{fname} #{file}" end end report "ruby-prof updated (at #{output.sub(Dir.pwd,'')})" else report "ruby-prof is current (at #{output.sub(Dir.pwd,'')})" end end
Remove output directory and it’s contents.
# File lib/plugins/syckle/rubyprof.rb, line 67 def clean if File.directory?(output) rm_r(output) status "removed #{output}" #unless trial? end end
Generated with the Darkfish Rdoc Generator 2.