Class: ThreddedCreateApp::CLI
- Inherits:
-
Object
- Object
- ThreddedCreateApp::CLI
- Includes:
- Logging, RunCommand
- Defined in:
- lib/thredded_create_app/cli.rb
Overview
rubocop:disable Metrics/ClassLength
Defined Under Namespace
Classes: ArgvError, ExecutionError, Flags
Constant Summary collapse
- DEFAULTS =
{ auto_confirm: false, verbose: false, install_gem_bundler_rails: true, start_server: true, webpack_js: true, simple_form: true, database: :postgresql, rails_version: nil }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ CLI
constructor
A new instance of CLI.
- #start ⇒ Object
Methods included from RunCommand
Methods included from Logging
#log_command, #log_error, #log_info, #log_stderr, #log_verbose, #log_warn, #program_name
Constructor Details
#initialize(argv) ⇒ CLI
Returns a new instance of CLI.
30 31 32 |
# File 'lib/thredded_create_app/cli.rb', line 30 def initialize(argv) @argv = argv end |
Class Method Details
.start(argv) ⇒ Object
26 27 28 |
# File 'lib/thredded_create_app/cli.rb', line 26 def self.start(argv) new(argv).start end |
Instance Method Details
#start ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/thredded_create_app/cli.rb', line 34 def start auto_output_coloring do run_cli rescue OptionParser::ParseError, ArgvError => e error e., 64 rescue ThreddedCreateApp::CommandError => e begin error e., 78 ensure log_verbose e.backtrace * "\n" end rescue Errno::EPIPE exit 1 end rescue ExecutionError => e exit e.exit_code end |