~ubuntu-branches/ubuntu/trusty/jruby/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/ruby/1.8/rexml/formatters/pretty.rb

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Delafond
  • Date: 2009-12-10 12:34:42 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091210123442-df7t1v36qtfkj5df
Tags: 1.4.0-1
* New upstream release.
* Updated watch file.
* Updated copyright file to reflect addition of new third-party jars.

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
      end
126
126
 
127
127
      def wrap(string, width)
128
 
        # Recursivly wrap string at width.
 
128
        # Recursively wrap string at width.
129
129
        return string if string.length <= width
130
130
        place = string.rindex(' ', width) # Position in string with last ' ' before cutoff
131
 
        return string if place.nil? # Copied from 1.9, for JRUBY-2003
 
131
        return string if place.nil?
132
132
        return string[0,place] + "\n" + wrap(string[place+1..-1], width)
133
133
      end
134
134