Skip to content

Commit

Permalink
Merge pull request #27 from Shopify/work_with_ruby_2.5
Browse files Browse the repository at this point in the history
Fix StdoutRouter for ruby 2.5
  • Loading branch information
Lisa Ugray committed Apr 9, 2018
2 parents 035ad3a + ba28872 commit 67b8679
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions lib/cli/ui/stdout_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ def initialize(stream, name)
end

def write(*args)
if auto_frame_inset?
str = args[0].dup # unfreeze
str = str.force_encoding(Encoding::UTF_8)
str = apply_line_prefix(str, CLI::UI::Frame.prefix)
args[0] = str
else
@pending_newline = false
args = args.map do |str|
if auto_frame_inset?
str = str.dup # unfreeze
str = str.force_encoding(Encoding::UTF_8)
apply_line_prefix(str, CLI::UI::Frame.prefix)
else
@pending_newline = false
str
end
end

hook = Thread.current[:cliui_output_hook]
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/ui/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module CLI
module UI
VERSION = "1.1.0"
VERSION = "1.1.1"
end
end

0 comments on commit 67b8679

Please sign in to comment.