From 7eb52a8cd5ad6c40d86e6ea532114c9236a407a4 Mon Sep 17 00:00:00 2001 From: nahi Date: Thu, 30 Oct 2003 14:25:21 +0000 Subject: * lib/soap/generator.rb: better XML pretty printing. * lib/soap/encodingstyle/soapHandler.rb: remove unnecessary namespace assignment in the element which has "encodingStyle" attribute, and add necessary namespace assignment for "arrayType" attribute. * test/soap/calc/test_calc_cgi.rb: take over $DEBUG to ruby process through CGI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 13 ++++++++++++- lib/soap/encodingstyle/soapHandler.rb | 2 +- lib/soap/generator.rb | 17 ++++++++++------- test/soap/calc/test_calc_cgi.rb | 1 + 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b3eeb51ff..7150eb3c00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Thu Oct 30 23:19:11 2003 NAKAMURA, Hiroshi + + * lib/soap/generator.rb: better XML pretty printing. + + * lib/soap/encodingstyle/soapHandler.rb: remove unnecessary namespace + assignment in the element which has "encodingStyle" attribute, and + add necessary namespace assignment for "arrayType" attribute. + + * test/soap/calc/test_calc_cgi.rb: take over $DEBUG to ruby process + through CGI. + Thu Oct 30 22:59:39 2003 why the lucky stiff * ext/syck/yaml2byte.c: HASH const too long. Thanks, matz. @@ -22,7 +33,7 @@ Thu Oct 30 13:23:39 2003 Yukihiro Matsumoto Thu Oct 30 10:14:51 2003 NAKAMURA, Hiroshi - * lib/test/unit/autorunner.rb: make fox runners work. + * lib/test/unit/autorunner.rb: make fox runner work. Thu Oct 30 09:32:26 2003 NAKAMURA Usaku diff --git a/lib/soap/encodingstyle/soapHandler.rb b/lib/soap/encodingstyle/soapHandler.rb index 85d8642b8c..0c68810cce 100644 --- a/lib/soap/encodingstyle/soapHandler.rb +++ b/lib/soap/encodingstyle/soapHandler.rb @@ -293,7 +293,6 @@ private if !parent || parent.encodingstyle != EncodingNamespace if @generate_explicit_type SOAPGenerator.assign_ns(attrs, ns, EnvelopeNamespace) - SOAPGenerator.assign_ns(attrs, ns, EncodingNamespace) attrs[ns.name(AttrEncodingStyleName)] = EncodingNamespace end data.encodingstyle = EncodingNamespace @@ -309,6 +308,7 @@ private if data.arytype.namespace SOAPGenerator.assign_ns(attrs, ns, data.arytype.namespace) end + SOAPGenerator.assign_ns(attrs, ns, EncodingNamespace) attrs[ns.name(AttrArrayTypeName)] = ns.name(create_arytype(ns, data)) if data.type.name attrs[ns.name(XSD::AttrTypeName)] = ns.name(data.type) diff --git a/lib/soap/generator.rb b/lib/soap/generator.rb index e0ac484c42..7ddb105f7d 100644 --- a/lib/soap/generator.rb +++ b/lib/soap/generator.rb @@ -145,14 +145,17 @@ public end def encode_tag(elename, attrs = nil) - if attrs - @buf << "\n#{ @indent }<#{ elename }" << - attrs.collect { |key, value| - %Q[ #{ key }="#{ value }"] - }.join << - '>' - else + if !attrs or attrs.empty? @buf << "\n#{ @indent }<#{ elename }>" + elsif attrs.size == 1 + key, value = attrs.shift + @buf << %Q[\n#{ @indent }<#{ elename } #{ key }="#{ value }">] + else + @buf << "\n#{ @indent }<#{ elename } " << + attrs.collect { |key, value| + %Q[#{ key }="#{ value }"] + }.join("\n#{ @indent } ") << + '>' end end diff --git a/test/soap/calc/test_calc_cgi.rb b/test/soap/calc/test_calc_cgi.rb index 09ecfb03eb..d1c85fe042 100644 --- a/test/soap/calc/test_calc_cgi.rb +++ b/test/soap/calc/test_calc_cgi.rb @@ -15,6 +15,7 @@ class TestCalcCGI < Test::Unit::TestCase Config::CONFIG["bindir"], Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"] ) + RUBYBIN << " -d" if $DEBUG Port = 17171 -- cgit v1.2.3