Module: Cinnabar::Command::ArrExt
- Defined in:
- lib/cinnabar/cmd_runner.rb
Overview
Instance Method Summary collapse
-
#async_run(env_hash = nil, opts: {}) ⇒ Array(IO, Process::Waiter)
Starts a command asynchronously using this
Array<String>. -
#run(env_hash = nil, opts: {}) ⇒ String?
Executes the command synchronously (blocking) and returns its standard output.
- #run_cmd(env_hash = nil, opts: {}) ⇒ Boolean
Instance Method Details
#async_run(env_hash = nil, opts: {}) ⇒ Array(IO, Process::Waiter)
Note:
self [Array<String>]: The command and its arguments (e.g., %w[printf hello]).
Starts a command asynchronously using this Array<String>.
350 351 352 |
# File 'lib/cinnabar/cmd_runner.rb', line 350 def async_run(env_hash = nil, opts: {}) Cinnabar::Command.async_run(self, env_hash, opts:) end |
#run(env_hash = nil, opts: {}) ⇒ String?
Note:
self [Array<String>]: The command and its arguments (e.g., %w[printf hello]).
Note:
This method blocks until the process completes.
Executes the command synchronously (blocking) and returns its standard output.
326 327 328 |
# File 'lib/cinnabar/cmd_runner.rb', line 326 def run(env_hash = nil, opts: {}) Cinnabar::Command.run(self, env_hash, opts:) end |
#run_cmd(env_hash = nil, opts: {}) ⇒ Boolean
Note:
self [Array<String>]: The command and its arguments (e.g., %w[printf hello]).
378 379 380 |
# File 'lib/cinnabar/cmd_runner.rb', line 378 def run_cmd(env_hash = nil, opts: {}) # rubocop:disable Style/OptionalBooleanParameter Cinnabar::Command.run_cmd(self, env_hash, opts:) end |