Sha256: 067d248f1ea498f650ca2ae2b67843b26b19d77c62625486ddf743f242927d71

Contents?: true

Size: 1.07 KB

Versions: 30

Compression:

Stored size: 1.07 KB

Contents

require 'rails/version'

if ['--version', '-v'].include?(ARGV.first)
  puts "Rails #{Rails::VERSION::STRING}"
  exit(0)
end

if ARGV.first != "new"
  ARGV[0] = "--help"
else
  ARGV.shift
  unless ARGV.delete("--no-rc")
    customrc = ARGV.index{ |x| x.include?("--rc=") }
    railsrc = if customrc
                File.expand_path(ARGV.delete_at(customrc).gsub(/--rc=/, ""))
              else
                File.join(File.expand_path("~"), '.railsrc')
              end
    if File.exist?(railsrc)
      extra_args_string = File.read(railsrc)
      extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
      puts "Using #{extra_args.join(" ")} from #{railsrc}"
      ARGV.insert(1, *extra_args)
    end
  end
end

require 'rails/generators'
require 'rails/generators/rails/app/app_generator'

module Rails
  module Generators
    class AppGenerator # :nodoc:
      # We want to exit on failure to be kind to other libraries
      # This is only when accessing via CLI
      def self.exit_on_failure?
        true
      end
    end
  end
end

Rails::Generators::AppGenerator.start

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
railties-4.0.13 lib/rails/commands/application.rb
railties-4.0.13.rc1 lib/rails/commands/application.rb
railties-4.0.11.1 lib/rails/commands/application.rb
railties-4.0.12 lib/rails/commands/application.rb
railties-4.0.11 lib/rails/commands/application.rb
railties-4.0.10 lib/rails/commands/application.rb
railties-4.0.10.rc2 lib/rails/commands/application.rb
railties-4.0.10.rc1 lib/rails/commands/application.rb
railties-4.0.9 lib/rails/commands/application.rb
railties-4.0.8 lib/rails/commands/application.rb
railties-4.0.7 lib/rails/commands/application.rb
railties-4.0.6 lib/rails/commands/application.rb
railties-4.0.6.rc3 lib/rails/commands/application.rb
railties-4.0.6.rc2 lib/rails/commands/application.rb
railties-4.0.6.rc1 lib/rails/commands/application.rb
railties-4.0.5 lib/rails/commands/application.rb
railties-4.0.4 lib/rails/commands/application.rb
railties-4.0.4.rc1 lib/rails/commands/application.rb
railties-4.0.3 lib/rails/commands/application.rb
railties-4.0.2 lib/rails/commands/application.rb