Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1587

Show
Ignore:
Timestamp:
07/22/05 21:53:43 (3 years ago)
Author:
nahi
Message:

let indent space size configuable. closes #130.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/generator.rb

    r1580 r1587  
    3939    @elementformdefault = opt[:elementformdefault] 
    4040    @attributeformdefault = opt[:attributeformdefault] 
     41    @indentstr = opt[:no_indent] ? '' : '  ' 
    4142    @buf = @indent = @curr = nil 
    4243  end 
     
    100101 
    101102  def encode_child(ns, child, parent) 
    102     indent_backup, @indent = @indent, @indent + '  ' 
     103    indent_backup, @indent = @indent, @indent + @indentstr 
    103104    encode_data(ns.clone_ns, child, parent) 
    104105    @indent = indent_backup 
     
    110111      @reftarget = obj 
    111112      obj.encode(self, ns, attrs) do |child| 
    112         indent_backup, @indent = @indent, @indent + '  ' 
     113        indent_backup, @indent = @indent, @indent + @indentstr 
    113114        encode_data(ns.clone_ns, child, obj) 
    114115        @indent = indent_backup 
     
    125126      end 
    126127      obj.encode(self, ns, attrs) do |child| 
    127         indent_backup, @indent = @indent, @indent + '  ' 
     128        indent_backup, @indent = @indent, @indent + @indentstr 
    128129        encode_data(ns.clone_ns, child, obj) 
    129130        @indent = indent_backup 
     
    163164        attrs.collect { |key, value| 
    164165          %Q[#{ key }="#{ value }"] 
    165         }.join("\n#{ @indent }    ") << 
     166        }.join("\n#{ @indent }#{ @indentstr * 2 }") << 
    166167        '>' 
    167168    end 
  • trunk/lib/soap/rpc/proxy.rb

    r1581 r1587  
    251251    opt[:allow_unqualified_element] = @allow_unqualified_element 
    252252    opt[:generate_explicit_type] = @generate_explicit_type 
     253    opt[:no_indent] = @options["soap.envelope.no_indent"] 
    253254    opt.update(hash) if hash 
    254255    opt