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, #files, #listeners, #name, #serial, #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
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/hydra/tasks.rb', line 133 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
128 129 130 |
# File 'lib/hydra/tasks.rb', line 128 def generate_html @generate_html end |
#generate_text ⇒ Object
boolean: generate text output from ruby-prof
130 131 132 |
# File 'lib/hydra/tasks.rb', line 130 def generate_text @generate_text end |