aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/generate.rb
blob: 1f742f885302d81c3b53fd618ea6a5d634221e72 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'rails/generators'
require 'active_support/core_ext/object/inclusion'

if ARGV.first.in?([nil, "-h", "--help"])
  Rails::Generators.help 'generate'
  exit
end

name = ARGV.shift

if defined?(ENGINE_ROOT)
  Rails::Generators.invoke name, ARGV, :behavior => :invoke, :destination_root => ENGINE_ROOT
else
  Rails::Generators.invoke name, ARGV, :behavior => :invoke, :destination_root => Rails.root
end