lib/framework/rhoframework.rb in rhodes-2.4.1 vs lib/framework/rhoframework.rb in rhodes-3.0.0.beta.1
- old
+ new
@@ -1,16 +1,36 @@
+if defined?( RHO_WP7 )
+ RHO_RB_EXT = '.rb'
+ RHO_ERB_EXT = '_erb' + RHO_RB_EXT
+ RHO_APPS_DIR = 'apps/'
+elsif defined?( RHODES_EMULATOR )
+ RHO_RB_EXT = '.rb'
+ RHO_ERB_EXT = '.erb'
+ RHO_APPS_DIR = ''
+ RHO_EMULATOR_DIR = 'rhosimulator'
+ module Kernel
+ def eval_compiled_file(fname, bind)
+ require 'erb'
+
+ puts "eval_compiled_file : #{fname}"
+ strFile = IO.read(fname)
+ code = ERB.new(strFile).src
+
+ eval(code, bind)
+ end
+ end
+else
+ RHO_RB_EXT = '.iseq'
+ RHO_ERB_EXT = '_erb' + RHO_RB_EXT
+ RHO_APPS_DIR = 'apps/'
+end
+
module Rho
def self.file_exist?(fname)
return File.exist_injar?(fname) if defined? RHO_ME
- if defined? RHO_WP7
- if fname.end_with?('_erb.iseq')
- fname = fname[0,fname.length-9] + '_erb.rb'
- elsif fname.end_with?('.iseq')
- fname = fname[0,fname.length-5] + '.rb'
- end
- end
+ return __rho_exist_in_resources(fname) if defined? RHO_WP7
File.exist?(fname)
end
end
@@ -27,14 +47,10 @@
file_name += '.rb' unless file_name.end_with?('.rb')
orig_require( file_name )
end
def eval_compiled_file(fname, bind)
- if fname.end_with?('_erb.iseq')
- fname = fname[0,fname.length-9] + '_erb.rb'
- end
-
code = IO.read(fname)
eval(code, bind)
end
end
@@ -69,9 +85,13 @@
require 'rho/rho'
require 'rho/render'
require 'rho'
+
+if defined?( RHODES_EMULATOR )
+ require 'debugger'
+end
puts 'RHO loaded'
RHO_FRAMEWORK = Rho::RHO.new
rescue Exception => e
trace_msg = e.backtrace.join("\n")