From ae190eb8bd1ad8a2d728b5fbd39cd2f3aedec24c Mon Sep 17 00:00:00 2001 From: Sebastian Ludwig Date: Thu, 19 Jan 2017 10:54:30 +0100 Subject: [PATCH] Fixed #184 by checking if IO.console is defined. --- lib/twine/cli.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/twine/cli.rb b/lib/twine/cli.rb index 17e682f..f4c9b1a 100644 --- a/lib/twine/cli.rb +++ b/lib/twine/cli.rb @@ -306,8 +306,13 @@ module Twine end end + if IO.console + console_width = IO.console.winsize[1] + else + console_width = 100 + end summary_width += 7 # account for description padding - max_description_width = IO.console.winsize[1] - summary_width + max_description_width = console_width - summary_width merged_lines.map! do |line| if line[0] == ' ' line = word_wrap(line.strip, max_description_width - 2)