Class: Legendary::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/legendary/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(path = nil) ⇒ Runner

Returns a new instance of Runner.



3
4
5
6
# File 'lib/legendary/runner.rb', line 3

def initialize(path=nil)
  Legendary.repository = Repository.new(path)
  @report = File.join(Dir.pwd, "output.html")
end

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/legendary/runner.rb', line 8

def run
  Legendary.logger.info("Updating Repository")
  Legendary.repository.clone_or_update

  Legendary.logger.info("Loading Gems")

  gems = Gems.new.to_a
  File.write(@report, Legendary::Formatters::Html.new(gems).format)
  Legendary.logger.info("Report Saved at #{@report}")
end