Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8920

Show
Ignore:
Timestamp:
02/21/08 04:44:09 (8 months ago)
Author:
minam
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/capistrano/CHANGELOG

    r8919 r8920  
    11*SVN* 
     2 
     3* Use a default line length in help text if line length is otherwise too small [Jamis Buck] 
    24 
    35* Fix incorrect reference to the 'setup' task in task documentation [rajeshduggal] 
  • tools/capistrano/lib/capistrano/cli/help.rb

    r6490 r8920  
    8585          indentation = line[/^\s+/] || "" 
    8686          indentation_size = indentation.split(//).inject(0) { |c,s| c + (s[0] == ?\t ? 8 : 1) } 
    87           lines = line.strip.gsub(/(.{1,#{output_columns - indentation_size}})(?:\s+|\Z)/, "\\1\n").split(/\n/) 
     87          line_length = output_columns - indentation_size 
     88          line_length = MIN_MAX_LEN if line_length < MIN_MAX_LEN 
     89          lines = line.strip.gsub(/(.{1,#{line_length}})(?:\s+|\Z)/, "\\1\n").split(/\n/) 
    8890          if lines.empty? 
    8991            formatted << "\n"