Class: CvssCli::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/cvss_cli.rb

Constant Summary collapse

@@cvss =
Cvss.new(cvss_string)

Instance Method Summary collapse

Instance Method Details

#clearObject



56
57
58
59
60
# File 'lib/cvss_cli.rb', line 56

def clear()
  @@cvss.clear
  write_file
  invoke :status, []
end

#copyObject



42
43
44
# File 'lib/cvss_cli.rb', line 42

def copy()
  Clipboard.copy @@cvss
end

#cve(cve_string) ⇒ Object



70
71
72
73
# File 'lib/cvss_cli.rb', line 70

def cve(cve_string)
  cvss_string = get_cvss_string_from_cve(cve_string)
  invoke :load, [cvss_string] if cvss_string
end

#exitObject



77
78
79
# File 'lib/cvss_cli.rb', line 77

def exit
  Kernel.exit 0
end

#load(cvss_string) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/cvss_cli.rb', line 47

def load(cvss_string)
  @@cvss.clear
  @@cvss.parse_cvss_string(cvss_string)
  write_file
  invoke :status, [], full: true
  invoke :copy, [], []
end

#statusObject



64
65
66
67
# File 'lib/cvss_cli.rb', line 64

def status()
  @@cvss.print_status(options[:full])
  invoke :copy, [], []
end