Sha256: 2d31b306d65c3d8f56e5c1b3ccc55e298fd72ccba2607cc705dae98e9edc259e
Contents?: true
Size: 952 Bytes
Versions: 18
Compression:
Stored size: 952 Bytes
Contents
# encoding: utf-8 module ProxyTester module Actions class CreateOutput private attr_reader :name, :output, :engine, :repository, :data public def initialize(name, output, data, engine = ErbGenerator, repository = TemplateRepository.new) @name = name @output = output @data = data @engine = engine @repository = repository end def run ProxyTester.ui_logger.info "Creating example configuration:" template(name, output, data) end private def template(local_name, local_destination, local_data) template = repository.find(local_name) generator = engine.new(local_data) generator.compile(template, local_destination) rescue Errno::ENOENT fail Exceptions::ErbTemplateIsUnknown, JSON.dump(message: "Unknown erb template \"#{template_path}\".") end end end end
Version data entries
18 entries across 18 versions & 1 rubygems