Module: ToErb

Defined in:
lib/to_erb.rb,
lib/to_erb/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.convert(infile, outfile) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/to_erb.rb', line 5

def self.convert(infile,outfile)


  hamlcode = File.open(infile).read
  engine = ErbEngine.new(hamlcode)
  File.open(outfile,"w") do |file|
    file.write engine.render
  end

  print "converted #{infile} to #{outfile}\n"
rescue Exception => e
  print "FAILED conersion of #{infile} due error #{e}"
end