Module: Beaker::Shared::OptionsResolver
- Included in:
- Beaker::Shared
- Defined in:
- lib/beaker/shared/options_resolver.rb
Overview
Methods for parsing options.
Instance Method Summary collapse
-
#run_in_parallel?(local_options = nil, global_options = nil, mode = nil) ⇒ Boolean
parses local and global options to determine if a particular mode should be run in parallel.
Instance Method Details
#run_in_parallel?(local_options = nil, global_options = nil, mode = nil) ⇒ Boolean
parses local and global options to determine if a particular mode should be run in parallel. typically, local_options will specify a true/false value, while global_options will specify an array of mode names that should be run in parallel. the value specified in local_options will take precedence over the values specified in global_options.
26 27 28 29 30 31 32 33 34 |
# File 'lib/beaker/shared/options_resolver.rb', line 26 def run_in_parallel?( = nil, = nil, mode = nil) run_in_parallel = [:run_in_parallel] unless .nil? run_in_parallel = false if !run_in_parallel.nil? && run_in_parallel.is_a?(Array) run_in_parallel = [:run_in_parallel].include?(mode) if run_in_parallel.nil? && && [:run_in_parallel].is_a?(Array) run_in_parallel end |