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



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

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

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


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

def self.exit_on_failure?
  true
end

Instance Method Details

#deprecated(dir = Dir.pwd) ⇒ Object



41
42
43
# File 'lib/package/audit/cli.rb', line 41

def deprecated(dir = Dir.pwd)
  within_rescue_block { exit CommandParser.new(dir, options, Enum::Report::DEPRECATED).run }
end

#outdated(dir = Dir.pwd) ⇒ Object



46
47
48
# File 'lib/package/audit/cli.rb', line 46

def outdated(dir = Dir.pwd)
  within_rescue_block { exit CommandParser.new(dir, options, Enum::Report::OUTDATED).run }
end

#report(dir = Dir.pwd) ⇒ Object



35
36
37
# File 'lib/package/audit/cli.rb', line 35

def report(dir = Dir.pwd)
  within_rescue_block { exit CommandParser.new(dir, options, Enum::Report::ALL).run }
end

#respond_to_missing?Boolean

Returns:

  • (Boolean)


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

def respond_to_missing?
  true
end

#riskObject



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

def risk
  Util::SummaryPrinter.risk
end

#versionObject



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

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

#vulnerable(dir = Dir.pwd) ⇒ Object



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

def vulnerable(dir = Dir.pwd)
  within_rescue_block { exit CommandParser.new(dir, options, Enum::Report::VULNERABLE).run }
end