Method: Kernel#eval_compiled_file

Defined in:
lib/framework/rhoframework.rb

#eval_compiled_file(fname, bind) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/framework/rhoframework.rb', line 33

def eval_compiled_file(fname, bind)
    require 'erb'
    
    rhosim_platform = Rho::RhoConfig.rhosim_platform
    if rhosim_platform && rhosim_platform.length() > 0 
        dot = fname.rindex('.')
        
        if dot
            fname1 = fname.dup
               fname1.insert(dot, "." + rhosim_platform )
        else
            fname1 = fname + "."  + rhosim_platform
        end
        
           fname = fname1 if File.exist?(fname1)	            
    end

    puts "eval_compiled_file : #{fname}"
    
    strFile = IO.read(fname)
    code = ERB.new(strFile).src
    
 eval(code, bind)
end