Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 37 lines (31 sloc) 0.858 kb
d236827 @dhh Removed all the default commands in script/* and replaced them with s…
dhh authored
1 require 'rails/version'
a9f3c9d @sikachu Using Object#in? and Object#either? in various places
sikachu authored
2
1d8bf4f @dhh Cant use inclusion in commands/application.rb as the frameworks haven…
dhh authored
3 if ['--version', '-v'].include?(ARGV.first)
d236827 @dhh Removed all the default commands in script/* and replaced them with s…
dhh authored
4 puts "Rails #{Rails::VERSION::STRING}"
5 exit(0)
6 end
7
3cb5375 @madjo ARGV.empty? is useless. If ARGV is empty, ARGV.first != "new" will al…
madjo authored
8 if ARGV.first != "new"
4774680 @mikel Changing command line API from 'rails blog' to 'rails new blog'.
mikel authored
9 ARGV[0] = "--help"
10 else
11 ARGV.shift
7039def @guilleiguaran Read extra args for 'rails new' from ~/.railsrc
guilleiguaran authored
12 railsrc = File.join(File.expand_path("~"), ".railsrc")
13 if File.exist?(railsrc)
14 extra_args_string = File.open(railsrc).read
15 extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
101fb42 @guilleiguaran Print information about .railsrc to users
guilleiguaran authored
16 puts "Using #{extra_args.join(" ")} from #{railsrc}"
33e52d3 @rafaelfranca Explicit options should have precedence over railsrc on the `rails new`
rafaelfranca authored
17 ARGV.insert(1, *extra_args)
7039def @guilleiguaran Read extra args for 'rails new' from ~/.railsrc
guilleiguaran authored
18 end
4774680 @mikel Changing command line API from 'rails blog' to 'rails new blog'.
mikel authored
19 end
20
d236827 @dhh Removed all the default commands in script/* and replaced them with s…
dhh authored
21 require 'rails/generators'
05ec99e @josevalim bin/rails should use the new app generator path.
josevalim authored
22 require 'rails/generators/rails/app/app_generator'
d236827 @dhh Removed all the default commands in script/* and replaced them with s…
dhh authored
23
dcc72b2 @parndt Use Thor's self.exit_on_failure? to exit whenever accessing the gener…
parndt authored
24 module Rails
25 module Generators
521e2ee @frodsan update Rails::Generators docs [ci skip]
frodsan authored
26 class AppGenerator # :nodoc:
dcc72b2 @parndt Use Thor's self.exit_on_failure? to exit whenever accessing the gener…
parndt authored
27 # We want to exit on failure to be kind to other libraries
28 # This is only when accessing via CLI
29 def self.exit_on_failure?
30 true
31 end
32 end
33 end
34 end
35
c54c84b Move ActionMailer generator to AM
Carlhuda authored
36 Rails::Generators::AppGenerator.start
Something went wrong with that request. Please try again.