mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
21 lines
477 B
Ruby
21 lines
477 B
Ruby
require "rails/generators"
|
|
|
|
module Rails
|
|
module Command
|
|
class GenerateCommand < Base
|
|
def help # :nodoc:
|
|
Rails::Generators.help self.class.command_name
|
|
end
|
|
|
|
def perform(*)
|
|
generator = args.shift
|
|
return help unless generator
|
|
|
|
require_application_and_environment!
|
|
load_generators
|
|
|
|
Rails::Generators.invoke generator, args, behavior: :invoke, destination_root: Rails::Command.root
|
|
end
|
|
end
|
|
end
|
|
end
|