Sha256: 4d48a667e9bf853f8ede9ede2289f9e7f3af16dbc836ea1fa353f95ff29e00fe

Contents?: true

Size: 690 Bytes

Versions: 75

Compression:

Stored size: 690 Bytes

Contents

require 'find'

fselfname = File.expand_path(__FILE__)
dir = File.dirname(fselfname)

ext = ".rb"

startdir = Dir.pwd
Dir.chdir dir

Find.find(dir) do |path| 
  if File.extname(path) == ext && path != fselfname
    begin
        relPath = path[dir.length+1,path.length - dir.length]
	    seq = RubyVM::InstructionSequence.compile_file(relPath)
	    arr = seq.to_a
    	
	    newName = File.basename(path).sub('.rb','.iseq')
	    fName = File.join(File.dirname(path), newName)
	    fseq = File.new(fName, "w")
    	
	    Marshal.dump(arr,fseq)
    	
	    fseq.close()
	rescue Exception => e
	    puts 'rb compilation failed: ' + path
	    raise
	end 
	    
  end
end

Dir.chdir startdir			  

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
rhodes-2.4.0 lib/build/compileRB/compileRB.rb
rhodes-2.4.0.beta.2 lib/build/compileRB/compileRB.rb
rhodes-2.4.0.beta.1 lib/build/compileRB/compileRB.rb
rhodes-2.3.2 lib/build/compileRB/compileRB.rb
rhodes-2.3.2.beta.2 lib/build/compileRB/compileRB.rb
rhodes-2.3.2.beta.1 lib/build/compileRB/compileRB.rb
rhodes-2.3.1 lib/build/compileRB/compileRB.rb
rhodes-2.3.1.beta.1 lib/build/compileRB/compileRB.rb
rhodes-2.3.0 lib/build/compileRB/compileRB.rb
rhodes-2.3.0.beta.3 lib/build/compileRB/compileRB.rb
rhodes-2.3.0.beta.2 lib/build/compileRB/compileRB.rb
rhodes-2.3.0.beta.1 lib/build/compileRB/compileRB.rb
rhodes-2.2.6 lib/build/compileRB/compileRB.rb
rhodes-2.2.6.beta.1 lib/build/compileRB/compileRB.rb
rhodes-2.2.5 lib/build/compileRB/compileRB.rb
rhodes-2.2.5.beta.3 lib/build/compileRB/compileRB.rb
rhodes-2.2.5.beta.2 lib/build/compileRB/compileRB.rb
rhodes-2.2.5.beta.1 lib/build/compileRB/compileRB.rb
rhodes-2.2.4.beta.1 lib/build/compileRB/compileRB.rb
rhodes-2.2.3 lib/build/compileRB/compileRB.rb