class Amber::CLI::MainCommand::Routes

Defined in:

amber/cli/commands/routes.cr

Constant Summary

ACTION_MAPPING = {"get" => ["index", "show", "new", "edit"], "post" => ["create"], "patch" => ["update"], "put" => ["update"], "delete" => ["destroy"]}
LABELS = ["Verb", "Controller", "Action", "Pipeline", "Scope", "URI Pattern"]
PIPE_SCOPE_REGEX = /(routes)\s+\:(\w+)(?:,\s+\"([^\"]+)\")?/
RESOURCE_ROUTE_REGEX = /(\w+)\s+\"([^\"]+)\",\s*([\w:]+)(?:,\s*(\w+)\:\s*\[([^\]]+)\])?/
VERB_ROUTE_REGEX = /(\w+)\s+\"([^\"]+)\",\s*([\w:]+),\s*:(\w+)/
WEBSOCKET_ROUTE_REGEX = /(websocket)\s+\"([^\"]+)\",\s*([\w:]+)/

Class Method Summary

Instance Method Summary

Instance methods inherited from class Command

after_exit(name, proc : Proc(Command, Cli::Exit, Nil))
after_exit(proc : Proc(Command, Cli::Exit, Nil))
after_exit(name = nil, &block : Command, Cli::Exit -> Nil)
after_exit
, after_initialize(name, proc : Proc(Command, Nil))
after_initialize(proc : Proc(Command, Nil))
after_initialize(name = nil, &block : Command -> Nil)
after_initialize
, around_exit(name, proc : Proc(Command, Cli::Exit, Nil))
around_exit(proc : Proc(Command, Cli::Exit, Nil))
around_exit(name = nil, &block : Command, Cli::Exit -> Nil)
around_exit
, around_initialize(name, proc : Proc(Command, Nil))
around_initialize(proc : Proc(Command, Nil))
around_initialize(name = nil, &block : Command -> Nil)
around_initialize
, before_exit(name, proc : Proc(Command, Cli::Exit, Nil))
before_exit(proc : Proc(Command, Cli::Exit, Nil))
before_exit(name = nil, &block : Command, Cli::Exit -> Nil)
before_exit
, before_initialize(name, proc : Proc(Command, Nil))
before_initialize(proc : Proc(Command, Nil))
before_initialize(name = nil, &block : Command -> Nil)
before_initialize
, callback_results : Hash(String, Callback::ResultSet(Nil)) callback_results, callback_results_for_exit callback_results_for_exit, callback_results_for_initialize callback_results_for_initialize, error(msg) error, info(msg) info, on_exit(name, proc : Proc(Command, Cli::Exit, Nil))
on_exit(proc : Proc(Command, Cli::Exit, Nil))
on_exit(name = nil, &block : Command, Cli::Exit -> Nil)
on_exit
, on_initialize(name, proc : Proc(Command, Nil))
on_initialize(proc : Proc(Command, Nil))
on_initialize(name = nil, &block : Command -> Nil)
on_initialize
, run_callbacks_for_exit(*args, &) run_callbacks_for_exit, run_callbacks_for_initialize(*args, &) run_callbacks_for_initialize

Class methods inherited from class Command

after_exit(name, proc : Proc(Command, Cli::Exit, Nil))
after_exit(proc : Proc(Command, Cli::Exit, Nil))
after_exit(name = nil, &block : Command, Cli::Exit -> Nil)
after_exit
, after_initialize(name, proc : Proc(Command, Nil))
after_initialize(proc : Proc(Command, Nil))
after_initialize(name = nil, &block : Command -> Nil)
after_initialize
, around_exit(name, proc : Proc(Command, Cli::Exit, Nil))
around_exit(proc : Proc(Command, Cli::Exit, Nil))
around_exit(name = nil, &block : Command, Cli::Exit -> Nil)
around_exit
, around_initialize(name, proc : Proc(Command, Nil))
around_initialize(proc : Proc(Command, Nil))
around_initialize(name = nil, &block : Command -> Nil)
around_initialize
, before_exit(name, proc : Proc(Command, Cli::Exit, Nil))
before_exit(proc : Proc(Command, Cli::Exit, Nil))
before_exit(name = nil, &block : Command, Cli::Exit -> Nil)
before_exit
, before_initialize(name, proc : Proc(Command, Nil))
before_initialize(proc : Proc(Command, Nil))
before_initialize(name = nil, &block : Command -> Nil)
before_initialize
, on_exit(name, proc : Proc(Command, Cli::Exit, Nil))
on_exit(proc : Proc(Command, Cli::Exit, Nil))
on_exit(name = nil, &block : Command, Cli::Exit -> Nil)
on_exit
, on_initialize(name, proc : Proc(Command, Nil))
on_initialize(proc : Proc(Command, Nil))
on_initialize(name = nil, &block : Command -> Nil)
on_initialize
, run(argv : Array(String) = [] of ::String, &block : Command -> ) run

Class Method Detail

def self.after_exit(name, proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.after_exit(proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.after_exit(name = nil, &block : Amber::CLI::MainCommand::Routes, Cli::Exit -> Nil) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.after_initialize(name, proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.after_initialize(proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.after_initialize(name = nil, &block : Amber::CLI::MainCommand::Routes -> Nil) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.around_exit(name, proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.around_exit(proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.around_exit(name = nil, &block : Amber::CLI::MainCommand::Routes, Cli::Exit -> Nil) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.around_initialize(name, proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.around_initialize(proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.around_initialize(name = nil, &block : Amber::CLI::MainCommand::Routes -> Nil) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.before_exit(name, proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.before_exit(proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.before_exit(name = nil, &block : Amber::CLI::MainCommand::Routes, Cli::Exit -> Nil) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.before_initialize(name, proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.before_initialize(proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.before_initialize(name = nil, &block : Amber::CLI::MainCommand::Routes -> Nil) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.on_exit(name, proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.on_exit(proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.on_exit(name = nil, &block : Amber::CLI::MainCommand::Routes, Cli::Exit -> Nil) #

Registers a callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def self.on_initialize(name, proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.on_initialize(proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.on_initialize(name = nil, &block : Amber::CLI::MainCommand::Routes -> Nil) #

Registers a callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def self.run(argv : Array(String) = [] of ::String, &block : Amber::CLI::MainCommand::Routes -> ) #

Run the command.

This method is automatically defined by the Crystal CLI library.


def self.run(argv : Array(String)) #

Run the command.

This method is automatically defined by the Crystal CLI library.


[View source]
def self.run(previous : Cli::CommandBase, argv : Array(String) = [] of ::String) #

Run the command.

This method is automatically defined by the Crystal CLI library.


[View source]
def self.run #

Run the command.

This method is automatically defined by the Crystal CLI library.


[View source]

Instance Method Detail

def after_exit(name, proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def after_exit(proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def after_exit(name = nil, &block : Amber::CLI::MainCommand::Routes, Cli::Exit -> Nil) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def after_initialize(name, proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def after_initialize(proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def after_initialize(name = nil, &block : Amber::CLI::MainCommand::Routes -> Nil) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def around_exit(name, proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def around_exit(proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def around_exit(name = nil, &block : Amber::CLI::MainCommand::Routes, Cli::Exit -> Nil) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def around_initialize(name, proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def around_initialize(proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def around_initialize(name = nil, &block : Amber::CLI::MainCommand::Routes -> Nil) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def before_exit(name, proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def before_exit(proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def before_exit(name = nil, &block : Amber::CLI::MainCommand::Routes, Cli::Exit -> Nil) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def before_initialize(name, proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def before_initialize(proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def before_initialize(name = nil, &block : Amber::CLI::MainCommand::Routes -> Nil) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def build_route(verb, uri_pattern, controller, action, pipeline, scope = "") #

[View source]
def callback_results_for_exit #

Returns callback results of the exit group.

This method is automatically defined by the Crystal Callback library.


def callback_results_for_initialize #

Returns callback results of the initialize group.

This method is automatically defined by the Crystal Callback library.


def current_pipe : String | Nil #

[View source]
def current_pipe=(current_pipe : String | Nil) #

[View source]
def current_scope : String | Nil #

[View source]
def current_scope=(current_scope : String | Nil) #

[View source]
def on_exit(name, proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def on_exit(proc : Proc(Amber::CLI::MainCommand::Routes, Cli::Exit, Nil)) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def on_exit(name = nil, &block : Amber::CLI::MainCommand::Routes, Cli::Exit -> Nil) #

Registers a dynamic callback for the exit group.

This method is automatically defined by the Crystal Callback library.


def on_initialize(name, proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def on_initialize(proc : Proc(Amber::CLI::MainCommand::Routes, Nil)) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def on_initialize(name = nil, &block : Amber::CLI::MainCommand::Routes -> Nil) #

Registers a dynamic callback for the initialize group.

This method is automatically defined by the Crystal Callback library.


def routes : Array(Hash(String, String)) #

[View source]
def run #
Description copied from class Cli::CommandBase

Runs the command.

This method is an entrypoint for running a command.

Subclasses must override this method.


[View source]
def run_callbacks_for_exit(*args, &) #

Invokes all callbacks of the exit group.

This method is automatically defined by the Crystal Callback library.


def run_callbacks_for_initialize(*args, &) #

Invokes all callbacks of the initialize group.

This method is automatically defined by the Crystal Callback library.