mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Document SystemCommand
.
This commit is contained in:
parent
6bd3dbe001
commit
d7be7d038a
@ -9,6 +9,9 @@ require "extend/io"
|
|||||||
require "extend/hash_validator"
|
require "extend/hash_validator"
|
||||||
using HashValidator
|
using HashValidator
|
||||||
|
|
||||||
|
# Make `system_command` available everywhere.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
module Kernel
|
module Kernel
|
||||||
def system_command(*args)
|
def system_command(*args)
|
||||||
SystemCommand.run(*args)
|
SystemCommand.run(*args)
|
||||||
@ -19,6 +22,9 @@ module Kernel
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Class for running sub-processes and capturing their output and exit status.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
class SystemCommand
|
class SystemCommand
|
||||||
include Context
|
include Context
|
||||||
extend Predicable
|
extend Predicable
|
||||||
@ -167,6 +173,7 @@ class SystemCommand
|
|||||||
sources.each(&:close_read)
|
sources.each(&:close_read)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Result containing the output and exit status of a finished sub-process.
|
||||||
class Result
|
class Result
|
||||||
include Context
|
include Context
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user