Sha256: a081ae3a72562ee701a32d766dacb6e268cef63b6577d477102ce4dab068d1c8

Contents?: true

Size: 740 Bytes

Versions: 15

Compression:

Stored size: 740 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
	  
    	

	    seq = __rho_compile(rbText)
	    arr = seq.to_a
    	
	    newName = File.basename(path).sub('.erb','_erb.iseq')
	    fName = File.join(File.dirname(path), newName)
	    fseq = File.new(fName, "w")
    	
	    Marshal.dump(arr,fseq)
    	
	    fseq.close()
	rescue Exception => e
	    puts "\nYou have a syntax error in your ERB: " + path
      puts "See log above for the line number following the string \"(eval):\"\n\n"
	    exit 1
	end 
	
  end
end
			  

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rhodes-2.0.3 lib/build/compileERB/default.rb
rhodes-2.0.2 lib/build/compileERB/default.rb
rhodes-2.0.0 lib/build/compileERB/default.rb
rhodes-2.0.0.rc2 lib/build/compileERB/default.rb
rhodes-2.0.0.rc1 lib/build/compileERB/default.rb
rhodes-2.0.0.beta11 lib/build/compileERB/default.rb
rhodes-2.0.0.beta10 lib/build/compileERB/default.rb
rhodes-2.0.0.beta9 lib/build/compileERB/default.rb
rhodes-2.0.0.beta8 lib/build/compileERB/default.rb
rhodes-2.0.0.beta7 lib/build/compileERB/default.rb
rhodes-2.0.0.beta6 lib/build/compileERB/default.rb
rhodes-2.0.0.beta4 lib/build/compileERB/default.rb
rhodes-2.0.0.beta3 lib/build/compileERB/default.rb
rhodes-2.0.0.beta2 lib/build/compileERB/default.rb
rhodes-2.0.0.beta1 lib/build/compileERB/default.rb