lib/rho/render.rb in rhodes-0.1.3 vs lib/rho/render.rb in rhodes-0.2.0

- old
+ new

@@ -1,12 +1,18 @@ -require 'erb' module Rho class RhoController - def self.renderfile(filename) - ERB.new(IO.read(filename)).result(binding) - end + + def self.renderfile(filename) + if File.extname(filename) == '.iseq' + eval_compiled_file(filename, binding) + else + IO.read(filename) + end + end + def render(view) - ERB.new(IO.read(@request[:modelpath]+view.to_s+'.erb')).result(binding) - end + eval_compiled_file(@request[:modelpath]+view.to_s+'_erb'+'.iseq', binding ) + end + end # RhoController end # Rho \ No newline at end of file