зеркало из https://github.com/github/ruby.git
* lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): Symbol should
come earlier than String. * lib/soap/mapping/rubytypeFactory.rb (RubytypeFactory::obj2soap): ditto. * lib/set.rb (TC_Set::test_s_new): strings are no longer Enumerable * lib/soap/property.rb (Property::load): ditto. * lib/webrick/httputils.rb (WEBrick::HTTPUtils::parse_header): ditto. * lib/soap/mimemessage.rb (MIMEMessage::Headers::parse): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
92ca42cb3e
Коммит
84e2f5268a
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
|||
Thu Nov 2 08:21:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): Symbol should
|
||||
come earlier than String.
|
||||
|
||||
* lib/soap/mapping/rubytypeFactory.rb (RubytypeFactory::obj2soap):
|
||||
ditto.
|
||||
|
||||
* lib/set.rb (TC_Set::test_s_new): strings are no longer
|
||||
Enumerable
|
||||
|
||||
* lib/soap/property.rb (Property::load): ditto.
|
||||
|
||||
* lib/webrick/httputils.rb (WEBrick::HTTPUtils::parse_header): ditto.
|
||||
|
||||
* lib/soap/mimemessage.rb (MIMEMessage::Headers::parse): ditto.
|
||||
|
||||
Thu Nov 2 09:08:04 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* array.c: revert lfree shift/unshift boost patch to avoid unknown
|
||||
|
|
|
@ -640,7 +640,6 @@ class TC_Set < Test::Unit::TestCase
|
|||
Set.new([])
|
||||
Set.new([1,2])
|
||||
Set.new('a'..'c')
|
||||
Set.new('XYZ')
|
||||
}
|
||||
assert_raises(NoMethodError) {
|
||||
Set.new(false)
|
||||
|
|
|
@ -38,6 +38,14 @@ class RubytypeFactory < Factory
|
|||
def obj2soap(soap_class, obj, info, map)
|
||||
param = nil
|
||||
case obj
|
||||
when ::Symbol
|
||||
unless @allow_original_mapping
|
||||
return nil
|
||||
end
|
||||
param = SOAPStruct.new(TYPE_SYMBOL)
|
||||
mark_marshalled_obj(obj, param)
|
||||
param.add('id', SOAPString.new(obj.id2name))
|
||||
addiv2soapattr(param, obj, map)
|
||||
when ::String
|
||||
unless @allow_original_mapping
|
||||
return nil
|
||||
|
@ -185,14 +193,6 @@ class RubytypeFactory < Factory
|
|||
mark_marshalled_obj(obj, param)
|
||||
param.add('name', SOAPString.new(obj.name))
|
||||
addiv2soapattr(param, obj, map)
|
||||
when ::Symbol
|
||||
unless @allow_original_mapping
|
||||
return nil
|
||||
end
|
||||
param = SOAPStruct.new(TYPE_SYMBOL)
|
||||
mark_marshalled_obj(obj, param)
|
||||
param.add('id', SOAPString.new(obj.id2name))
|
||||
addiv2soapattr(param, obj, map)
|
||||
when ::Struct
|
||||
unless @allow_original_mapping
|
||||
# treat it as an user defined class. [ruby-talk:104980]
|
||||
|
|
|
@ -49,7 +49,7 @@ class MIMEMessage
|
|||
|
||||
def parse(str)
|
||||
header_cache = nil
|
||||
str.each do |line|
|
||||
str.lines.each do |line|
|
||||
case line
|
||||
when /^\A[^\: \t]+:\s*.+$/
|
||||
parse_line(header_cache) if header_cache
|
||||
|
|
|
@ -70,7 +70,7 @@ class Property
|
|||
LINE_REGEXP = Regexp.new("^#{DEF_REGSRC}$")
|
||||
def load(stream)
|
||||
key_prefix = ""
|
||||
stream.each_with_index do |line, lineno|
|
||||
stream.lines.each_with_index do |line, lineno|
|
||||
line.sub!(/\r?\n\z/, '')
|
||||
case line
|
||||
when COMMENT_REGEXP
|
||||
|
|
|
@ -240,7 +240,7 @@ module WEBrick
|
|||
end
|
||||
end
|
||||
begin
|
||||
@header = HTTPUtils::parse_header(@raw_header)
|
||||
@header = HTTPUtils::parse_header(@raw_header.join)
|
||||
rescue => ex
|
||||
raise HTTPStatus::BadRequest, ex.message
|
||||
end
|
||||
|
|
|
@ -127,7 +127,7 @@ module WEBrick
|
|||
def parse_header(raw)
|
||||
header = Hash.new([].freeze)
|
||||
field = nil
|
||||
raw.each{|line|
|
||||
raw.lines.each{|line|
|
||||
case line
|
||||
when /^([A-Za-z0-9!\#$%&'*+\-.^_`|~]+):\s*(.*?)\s*\z/om
|
||||
field, value = $1, $2
|
||||
|
|
|
@ -194,12 +194,12 @@ module XMLRPC
|
|||
when TrueClass, FalseClass
|
||||
@writer.tag("boolean", param ? "1" : "0")
|
||||
|
||||
when String
|
||||
@writer.tag("string", param)
|
||||
|
||||
when Symbol
|
||||
@writer.tag("string", param.to_s)
|
||||
|
||||
when String
|
||||
@writer.tag("string", param)
|
||||
|
||||
when NilClass
|
||||
if Config::ENABLE_NIL_CREATE
|
||||
@writer.ele("nil")
|
||||
|
|
|
@ -129,22 +129,22 @@ module GenSupport
|
|||
private
|
||||
|
||||
def trim_eol(str)
|
||||
str.collect { |line|
|
||||
str.lines.collect { |line|
|
||||
line.sub(/\r?\n\z/, "") + "\n"
|
||||
}.join
|
||||
end
|
||||
|
||||
def trim_indent(str)
|
||||
indent = nil
|
||||
str = str.collect { |line| untab(line) }.join
|
||||
str.each do |line|
|
||||
str = str.lines.collect { |line| untab(line) }.join
|
||||
str.each_line do |line|
|
||||
head = line.index(/\S/)
|
||||
if !head.nil? and (indent.nil? or head < indent)
|
||||
indent = head
|
||||
end
|
||||
end
|
||||
return str unless indent
|
||||
str.collect { |line|
|
||||
str.lines.collect { |line|
|
||||
line.sub(/^ {0,#{indent}}/, "")
|
||||
}.join
|
||||
end
|
||||
|
|
|
@ -54,7 +54,7 @@ class TestWEBrickCGI < Test::Unit::TestCase
|
|||
assert_equal("a=1, a=2, b=x", res.body)}
|
||||
req = Net::HTTP::Get.new("/")
|
||||
http.request(req){|res|
|
||||
ary = res.body.to_a
|
||||
ary = res.body.lines.to_a
|
||||
assert_match(%r{/$}, ary[0])
|
||||
assert_match(%r{/webrick.cgi$}, ary[1])
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче