Sha256: ed80deb5f9d45ec8bc7205f3233527caf57e0149c931dbe70cea7028e75dae38

Contents?: true

Size: 603 Bytes

Versions: 1

Compression:

Stored size: 603 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rrjj-0.0.1 lib/ro_commands/rails_base.rb