Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix StdoutRouter for ruby 2.5 #27

Merged
merged 1 commit into from
Apr 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be only for the last arg? or?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, each.

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