Sha256: 030bc613036988edafd8173f6c4b5257881838e6ba9692998fa5fa231c773563

Contents?: true

Size: 958 Bytes

Versions: 5

Compression:

Stored size: 958 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'rubigen'

ext = (RUBY_PLATFORM =~ /(win32|mingw)/) ? '.bat' : ''
args = ARGV.dup

if %w(-v --version).include? args.first
  require 'rtml/version'
  puts "#{File.basename($0)} #{Rtml::VERSION}"
  exit(0)
end

result = system "rails#{ext} #{args.join(" ")}"
if $?.to_i != 0 || result == false
  puts result || "Internal error executing command: is Rails installed?"
  exit
end

require 'rubigen/scripts/generate'
source = RubiGen::PathSource.new(:application,
  File.join(File.dirname(__FILE__), "../app_generators"))

RubiGen::Base.reset_sources
RubiGen::Base.append_sources source
RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'rtml')

Dir.chdir args.first do
  result = system("rake#{ext} rails:template LOCATION=./rtml_template.rb")
  if $?.to_i != 0 || result == false
    puts result || "Internal error executing command: is Rake installed?"
    exit
  end
  File.delete("rtml_template.rb")
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rtml-2.0.4 bin/rtml
rtml-2.0.3 bin/rtml
rtml-2.0.2 bin/rtml
rtml-2.0.1 bin/rtml
rtml-2.0.0.alpha.1 bin/rtml