Sha256: 4a32efbb8e8afe0217493f436b456bd012d4547805852e190e67e403ce3f9035
Contents?: true
Size: 794 Bytes
Versions: 19
Compression:
Stored size: 794 Bytes
Contents
require "yaml" class Lono::Template class Generator include Lono::Blueprint::Root def initialize(blueprint, options={}) @blueprint, @options = blueprint, options @template = @options[:template] || @blueprint Lono::ProjectChecker.check set_blueprint_root(@blueprint) end def run # Examples: # Erb.new(b, options.clone).run # Dsl.new(b, options.clone).run generator_class = "Lono::Template::#{template_type.classify}" generator_class = Object.const_get(generator_class) generator_class.new(@blueprint, @options.clone).run end def template_type meta_config = "#{Lono.blueprint_root}/.meta/config.yml" data = YAML.load_file(meta_config) data["template_type"] || "dsl" end end end
Version data entries
19 entries across 19 versions & 1 rubygems