Sha256: 4bdc4b1d3117a0c7315dd42ff908dd329e66c944ee794a6ae1b0f01ebb313eaa
Contents?: true
Size: 896 Bytes
Versions: 2
Compression:
Stored size: 896 Bytes
Contents
require 'thor' require 'forwardable' module Lotus module Generators class Generator extend Forwardable def_delegators :@processor, :run, :behavior=, :inject_into_file, :append_to_file, :prepend_to_file class Processor < Thor include Thor::Actions end def initialize(template_source_path, target_path) @template_source_path = template_source_path @target_path = target_path @template_mappings = [] @processor = Processor.new @processor.class.source_root(@template_source_path) end def add_mapping(source, target) @template_mappings << [source, target] end def process_templates(options = {}) @template_mappings.each do |src, dst| @processor.template(@template_source_path.join(src), @target_path.join(dst), options) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lotusrb-0.6.1 | lib/lotus/generators/generator.rb |
lotusrb-0.6.0 | lib/lotus/generators/generator.rb |