Sha256: da4cf146d3c18cb630f26e22ed3055d1926e804e5db36dcade2b84ec9480e0b4

Contents?: true

Size: 562 Bytes

Versions: 9

Compression:

Stored size: 562 Bytes

Contents

require 'find'
require 'erb'

dir = File.dirname(File.expand_path(__FILE__))
ext = ".erb"

Find.find(dir) do |path| 
  if File.extname(path) == ext
    begin
        strFile = IO.read(path)
        strFile.force_encoding('utf-8')
	    rbText = ERB.new( strFile ).src
    	
	    newName = File.basename(path).sub('.erb','_erb.rb')
	    fName = File.join(File.dirname(path), newName)
	    frb = File.new(fName, "wb")
	    frb.write( rbText )
	    frb.close()
	rescue Exception => e
	    puts 'erb compilation failed: ' + path
	    raise
	end 
	    
  end
end
			  

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rhodes-1.5.5 lib/build/compileERB/bb.rb
rhodes-1.5.4 lib/build/compileERB/bb.rb
rhodes-1.5.3 lib/build/compileERB/bb.rb
rhodes-1.5.2 lib/build/compileERB/bb.rb
rhodes-1.5.1 lib/build/compileERB/bb.rb
rhodes-1.5.0 lib/build/compileERB/bb.rb
rhodes-1.4.2 lib/build/compileERB/bb.rb
rhodes-1.4.1 lib/build/compileERB/bb.rb
rhodes-1.4.0 lib/build/compileERB/bb.rb