class method self.invoke

Ruby on Rails 7.1.6

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

self.invoke(full_namespace, args = [], **config)

Receives a namespace, arguments, and the behavior to invoke the command.

Parameters

full_namespace req
args opt = []
config keyrest
Source
# File railties/lib/rails/command.rb, line 62
      def invoke(full_namespace, args = [], **config)
        args = ["--help"] if rails_new_with_no_path?(args)

        full_namespace = full_namespace.to_s
        namespace, command_name = split_namespace(full_namespace)
        command = find_by_namespace(namespace, command_name)

        with_argv(args) do
          if command && command.all_commands[command_name]
            command.perform(command_name, args, config)
          else
            invoke_rake(full_namespace, args, config)
          end
        end
      rescue UnrecognizedCommandError => error
        if error.name == full_namespace && command && command_name == full_namespace
          command.perform("help", [], config)
        else
          puts error.detailed_message
        end
        exit(1)
      end

Defined in railties/lib/rails/command.rb line 62 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Command

Type at least 2 characters to search.

↑↓ navigate · open · esc close