Class: BundleSafeUpdate::CLI

Inherits:
Object
  • Object
show all
Includes:
Options, Output, ColorOutput
Defined in:
lib/bundle_safe_update/cli.rb,
lib/bundle_safe_update/cli/output.rb,
lib/bundle_safe_update/cli/options.rb

Defined Under Namespace

Modules: Options, Output

Constant Summary collapse

EXIT_SUCCESS =
0
EXIT_VIOLATIONS =
1
EXIT_ERROR =
2

Constants included from ColorOutput

BundleSafeUpdate::ColorOutput::COLORS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Output

#blocked_reason, #build_json_output, #config_lines, #config_values, #dry_run_output, #format_list, #output_audit_result, #output_human, #output_json, #output_risk_results, #print_audit_error, #print_audit_results, #print_audit_unavailable, #print_result, #print_risk_result, #print_risk_signal, #print_risk_summary, #print_skipped, #print_summary, #print_update_result, #print_update_start, #print_vulnerability

Methods included from Options

#build_option_parser, #define_basic_config_options, #define_config_options, #define_info_options, #define_output_options, #define_skip_options

Methods included from ColorOutput

#colorize, #cyan, #green, #red, #yellow

Class Method Details

.run(args) ⇒ Object



19
20
21
# File 'lib/bundle_safe_update/cli.rb', line 19

def self.run(args)
  new.run(args)
end

Instance Method Details

#run(args) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/bundle_safe_update/cli.rb', line 23

def run(args)
  options, gems = parse_options(args)
  config = Config.new(options)
  return dry_run(config) if options[:dry_run]

  results = check_gems(config, options[:verbose], gems)
  process_results(results, config, options)
rescue StandardError => e
  handle_error(e, options[:verbose])
  EXIT_ERROR
end