class Run::Context

Defined in:

run/context.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : Symbol, command : String, args : Array(String), **attrs) #

Initializes a new context with the attributes.

For more information about the arguments, see #set.


[View source]
def self.new(command : String, args : Array(String), **attrs) #

Initializes a new context with the attributes.

For more information about the arguments, see #set.


[View source]
def self.new(command : String, **attrs) #

Initializes a new context with the attributes.

For more information about the arguments, see #set.


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

Initializes a new context with the attributes.

For more information about the arguments, see #set.


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

Initializes a new context with the attributes.

For more information about the arguments, see #set.


[View source]

Instance Method Detail

def abort_on_error(value : Bool | Nil) : Context #

Sets the abort_on_error attribute to false and returns self.


[View source]
def abort_on_error! : Context #

Sets the abort_on_error attribute to true and returns self.


[View source]
def abort_signal(value : Signal | Nil) #

Sets the abort_signal attribute and returns self.


[View source]
def abort_signal : Signal #

Returns the combined value of the abort_signal attribute in the nested context.


[View source]
def abort_signal=(value : Signal | Nil) #

Sets the abort_signal attribute.


[View source]
def abort_timeout(value : Timeout::Arg | Nil) #

Sets the abort_timeout attribute and returns self.


[View source]
def abort_timeout : Timeout::Arg #

Returns the combined value of the abort_timeout attribute in the nested context.


[View source]
def abort_timeout=(value : Timeout::Arg | Nil) #

Sets the abort_timeout attribute.


[View source]
def aborts_on_error? : Bool #

Returns the combined value of the abort_on_error attribute in the context.


[View source]
def args(value : Array(String) | Nil) #

Sets the args attribute and returns self.


[View source]
def args : Array(String) #

Returns the combined value of the args attribute in the nested context.


[View source]
def args=(value : Array(String) | Nil) #

Sets the args attribute.


[View source]
def chdir(value : String | Nil) #

Sets the chdir attribute and returns self.


[View source]
def chdir : String #

Returns the combined value of the chdir attribute in the nested context.


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

Sets the chdir attribute.


[View source]
def clear_env(value : Bool | Nil) : Context #

Sets the clear_env attribute to false and returns self.


[View source]
def clear_env! : Context #

Sets the clear_env attribute to true and returns self.


[View source]
def clears_env? : Bool #

Returns the combined value of the clear_env attribute in the context.


[View source]
def command(value : String | Nil) #

Sets the command attribute and returns self.


[View source]
def command : String #

Returns the combined value of the command attribute in the nested context.


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

Sets the command attribute.


[View source]
def dup #

Copies this context.


[View source]
def env(value : Hash(String, String) | Nil) #

Sets the env attribute and returns self.


[View source]
def env : Hash(String, String) #

Returns the combined value of the env attribute in the nested context.


[View source]
def env=(value : Hash(String, String) | Nil) #

Sets the env attribute.


[View source]
def error(value : Io::Arg | Nil) #

Sets the error attribute and returns self.


[View source]
def error : Io::Arg #

Returns the combined value of the error attribute in the nested context.


[View source]
def error=(value : Io::Arg | Nil) #

Sets the error attribute.


[View source]
def input(value : Io::Arg | Nil) #

Sets the input attribute and returns self.


[View source]
def input : Io::Arg #

Returns the combined value of the input attribute in the nested context.


[View source]
def input=(value : Io::Arg | Nil) #

Sets the input attribute.


[View source]
def name(value : String | Nil) #

Sets the name attribute and returns self.


[View source]
def name : Union(String, Nil) #

Returns the combined value of the name attribute in the nested context.


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

Sets the name attribute.


[View source]
def not_parallel! : Context #

Sets the parallel attribute to false and returns self.


[View source]
def not_shell! : Context #

Sets the shell attribute to false and returns self.


[View source]
def not_to_aborts_on_error! : Context #

Sets the abort_on_error attribute to false and returns self.


[View source]
def not_to_clears_env! : Context #

Sets the clear_env attribute to false and returns self.


[View source]
def not_to_shows_command! : Context #

