Class: Package::Audit::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/package/audit/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(command, *args) ⇒ Object



68
69
70
# File 'lib/package/audit/cli.rb', line 68

def method_missing(command, *args)
  invoke :default, [command], args
end

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/package/audit/cli.rb', line 64

def self.exit_on_failure?
  true
end

Instance Method Details

#default(dir = Dir.pwd) ⇒ Object



49
50
51
52
# File 'lib/package/audit/cli.rb', line 49

def default(dir = Dir.pwd)
  report = determine_report_type
  within_rescue_block { exit CommandParser.new(dir, options, report).run }
end

#respond_to_missing?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/package/audit/cli.rb', line 72

def respond_to_missing?
  true
end

#riskObject



55
56
57
# File 'lib/package/audit/cli.rb', line 55

def risk
  Util::RiskLegend.print
end

#versionObject



60
61
62
# File 'lib/package/audit/cli.rb', line 60

def version
  puts "package-audit #{VERSION}"
end