summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/set.rb1
-rw-r--r--lib/soap/mapping/rubytypeFactory.rb16
-rw-r--r--lib/soap/mimemessage.rb2
-rw-r--r--lib/soap/property.rb2
-rw-r--r--lib/webrick/httprequest.rb2
-rw-r--r--lib/webrick/httputils.rb2
-rw-r--r--lib/xmlrpc/create.rb6
-rw-r--r--lib/xsd/codegen/gensupport.rb8
8 files changed, 19 insertions, 20 deletions
diff --git a/lib/set.rb b/lib/set.rb
index 98c566f9c0..ace02e08f2 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -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)
diff --git a/lib/soap/mapping/rubytypeFactory.rb b/lib/soap/mapping/rubytypeFactory.rb
index 6c30f23a7b..4c629e10d6 100644
--- a/lib/soap/mapping/rubytypeFactory.rb
+++ b/lib/soap/mapping/rubytypeFactory.rb
@@ -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]
diff --git a/lib/soap/mimemessage.rb b/lib/soap/mimemessage.rb
index acb4322e11..4e151e320a 100644
--- a/lib/soap/mimemessage.rb
+++ b/lib/soap/mimemessage.rb
@@ -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
diff --git a/lib/soap/property.rb b/lib/soap/property.rb
index 882dcc6e28..51f2e82628 100644
--- a/lib/soap/property.rb
+++ b/lib/soap/property.rb
@@ -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
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb
index 80188b8cfc..2dca0655d6 100644
--- a/lib/webrick/httprequest.rb
+++ b/lib/webrick/httprequest.rb
@@ -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
diff --git a/lib/webrick/httputils.rb b/lib/webrick/httputils.rb
index c93146997f..38a42b98f8 100644
--- a/lib/webrick/httputils.rb
+++ b/lib/webrick/httputils.rb
@@ -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
diff --git a/lib/xmlrpc/create.rb b/lib/xmlrpc/create.rb
index 9150e2f56f..9a3df0d832 100644
--- a/lib/xmlrpc/create.rb
+++ b/lib/xmlrpc/create.rb
@@ -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")
diff --git a/lib/xsd/codegen/gensupport.rb b/lib/xsd/codegen/gensupport.rb
index 1e85d3668f..8c2bb0d901 100644
--- a/lib/xsd/codegen/gensupport.rb
+++ b/lib/xsd/codegen/gensupport.rb
@@ -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