Class: Broadlistening::CLI
- Inherits:
-
Object
- Object
- Broadlistening::CLI
- Defined in:
- lib/broadlistening/cli.rb
Constant Summary collapse
- PIPELINE_DIR =
Pathname.new(__dir__).parent.parent / "outputs"
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(argv = ARGV) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(argv = ARGV) ⇒ CLI
Returns a new instance of CLI.
13 14 15 16 17 18 19 20 |
# File 'lib/broadlistening/cli.rb', line 13 def initialize(argv = ARGV) @argv = argv = { force: false, only: nil, skip_interaction: false } end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/broadlistening/cli.rb', line 11 def end |
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/broadlistening/cli.rb', line 22 def run validate_config_path config = load_config validate_config(config) output_dir = determine_output_dir ensure_output_dir(output_dir) unless [:skip_interaction] show_plan(config, output_dir) confirm_execution || exit(0) end execute_pipeline(config, output_dir) rescue Broadlistening::Error => e $stderr.puts "Error: #{e.message}" exit 1 rescue Interrupt $stderr.puts "\nInterrupted" exit 130 end |