1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Use a default line length in help text if line length is otherwise too small (closes #10911)

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@8920 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2008-02-21 04:44:09 +00:00
parent 208581ae56
commit 1ace9cb2d5
2 changed files with 5 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Use a default line length in help text if line length is otherwise too small [Jamis Buck]
* Fix incorrect reference to the 'setup' task in task documentation [rajeshduggal]
* Don't try to kill the spawner process on deploy:stop if no spawner process exists [Jamis Buck]

View file

@ -84,7 +84,9 @@ module Capistrano
text.each_line do |line|
indentation = line[/^\s+/] || ""
indentation_size = indentation.split(//).inject(0) { |c,s| c + (s[0] == ?\t ? 8 : 1) }
lines = line.strip.gsub(/(.{1,#{output_columns - indentation_size}})(?:\s+|\Z)/, "\\1\n").split(/\n/)
line_length = output_columns - indentation_size
line_length = MIN_MAX_LEN if line_length < MIN_MAX_LEN
lines = line.strip.gsub(/(.{1,#{line_length}})(?:\s+|\Z)/, "\\1\n").split(/\n/)
if lines.empty?
formatted << "\n"
else