Sha256: 7fa8f898fdbfb4006649a8fad17b6fce498975e8cc2ed8365b68df8507dbaa0e

Contents?: true

Size: 578 Bytes

Versions: 66

Compression:

Stored size: 578 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 "\nYou have a syntax error in your ERB: " + path
	    exit 1
	end 
	    
  end
end
			  

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
rhodes-2.0.0.beta7 lib/build/compileERB/bb.rb
rhodes-2.0.0.beta6 lib/build/compileERB/bb.rb
rhodes-2.0.0.beta4 lib/build/compileERB/bb.rb
rhodes-2.0.0.beta3 lib/build/compileERB/bb.rb
rhodes-2.0.0.beta2 lib/build/compileERB/bb.rb
rhodes-2.0.0.beta1 lib/build/compileERB/bb.rb