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

Version Path
kdmny-spree-0.0.1 bin/spree
spree-0.8.4 bin/spree
spree-0.8.5 bin/spree
spree-0.4.1 bin/spree
spree-0.4.0 bin/spree
spree-0.5.0 bin/spree
spree-0.6.0 bin/spree
spree-0.5.1 bin/spree
spree-0.7.1 bin/spree
spree-0.7.0 bin/spree
spree-0.8.0 bin/spree
spree-0.8.1 bin/spree
spree-0.8.2 bin/spree
spree-0.8.3 bin/spree