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

« back to all changes in this revision

Viewing changes to lib/rexml/node.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:
1
1
require "rexml/parseexception"
 
2
require "rexml/formatters/pretty"
 
3
require "rexml/formatters/default"
2
4
 
3
5
module REXML
4
6
        # Represents a node in the tree.  Nodes are never encountered except as
18
20
                        @parent[ ind - 1 ]
19
21
                end
20
22
 
21
 
                def to_s indent=-1
22
 
                        rv = ""
23
 
                        write rv,indent
24
 
                        rv
 
23
    # indent::
 
24
    #   *DEPRECATED* This parameter is now ignored.  See the formatters in the
 
25
    #   REXML::Formatters package for changing the output style.
 
26
                def to_s indent=nil
 
27
      unless indent.nil?
 
28
        Kernel.warn( "#{self.class.name}.to_s(indent) parameter is deprecated" )
 
29
        f = REXML::Formatters::Pretty.new( indent )
 
30
        f.write( self, rv, indent )
 
31
      else
 
32
        f = REXML::Formatters::Default.new
 
33
        f.write( self, rv = "" )
 
34
      end
 
35
      return rv
25
36
                end
26
37
 
27
38
                def indent to, ind