aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/commands/generate/generate_command.rb
blob: b381ca85b9b41194bfa57efe92aaf94300451bc9 (plain) (tree)




















                                                                                                          
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