root_path = if defined? ::Rails ::Rails.root else Dir.pwd end env_path = File.join(root_path, "config/environment") if File.exist?(env_path) require env_path end require File.expand_path('../../../config/rrjj', __FILE__) require 'celluloid' module RoCommands class RailsBase < Base protected def template(from, to) template_path = File.join(::Rrjj.lib, 'templates') ctn = ::RoFile.read(File.join(template_path, "#{from}.erb")) result = ERB.new(ctn).result(binding) ::RoFile.write(to, result) end end end