Sets the show_command attribute to false and returns self.


[View source]
def not_to_shows_dir! : Context #

Sets the show_dir attribute to false and returns self.


[View source]
def output(value : Io::Arg | Nil) #

Sets the output attribute and returns self.


[View source]
def output : Io::Arg #

Returns the combined value of the output attribute in the nested context.


[View source]
def output=(value : Io::Arg | Nil) #

Sets the output attribute.


[View source]
def parallel(value : Bool | Nil) : Context #

Sets the parallel attribute to false and returns self.


[View source]
def parallel! : Context #

Sets the parallel attribute to true and returns self.


[View source]
def parallel? : Bool #

Returns the combined value of the parallel attribute in the context.


[View source]
def parent(value : Context | Nil) #

Sets the parent attribute and returns self.


[View source]
def parent #

Returns this parent context.

It raises an exception if this context is the root.


[View source]
def parent=(value : Context | Nil) #

Sets the parent attribute.


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

Returns this parent context.


[View source]
def root : Context #

Returns the root context in the nested contexts.


[View source]
def root? #

Tests if this context is the root in the nested contexts.


[View source]
def self_abort_on_error : Bool | Nil #

Returns the abort_on_error attribute.


[View source]
def self_abort_signal : Signal | Nil #

Returns the abort_signal attribute.


[View source]
def self_abort_timeout : Timeout::Arg | Nil #

Returns the abort_timeout attribute.


[View source]
def self_args : Array(String) | Nil #

Returns the args attribute.


[View source]
def self_chdir : String | Nil #

Returns the chdir attribute.


[View source]
def self_clear_env : Bool | Nil #

Returns the clear_env attribute.


[View source]
def self_command : String | Nil #

Returns the command attribute.


[View source]
def self_env : Hash(String, String) | Nil #

Returns the env attribute.


[View source]
def self_error : Io::Arg | Nil #

Returns the error attribute.


[View source]
def self_input : Io::Arg | Nil #

Returns the input attribute.


[View source]
def self_name : String | Nil #

Returns the name attribute.


[View source]
def self_output : Io::Arg | Nil #

Returns the output attribute.


[View source]
def self_parallel : Bool | Nil #

Returns the parallel attribute.


[View source]
def self_shell : Bool | Nil #

Returns the shell attribute.


[View source]
def self_show_command : Bool | Nil #

Returns the show_command attribute.


[View source]
def self_show_dir : Bool | Nil #

Returns the show_dir attribute.


[View source]
def set(name : String | Nil = nil, command : String | Nil = nil, args : Array(String) | Nil = nil, parent : Context | Nil = nil, env : Hash(String, String) | Nil = nil, clear_env : Bool | Nil = nil, shell : Bool | Nil = nil, input : Io::Arg = nil, output : Io::Arg = nil, error : Io::Arg = nil, chdir : String | Nil = nil, show_dir : Bool | Nil = nil, show_command : Bool | Nil = nil, abort_signal : Signal | Nil = nil, parallel : Bool | Nil = nil, abort_on_error : Bool | Nil = nil, abort_timeout : Timeout::Arg = nil, current_dir : String | Nil = nil) #

Sets the attributes and returns self.

If nil is specified, the attribute is not changed.

For more information about the context attributes, see Wiki.


[View source]
def shell(value : Bool | Nil) : Context #

Sets the shell attribute to false and returns self.


[View source]
def shell! : Context #

Sets the shell attribute to true and returns self.


[View source]
def shell? : Bool #

Returns the combined value of the shell attribute in the context.


[View source]
def show_command(value : Bool | Nil) : Context #

Sets the show_command attribute to false and returns self.


[View source]
def show_command! : Context #

Sets the show_command attribute to true and returns self.


[View source]
def show_dir(value : Bool | Nil) : Context #

Sets the show_dir attribute to false and returns self.


[View source]
def show_dir! : Context #

Sets the show_dir attribute to true and returns self.


[View source]
def shows_command? : Bool #

Returns the combined value of the show_command attribute in the context.


[View source]
def shows_dir? : Bool #

Returns the combined value of the show_dir attribute in the context.


[View source]