Class: Hydra::ProfileTask
Overview
Define a test task that uses hydra to profile your test files
Hydra::ProfileTask.new('hydra:prof') do |t|
t.add_files 'test/unit/**/*_test.rb'
t.add_files 'test/functional/**/*_test.rb'
t.add_files 'test/integration/**/*_test.rb'
t.generate_html = true # defaults to false
t.generate_text = true # defaults to true
end
Instance Attribute Summary collapse
-
#generate_html ⇒ Object
boolean: generate html output from ruby-prof.
-
#generate_text ⇒ Object
boolean: generate text output from ruby-prof.
Attributes inherited from Task
#autosort, #config, #environment, #files, #listeners, #name, #runner_log_file, #serial, #show_time, #verbose
Instance Method Summary collapse
-
#initialize(name = 'hydra:profile') {|_self| ... } ⇒ ProfileTask
constructor
Create a new Hydra ProfileTask.
Methods inherited from Task
Constructor Details
#initialize(name = 'hydra:profile') {|_self| ... } ⇒ ProfileTask
Create a new Hydra ProfileTask
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/hydra/tasks.rb', line 155 def initialize(name = 'hydra:profile') @name = name @files = [] @verbose = false @generate_html = false @generate_text = true yield self if block_given? # Ensure we override rspec's at_exit require 'hydra/spec/autorun_override' @config = find_config_file @opts = { :verbose => @verbose, :files => @files } define end |
Instance Attribute Details
#generate_html ⇒ Object
boolean: generate html output from ruby-prof
150 151 152 |
# File 'lib/hydra/tasks.rb', line 150 def generate_html @generate_html end |
#generate_text ⇒ Object
boolean: generate text output from ruby-prof
152 153 154 |
# File 'lib/hydra/tasks.rb', line 152 def generate_text @generate_text end |