blob: f054d4e8532c63241aedbeb7617e9f694a74f8b0 (
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
|
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/generator'
Rails::Generators.builtin.each do |name|
require "generator/generators/#{name}/#{name}_generator"
end
name = ARGV.shift
if klass = Thor::Util.find_by_namespace("rails:generators:#{name}")
klass.start
else
puts "Could not find generator #{name}."
end
|