Class: TestProf::Autopilot::CLI
- Inherits:
-
Object
- Object
- TestProf::Autopilot::CLI
- Includes:
- Logging
- Defined in:
- lib/test_prof/autopilot/cli.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#merge_type ⇒ Object
readonly
Returns the value of attribute merge_type.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#plan_path ⇒ Object
readonly
Returns the value of attribute plan_path.
-
#report_paths ⇒ Object
readonly
Returns the value of attribute report_paths.
Instance Method Summary collapse
Methods included from Logging
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
13 14 15 |
# File 'lib/test_prof/autopilot/cli.rb', line 13 def command @command end |
#merge_type ⇒ Object (readonly)
Returns the value of attribute merge_type.
13 14 15 |
# File 'lib/test_prof/autopilot/cli.rb', line 13 def merge_type @merge_type end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
13 14 15 |
# File 'lib/test_prof/autopilot/cli.rb', line 13 def mode @mode end |
#plan_path ⇒ Object (readonly)
Returns the value of attribute plan_path.
13 14 15 |
# File 'lib/test_prof/autopilot/cli.rb', line 13 def plan_path @plan_path end |
#report_paths ⇒ Object (readonly)
Returns the value of attribute report_paths.
13 14 15 |
# File 'lib/test_prof/autopilot/cli.rb', line 13 def report_paths @report_paths end |
Instance Method Details
#run(args = ARGV) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/test_prof/autopilot/cli.rb', line 15 def run(args = ARGV) @mode = "runner" optparser.parse!(args) if mode == "runner" infer_command! unless command raise "Test command must be specified. See -h for options" unless command raise "Plan path must be specified. See -h for options" unless plan_path raise "Plan #{plan_path} doesn't exist" unless File.file?(plan_path) Runner.invoke(plan_path, command) elsif mode == "merger" raise "Report paths must be specified. See -h for options" unless report_paths Merger.invoke(merge_type, report_paths) end end |