aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/commands/generate/generate_command.rb
blob: aa8dab71b0148be8054bee27e6d62641d483aef5 (plain) (tree)
1
2
3
4
5
6



                          

                                          









                                                      

                  




                                                                                                          
require "rails/generators"

module Rails
  module Command
    class GenerateCommand < Base # :nodoc:
      def help
        Rails::Generators.help self.class.command_name
      end

      def perform(*)
        generator = args.shift
        return help unless generator

        require_application_and_environment!
        load_generators

        ARGV.shift

        Rails::Generators.invoke generator, args, behavior: :invoke, destination_root: Rails::Command.root
      end
    end
  end
end