Sha256: c34c14eda2ab0fa7f1fc5b12d96536e2205c20c16d02a241fac71ce07682cbc3
Contents?: true
Size: 804 Bytes
Versions: 1
Compression:
Stored size: 804 Bytes
Contents
require "#{File.dirname(__FILE__)}/through_ryoku" module I18nTranslationGeneratorModule class ErbExecuter def exec_erb(filename) begin # ERB.new(File.read(f)).result (m = Module.new).module_eval <<-EOS class Executer extend ERB::DefMethod include ActionView::Helpers::TranslationHelper include I18nTranslationGeneratorModule::ThroughRyoku nil.class_eval do def method_missing(method, *args, &block); nil; end end def_erb_method 'execute', '#{filename}' end EOS m.const_get('Executer').new.execute { } nil.class_eval do undef :method_missing end rescue => e p e # do nothing end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
amatsuda-i18n_generators-0.4.0 | generators/i18n_translation/lib/erb_executer.rb |