Class: Revamp::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/revamp/application.rb

Overview

A main application class

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Application

Returns a new instance of Application.



7
8
9
10
11
12
# File 'lib/revamp/application.rb', line 7

def initialize(options)
  @options   = options
  @filenames = options[:filenames]
  @format    = :rpm
  @log       = Revamp.logger
end

Instance Method Details

#run!Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/revamp/application.rb', line 14

def run!
  converted = []
  @filenames.each do |file|
    @log.info("Processing file: #{file} ...")
    parser = Revamp::Parser::PuppetTarball.new(file)
    model = parser.parse
    persister = build_persister
    target = persister.persist(model)
    report(converted, persister, target)
  end
  @log.info("#{converted.size} files converted.")
end