openshift/rhc — pull request #417 by adelton (2013-06-27 09:22:35+00:00)
Title: If the number of columns is zero, do not wrap.

Sometimes HighLine might return non-nil yet zero value. You can reproduce by

# stty columns 0
# rhc cartridges

Addressing

/usr/lib/ruby/gems/1.8/gems/rhc-1.10.1/lib/rhc/core_ext.rb:100:in `textwrap_ansi': can't do {n,m} with n > m: / (RegexpError)
(
# Match substrings that end in whitespace shorter than limit
(?:(?:\e\[\d+(?:;\d+)*[@-~])+.?|.(?:\e\[\d+(?:;\d+)*[@-~])*){1,0}
(?:\s|$) # require the limit to end on whitespace
|
# Match all continguous whitespace strings
(?:(?:\e\[\d+(?:;\d+)*[@-~])+.?|.(?:\e\[\d+(?:;\d+)*[@-~])*)+?
(?:\s|$)
(?:\s+|$)?
)
/
from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.1/lib/rhc/highline_extensions.rb:40:in `say'
from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.1/lib/rhc/commands/cartridge.rb:63:in `list'
from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.1/lib/rhc/highline_extensions.rb:177:in `call'
from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.1/lib/rhc/highline_extensions.rb:177:in `section'
from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.1/lib/rhc/highline_extensions.rb:191:in `paragraph'