Sha256: d01576287bb9e2d23888a9c7c0a1d32ea6783e2e81bfb30c93b25f9012dbbf1c
Contents?: true
Size: 1.87 KB
Versions: 14
Compression:
Stored size: 1.87 KB
Contents
#!/usr/bin/env ruby require File.join(File.dirname(__FILE__), '..', 'config', 'boot') $LOAD_PATH << File.join(File.dirname(__FILE__), '..') require 'rubygems' gem 'rails' require 'ruby_version_check' Signal.trap("INT") { puts; exit } require 'lib/spree' if ARGV.any? { |arg| %w(--version -v).any? { |flag| arg == flag } } puts "Spree #{Spree::Version}" exit 0 end app_path = ARGV.first # configuration must be set or we get uninitialized class variable @@configuration (introduced w/rails 2.1) require 'spree/initializer' Rails.configuration = Spree::Configuration.new require 'rails_generator' require 'rails_generator/scripts/generate' class Rails::Generator::Base def self.use_application_sources! reset_sources sources << Rails::Generator::PathSource.new(:builtin, "#{File.dirname(__FILE__)}/../lib/generators") end def add_general_options!(opt) opt.separator '' opt.separator 'Spree Info:' opt.on('-v', '--version', 'Show the Spree version number and quit.') opt.on('-h', '--help', 'Show this help message and quit.') { |v| options[:help] = v } opt.separator '' opt.separator 'General Options:' opt.on('-p', '--pretend', 'Run but do not make any changes.') { |v| options[:pretend] = v } opt.on('-f', '--force', 'Overwrite files that already exist.') { options[:collision] = :force } opt.on('-s', '--skip', 'Skip files that already exist.') { options[:collision] = :skip } opt.on('-q', '--quiet', 'Suppress normal output.') { |v| options[:quiet] = v } opt.on('-t', '--backtrace', 'Debugging: show backtrace on errors.') { |v| options[:backtrace] = v } opt.on('-m', '--demo', 'Creates special mongrel configuration needed for demo server (unlikely you will need this).') { |v| options[:demo] = v } end end Rails::Generator::Base.use_application_sources! Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'instance')
Version data entries
14 entries across 14 versions & 2 rubygems