Skip to content

Always return a result object #1

Description

@Nowaker

Currently:

    if buffer_output
      {
        code: ret_code.exitstatus,
        stderr: buffers[:stderr],
        stdout: buffers[:stdout],
        all: buffers[:all]
      }
    else
      ret_code.exitstatus
    end

Should be:

if buffer_output
  Justrun::Result.new ret_code.exitstatus
else
  Justrun::BufferedResult.new ret_code.exitstatus, stdout, stderr, all
end
class Justrun::BufferedResult
  attr_reader :exit_status, :stdout, :stderr, :all

  def initialize exit_status, stdout, stderr, all
    @exit_status, @stdout, @stderr, @all = exit_status, stdout, stderr, all
  end
end

Don't forget about the specs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions