Class: Hydra::Task
Overview
Hydra Task Common attributes and methods
Direct Known Subclasses
Instance Attribute Summary collapse
-
#autosort ⇒ Object
Automatically sort files using their historical runtimes.
-
#config ⇒ Object
Path to the hydra config file.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#files ⇒ Object
Files to test.
-
#listeners ⇒ Object
Event listeners.
-
#name ⇒ Object
Name of the task.
-
#options ⇒ Object
Command line options.
-
#runner_log_file ⇒ Object
Set to a valid file path if you want to save the output of the runners in a log file.
-
#serial ⇒ Object
Set to true if you want to run this task only on the local machine with one runner.
-
#show_time ⇒ Object
Set to false if you don’t want to show the total running time.
-
#verbose ⇒ Object
True if you want to see Hydra’s message traces.
Instance Method Summary collapse
-
#add_files(pattern) ⇒ Object
Add files to test by passing in a string to be run through Dir.glob.
-
#find_config_file ⇒ Object
Search for the hydra config file.
Instance Attribute Details
#autosort ⇒ Object
Automatically sort files using their historical runtimes. Defaults to true To disable:
t.autosort = false
31 32 33 |
# File 'lib/hydra/tasks.rb', line 31 def autosort @autosort end |
#config ⇒ Object
Path to the hydra config file. If not set, it will check ‘hydra.yml’ and ‘config/hydra.yml’
25 26 27 |
# File 'lib/hydra/tasks.rb', line 25 def config @config end |
#environment ⇒ Object
Returns the value of attribute environment.
44 45 46 |
# File 'lib/hydra/tasks.rb', line 44 def environment @environment end |
#files ⇒ Object
Files to test. You can add files manually via:
t.files << [file1, file2, etc]
Or you can use the add_files method
18 19 20 |
# File 'lib/hydra/tasks.rb', line 18 def files @files end |
#listeners ⇒ Object
37 38 39 |
# File 'lib/hydra/tasks.rb', line 37 def listeners @listeners end |
#name ⇒ Object
Name of the task. Default ‘hydra’
8 9 10 |
# File 'lib/hydra/tasks.rb', line 8 def name @name end |
#options ⇒ Object
Command line options
11 12 13 |
# File 'lib/hydra/tasks.rb', line 11 def @options end |
#runner_log_file ⇒ Object
Set to a valid file path if you want to save the output of the runners in a log file
51 52 53 |
# File 'lib/hydra/tasks.rb', line 51 def runner_log_file @runner_log_file end |
#serial ⇒ Object
Set to true if you want to run this task only on the local machine with one runner. A “Safe Mode” for some test files that may not play nice with others.
42 43 44 |
# File 'lib/hydra/tasks.rb', line 42 def serial @serial end |
#show_time ⇒ Object
Set to false if you don’t want to show the total running time
47 48 49 |
# File 'lib/hydra/tasks.rb', line 47 def show_time @show_time end |
#verbose ⇒ Object
True if you want to see Hydra’s message traces
21 22 23 |
# File 'lib/hydra/tasks.rb', line 21 def verbose @verbose end |
Instance Method Details
#add_files(pattern) ⇒ Object
Add files to test by passing in a string to be run through Dir.glob. For example:
t.add_files 'test/units/*.rb'
67 68 69 |
# File 'lib/hydra/tasks.rb', line 67 def add_files(pattern) @files += Dir.glob(pattern) end |
#find_config_file ⇒ Object
Search for the hydra config file
55 56 57 58 59 60 61 |
# File 'lib/hydra/tasks.rb', line 55 def find_config_file @config ||= 'hydra.yml' return @config if File.exists?(@config) @config = File.join('config', 'hydra.yml') return @config if File.exists?(@config) @config = nil end |