class Semverve::DocsPublisher::Shell
Small command runner used by the publisher.
Public Instance Methods
# File lib/semverve/docs_publisher.rb, line 40 def capture(command, chdir: nil) run(command, chdir: chdir) end
Captures a commandโs standard output and raises when it fails.
@param [Array<String>] command @param [String, nil] chdir
@return [String]
Source
# File lib/semverve/docs_publisher.rb, line 26 def run(command, chdir: nil) stdout, stderr, status = capture_command(command, chdir: chdir) return stdout if status.success? raise Error, "Command failed: #{command.join(" ")}\n#{stderr}" end
Runs a command and raises when it fails.
@param [Array<String>] command @param [String, nil] chdir
@return [String]
# File lib/semverve/docs_publisher.rb, line 51 def success?(command, chdir: nil) _stdout, _stderr, status = capture_command(command, chdir: chdir) status.success? end
Whether a command exits successfully.
@param [Array<String>] command @param [String, nil] chdir
@return [Boolean]