Class: Dip::Command
- Inherits:
-
Object
- Object
- Dip::Command
- Extended by:
- Forwardable
- Defined in:
- lib/dip/command.rb
Direct Known Subclasses
Dip::Commands::Compose, Dip::Commands::Console::Inject, Dip::Commands::Console::Start, Dip::Commands::DNS::Down, Dip::Commands::DNS::IP, Dip::Commands::DNS::Up, Dip::Commands::List, Dip::Commands::Nginx::Down, Dip::Commands::Nginx::Up, Dip::Commands::Provision, Dip::Commands::Run, Dip::Commands::SSH::Down, Dip::Commands::SSH::Status, Dip::Commands::SSH::Up
Defined Under Namespace
Classes: ExecRunner, SubshellRunner
Class Method Summary collapse
Class Method Details
.shell(cmd, argv = [], subshell: false, **options) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/dip/command.rb', line 25 def shell(cmd, argv = [], subshell: false, **) cmd = Dip.env.interpolate(cmd) argv = argv.map { |arg| Dip.env.interpolate(arg) } puts [Dip.env.vars, cmd, argv].inspect if Dip.debug? runner = subshell ? SubshellRunner : ExecRunner runner.call(cmd, argv, env: Dip.env.vars, **) end |
.subshell(*args, **kwargs) ⇒ Object
35 36 37 38 |
# File 'lib/dip/command.rb', line 35 def subshell(*args, **kwargs) kwargs[:subshell] = true shell(*args, **kwargs) end |