Sha256: 12af856229437e084b8459081c8760c11bbbb67ddf798ad555806ddc8006dcb7

Contents?: true

Size: 522 Bytes

Versions: 1

Compression:

Stored size: 522 Bytes

Contents

module Gem
  module Writter
    class Template
      def initialize(project)
        @project = project
      end

      protected

      def write_template(template_name, to_file)
        FileUtils.mkdir_p File.dirname(to_file)
        template = ERB.new File.read(template(template_name)), nil, "-"
        File.open(to_file, "w") { |f| f.write template.result(binding) }
      end

      def template(name)
        File.expand_path File.join(File.dirname(__FILE__), "..", "templates", name)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rab-0.1.0 lib/rab/gem/writer/template.rb