Sha256: 49d118392aa8eac10fbae0f448e2d30e7d8f574e1271edae7eabac707828ecd9

Contents?: true

Size: 607 Bytes

Versions: 1

Compression:

Stored size: 607 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.3 lib/ryonan/template.rb