Class: HolePicker::OnlineDatabase

Inherits:
Database
  • Object
show all
Includes:
HasLogger
Defined in:
lib/holepicker/online_database.rb

Constant Summary collapse

URL =
'https://raw.githubusercontent.com/jsuder/holepicker/master/lib/holepicker/data/data.json'

Instance Attribute Summary

Attributes inherited from Database

#vulnerabilities

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HasLogger

included, #logger

Methods inherited from Database

#compatible?, load_from_json_file

Constructor Details

#initialize(json) ⇒ OnlineDatabase

Returns a new instance of OnlineDatabase.



23
24
25
26
27
28
# File 'lib/holepicker/online_database.rb', line 23

def initialize(json)
  super

  check_compatibility
  report_new_vulnerabilities
end

Class Method Details

.loadObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/holepicker/online_database.rb', line 12

def self.load
  logger.info "Fetching list of vulnerabilities..."

  load_from_json_file(http_get(URL))
rescue SystemExit
  raise
rescue Exception => e
  logger.fail "Can't download latest data file: #{e}"
  exit 1
end