Class: Enc::Runner

Inherits:
Object
  • Object
show all
Includes:
Utils::Logging
Defined in:
lib/enc/runner.rb

Instance Method Summary collapse

Methods included from Utils::Logging

configure_logger, convert_log_level, #logger, logger_for, set_config, set_log_file, set_log_level

Constructor Details

#initialize(config) ⇒ Runner

Returns a new instance of Runner.



5
6
7
8
# File 'lib/enc/runner.rb', line 5

def initialize(config)
  @config = config
  @cache = get_cache
end

Instance Method Details

#build(hostname) ⇒ Object



10
11
12
13
14
15
# File 'lib/enc/runner.rb', line 10

def build(hostname)
  asset, from_collins = get_asset(hostname)
  # Do not rewrite the cache unless the asset comes from Collins.
  @cache.write(hostname, asset) if from_collins
  Enc::Builder.new(asset)
end