Class: R10K::Util::Subprocess::Runner::Windows Private
- Inherits:
-
R10K::Util::Subprocess::Runner
- Object
- R10K::Util::Subprocess::Runner
- R10K::Util::Subprocess::Runner::Windows
- Defined in:
- lib/r10k/util/subprocess/runner/windows.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Run processes on Windows.
This implementation relies on Open3.capture3 to run commands and capture results. In contrast to the POSIX runner this cannot be used in an asynchronous manner as-is; implementing that will probably mean launching a thread and invoking #capture3 in that thread.
Instance Attribute Summary
Attributes inherited from R10K::Util::Subprocess::Runner
Instance Method Summary collapse
-
#initialize(argv) ⇒ Windows
constructor
private
A new instance of Windows.
- #run ⇒ Object private
Constructor Details
#initialize(argv) ⇒ Windows
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Windows.
12 13 14 |
# File 'lib/r10k/util/subprocess/runner/windows.rb', line 12 def initialize(argv) @argv = argv end |
Instance Method Details
#run ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 19 20 21 22 |
# File 'lib/r10k/util/subprocess/runner/windows.rb', line 16 def run spawn_opts = @cwd ? {:chdir => @cwd} : {} stdout, stderr, status = Open3.capture3(*@argv, spawn_opts) @result = R10K::Util::Subprocess::Result.new(@argv, stdout, stderr, status.exitstatus) rescue Errno::ENOENT, Errno::EACCES => e @result = R10K::Util::Subprocess::Result.new(@argv, '', e., 255) end |