Class: Stratagem::Snapshot

Inherits:
Object show all
Defined in:
lib/stratagem/snapshot.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



3
4
5
# File 'lib/stratagem/snapshot.rb', line 3

def model
  @model
end

#project_nameObject (readonly)

Returns the value of attribute project_name.



3
4
5
# File 'lib/stratagem/snapshot.rb', line 3

def project_name
  @project_name
end

#scannerObject (readonly)

Returns the value of attribute scanner.



3
4
5
# File 'lib/stratagem/snapshot.rb', line 3

def scanner
  @scanner
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



3
4
5
# File 'lib/stratagem/snapshot.rb', line 3

def timestamp
  @timestamp
end

Class Method Details

.create(project_name) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/stratagem/snapshot.rb', line 5

def self.create(project_name)
  logger.phase('modeling_application')
  model = Stratagem::ModelBuilder.new.run

  # Crawl site 
  logger.phase('traversing_site')
  model.crawler = Stratagem::SiteCrawler.new(model).run

  logger.phase('vulnerability_scanning')
  scanner = Stratagem::Scanner.new(model).run

  snapshot = self.new(project_name, Time.now, model, scanner)
end

.loggerObject



19
20
21
# File 'lib/stratagem/snapshot.rb', line 19

def self.logger
  Stratagem.logger
end