Skip to content

Commit

Permalink
Change to use truncator for error output handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed May 29, 2016
1 parent 13c86b9 commit c466671
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/tty/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
require 'tty/command/printers/progress'
require 'tty/command/printers/quiet'

require 'tty/command/truncator'

module TTY
class Command
ExecuteError = Class.new(StandardError)
Expand Down
5 changes: 3 additions & 2 deletions lib/tty/command/process_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'tty/command/execute'
require 'tty/command/result'
require 'tty/command/truncator'

module TTY
class Command
Expand Down Expand Up @@ -53,7 +54,7 @@ def handle_timeout(timeout, runtime, pid)
# @api private
def read_streams(cmd, stdout, stderr)
stdout_data = ''
stderr_data = ''
stderr_data = Truncator.new
timeout = cmd.options[:timeout]

stdout_thread = Thread.new do
Expand Down Expand Up @@ -85,7 +86,7 @@ def read_streams(cmd, stdout, stderr)
stderr_thread.raise(TimeoutExceeded)
end
end
[stdout_data, stderr_data]
[stdout_data, stderr_data.read]
end

# @api private
Expand Down

0 comments on commit c466671

Please sign in to comment.