Class: Dawn::Registry

Inherits:
Object
  • Object
show all
Includes:
DataMapper::Resource
Defined in:
lib/dawn/registry.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.dumpObject



36
37
38
39
40
41
# File 'lib/dawn/registry.rb', line 36

def self.dump
  all.each do |entry|
    puts "#{entry.scan_started.strftime("[%Y-%m-%d %H:%M:%S]")}  #{entry.scan_status.upcase} -- : #{entry.target}: #{entry.issues_found} issues found - #{entry.output_dir}" if entry.scan_status == :completed
    puts "#{entry.scan_started.strftime("[%Y-%m-%d %H:%M:%S]")}  #{entry.scan_status.upcase} -- : #{entry.target}: #{entry.message}" if entry.scan_status == :failed
  end
end

Instance Method Details

#do_save(options = {}) ⇒ Object



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

def do_save(options={})

  self.target         = options[:target]
  self.output_dir     = options[:output_dir]
  self.scan_status    = options[:scan_status]
  self.issues_found   = options[:issues_found]
  self.scan_started   = options[:scan_started]
  self.scan_duration  = options[:scan_duration]
  self.message        = options[:message]

  save
end