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

Fix off-by-one bug in show_tasks width-computation

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@5911 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2007-01-12 17:33:51 +00:00
parent 1b8d19ddd4
commit 8ffe977ff2
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
*SVN*
* Fix off-by-one bug in show_tasks width-computation [NeilW]
*1.3.1* (January 5, 2007)
* Fix connection problems when using gateways [Ezra Zygmuntowicz]

View file

@ -26,7 +26,7 @@ task :show_tasks do
puts "Available tasks"
puts "---------------"
each_task do |info|
wrap_length = 80 - info[:longest]
wrap_length = 80 - info[:longest] - 1
lines = info[:desc].gsub(/(.{1,#{wrap_length}})(?:\s|\Z)+/, "\\1\n").split(/\n/)
puts "%-#{info[:longest]}s %s" % [info[:task], lines.shift]
puts "%#{info[:longest]}s %s" % ["", lines.shift] until lines.empty?