Sha256: 712b9d6ae86cf69857bb77d6f551254dfaea3dd6adeb240e3a806c1f56539b6c

Contents?: true

Size: 384 Bytes

Versions: 1

Compression:

Stored size: 384 Bytes

Contents

require "chebyshev/version"
require 'yaml'
require 'erubis'

class Chebyshev
  def self.expand(origin_file_path, yaml_file_path, result_file_path=nil)
    erb = Erubis::Eruby.new(File.read origin_file_path)
    erb.result(YAML.load(File.read yaml_file_path)).tap do |expand_file|
      if result_file_path
        File.write(result_file_path, expand_file)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chebyshev-0.1.0 lib/chebyshev.rb