Sha256: 18217482d9e47411e0b0e54c704d614e3b4e6c72554c9c2f4af916e95d001d70

Contents?: true

Size: 613 Bytes

Versions: 1

Compression:

Stored size: 613 Bytes

Contents

module Ryonan
  class Template
    def self.create(template_root, name, variable_hash)
      if name.empty?
        Filer.cp_r(Dir.glob("#{template_root}/#{Config.template_dir_name}/*"), "#{template_root}/")
      else
        Filer.cp_r("#{template_root}/#{Config.template_dir_name}", "#{template_root}/#{name}")
        Filer.rm("#{template_root}/#{name}/#{Config.config_file_name}")
      end
      filer = Filer.new("#{template_root}/#{name}")

      variable_hash.each do |key, value|
        filer.recursive_rename_files(key, value)
      end
      
      filer.render_erbs(variable_hash)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ryonan-0.0.2 lib/ryonan/template.rb