aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/generate.rb
blob: 1fb2d98834eae1ca2f4e0e96a75b0ec8736b4805 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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

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