Skip to content

Always return a result object #1

@Nowaker

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.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions