#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' if ARGV[0] =~ /((svc)|Service)/i require 'rubygems' gem 'rails' # find the path to RAILS rails_gem = Gem.cache.search('rails').last RAILS = rails_gem.full_gem_path # find the path to APPCELERATOR appcelerator_gem = Gem.cache.search('appcelerator').last APPCELERATOR = appcelerator_gem.full_gem_path require RAILS + '/lib/rails_generator' require 'rails_generator/scripts/generate' path = APPCELERATOR Rails::Generator::Base.sources << Rails::Generator::PathSource.new('', path) Rails::Generator::Scripts::Generate.new.run(ARGV, {:generator => 'service', :source_root => path, :source => path}) else require 'commands/generate' end