Flowdock
method

wrap

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: Formatter

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_9_1_378) is shown here.

These similar methods exist in v2_5_5:

wrap(txt, prefix=@indent, linelen=@width) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rdoc/ri/formatter.rb, line 58
  def wrap(txt, prefix=@indent, linelen=@width)
    return unless txt && !txt.empty?

    work = conv_markup(txt)
    textLen = linelen - prefix.length
    patt = Regexp.new("^(.{0,#{textLen}})[ \n]")
    next_prefix = prefix.tr("^ ", " ")

    res = []

    while work.length > textLen
      if work =~ patt
        res << $1
        work.slice!(0, $&.length)
      else
        res << work.slice!(0, textLen)
      end
    end
    res << work if work.length.nonzero?
    @output.puts(prefix + res.join("\n" + next_prefix))
  end
Register or log in to add new notes.