You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The context is a main concept in this library. A context has several attributes, command names, arguments, working directories..., etc.
Contexts can be nested. For example, you can separately configure a base directory and relative directories to the base directory.
cmd =Run::Command.new(chdir:"/path/to/base")
cmd.run "pwd", chdir:"relative"# => prints "/path/to/base/relative"
cmd.run "pwd", chdir:"../sibling"# => prints "/path/to/sibling"
cmd.run "pwd", chdir:"/path/to/absolute"# => prints "/path/to/absolute"
You can set nested contexts using command groups, ad infinitum.
cg =Run::CommandGroup.new(chdir:"/path/to/base") do |g|
g.group(chdir:"foo") do |g|
g.group(chdir:"bar") do |g|
g.group(chdir:"baz") do |g|
# ...endendendend