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-3.0.2 lib/build/compileERB/bb.rb
rhodes-3.0.2.beta.1 lib/build/compileERB/bb.rb
rhodes-3.0.1 lib/build/compileERB/bb.rb
rhodes-3.0.1.beta.8 lib/build/compileERB/bb.rb
rhodes-3.0.1.beta.7 lib/build/compileERB/bb.rb
rhodes-3.0.1.beta.6 lib/build/compileERB/bb.rb
rhodes-3.0.1.beta.5 lib/build/compileERB/bb.rb
rhodes-3.0.1.beta.4 lib/build/compileERB/bb.rb
rhodes-3.0.1.beta.3 lib/build/compileERB/bb.rb
rhodes-3.0.1.beta.2 lib/build/compileERB/bb.rb
rhodes-3.0.0 lib/build/compileERB/bb.rb
rhodes-3.0.0.beta.7 lib/build/compileERB/bb.rb
rhodes-3.0.0.beta.6 lib/build/compileERB/bb.rb
rhodes-3.0.0.beta.5 lib/build/compileERB/bb.rb
rhodes-3.0.0.beta.4 lib/build/compileERB/bb.rb
rhodes-3.0.0.beta.3 lib/build/compileERB/bb.rb
rhodes-3.0.0.beta.2 lib/build/compileERB/bb.rb
rhodes-3.0.0.beta.1 lib/build/compileERB/bb.rb
rhodes-2.4.1 lib/build/compileERB/bb.rb
rhodes-2.4.1.beta.1 lib/build/compileERB/bb.rb