blob: 0567ab6058d59235cb9b9bbcc7febb4c40b0425a (
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
|
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
Dir[File.dirname(__FILE__) + '/../lib/generator/generators/*/*_generator.rb'].each do |file|
require file
end
name = ARGV.shift
if klass = Thor::Util.find_by_namespace("rails:generators:#{name}")
klass.start
else
puts "Could not find generator #{name}."
end
|