blob: ad3a7936100be6e023621b96db8789d033dd9d13 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
require File.dirname(__FILE__) + '/../lib/ruby_version_check'
Signal.trap("INT") { puts; exit }
require File.dirname(__FILE__) + '/../lib/rails/version'
if %w(--version -v).include? ARGV.first
puts "Rails #{Rails::VERSION::STRING}"
exit(0)
end
if ARGV.size == 0
puts "Please select a generator. Options: foo, bar"
return
else ARGV.size == 1
ARGV << "--help"
end
require File.dirname(__FILE__) + '/../lib/generators'
Rails::Generators.builtin.each do |group, name|
require "generators/#{group}/#{name}/#{name}_generator"
end
name = ARGV.shift
if klass = Thor::Util.find_by_namespace("rails:#{name}")
klass.start
elsif klass = Thor::Util.find_by_namespace(name)
klass.start
else
puts "Could not find generator #{name}."
end
|