class Run::CommandGroup

Defined in:

run/command_group.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : Symbol, **attrs) #

Initializes a command group with context attributes.

For more information about the arguments, see Context#set.


[View source]
def self.new(**attrs) #

Initializes a command group with context attributes.

For more information about the arguments, see Context#set.


[View source]
def self.new(name : Symbol, **attrs, &) #

Initializes a command group with context attributes and yield a block with self.

For more information about the arguments, see Context#set.


[View source]
def self.new(**attrs, &) #

Initializes a command group with context attributes and yield a block with self.

For more information about the arguments, see Context#set.


[View source]

Instance Method Detail

def <<(command : Command) #

Appends a single command.

It sets self to the appended command as the parent.


[View source]
def <<(group : CommandGroup) #

Appends a command group.

It sets self to the appended group as the parent.


[View source]
def [](*args) #

Delegated to #[] of the result of #commands.


[View source]
def []?(*args) #

Delegated to #[]? of the result of #commands.


[View source]
def children : Array(Run::Command | Run::CommandGroup) #

Returns all the commands and the command groups appended to this group.


[View source]
def command(*nameless, **named) #

Appends and returns a new single command.

It initializes the command's context attributes with the arguments.

For more information about the context attributes, see Context#set.


[View source]
def command_groups : Array(Run::CommandGroup) #

Returns all the command groups appended to this group.


[View source]
def commands : Array(Run::Command) #

Returns all the commands appended to this group.


[View source]
def context : Context #

Returns this context.


[View source]
def group(name : Symbol, **named) #

Appends and returns a new command group.

It initializes the new group's context attributes with the arguments.

For more information about the context attributes, see Context#set.


[View source]
def group(**named) #

Appends and returns a new command group.

It initializes the new group's context attributes with the arguments.

For more information about the context attributes, see Context#set.


[View source]
def group(name : Symbol, &block : CommandGroup -> _) #

Appends and returns a new command group and yield a block with the group.

It initializes the new group's context attributes with the arguments.

For more information about the context attributes, see Context#set.


[View source]
def group(child : CommandGroup, &block : CommandGroup -> _) #

Appends and returns the specified group and yield a block with the group.

It initializes the new group's context attributes with the arguments.

For more information about the context attributes, see Context#set.


[View source]
def group(name : Symbol, **named, &block : CommandGroup -> _) #

Appends and returns a new command group and yield a block with the group.

It initializes the new group's context attributes with the arguments.

For more information about the context attributes, see Context#set.


[View source]
def group(**named, &block : CommandGroup -> _) #

Appends and returns a new command group and yield a block with the group.

It initializes the new group's context attributes with the arguments.

For more information about the context attributes, see Context#set.


[View source]
def parent=(parent : CommandGroup) #

Sets a parent group.


[View source]
def parent? : CommandGroup | Nil #

Returns this parent group.


[View source]
def run(**attrs) #

Runs all commands and command groups under this group.


[View source]