~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to lib/rexml/text.rb

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-04 16:01:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070904160117-i15zckg2nhxe9fyw
Tags: 1.9.0+20070830-2ubuntu1
* Sync from Debian; remaining changes:
  - Add -g to CFLAGS.
* Fixes build failure on ia64.
* Fixes build failure with gcc-4.2 on lpia.
* Robustify check for target_os, fixing build failure on lpia.
* Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
      return new_string
212
212
    end
213
213
 
 
214
    # == DEPRECATED
 
215
    # See REXML::Formatters
 
216
    #
214
217
    def write( writer, indent=-1, transitive=false, ie_hack=false ) 
215
 
      s = to_s()
216
 
      if not (@parent and @parent.whitespace) then
217
 
        s = wrap(s, 60, false) if @parent and @parent.context[:wordwrap] == :all
218
 
        if @parent and not @parent.context[:indentstyle].nil? and indent > 0 and s.count("\n") > 0
219
 
          s = indent_text(s, indent, @parent.context[:indentstyle], false)
 
218
      Kernel.warn("#{self.class.name}.write is deprecated.  See REXML::Formatters")
 
219
      formatter = if indent > -1
 
220
          REXML::Formatters::Pretty.new( indent )
 
221
        else
 
222
          REXML::Formatters::Default.new
220
223
        end
221
 
        s.squeeze!(" \n\t") if @parent and !@parent.whitespace
222
 
      end
223
 
      writer << s
 
224
      formatter.write( self, writer )
224
225
    end
225
226
 
226
227
    # FIXME