mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test warning cleanups.
* lib/webrick/https.rb, lib/soap/attachment.rb, test/xsd/test_xsd.rb: uninitialized instance variables. * lib/xsd/datatypes.rb: use Date#new! instead of Date#new0 according to deprecation message. * lib/webrick/httpservlet/cgihandler.rb, lib/xsd/codegen/gensupport.rb, lib/soap/property.rb, lib/soap/mimemessage.rb, test/webrick/test_cgi.rb: use String#each_line and String#lines.to_a instead of String#each according to deprecation message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
48408c2a0c
commit
817afcc8ab
10 changed files with 31 additions and 12 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
Thu Dec 18 23:53:50 2008 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
||||
|
||||
* test warning cleanups.
|
||||
|
||||
* lib/webrick/https.rb, lib/soap/attachment.rb, test/xsd/test_xsd.rb:
|
||||
uninitialized instance variables.
|
||||
|
||||
* lib/xsd/datatypes.rb: use Date#new! instead of Date#new0 according
|
||||
to deprecation message.
|
||||
|
||||
* lib/webrick/httpservlet/cgihandler.rb,
|
||||
lib/xsd/codegen/gensupport.rb, lib/soap/property.rb,
|
||||
lib/soap/mimemessage.rb, test/webrick/test_cgi.rb: use
|
||||
String#each_line and String#lines.to_a instead of String#each
|
||||
according to deprecation message.
|
||||
|
||||
Thu Dec 18 08:20:51 2008 James Edward Gray II <jeg2@ruby-lang.org>
|
||||
|
||||
Merged 20854 from trunk.
|
||||
|
|
|
@ -37,6 +37,7 @@ class Attachment
|
|||
@string_or_readable = string_or_readable
|
||||
@contenttype = "application/octet-stream"
|
||||
@contentid = nil
|
||||
@content = nil
|
||||
end
|
||||
|
||||
def contentid
|
||||
|
|
|
@ -49,7 +49,7 @@ class MIMEMessage
|
|||
|
||||
def parse(str)
|
||||
header_cache = nil
|
||||
str.each do |line|
|
||||
str.each_line do |line|
|
||||
case line
|
||||
when /^\A[^\: \t]+:\s*.+$/
|
||||
parse_line(header_cache) if header_cache
|
||||
|
@ -148,6 +148,7 @@ class MIMEMessage
|
|||
def initialize
|
||||
@parts = []
|
||||
@headers = Headers.new
|
||||
@boundary = nil
|
||||
@root = nil
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -21,6 +21,7 @@ module WEBrick
|
|||
alias orig_parse parse
|
||||
|
||||
def parse(socket=nil)
|
||||
@cipher = @server_cert = @client_cert = nil
|
||||
if socket.respond_to?(:cert)
|
||||
@server_cert = socket.cert || @config[:SSLCertificate]
|
||||
@client_cert = socket.peer_cert
|
||||
|
|
|
@ -80,7 +80,7 @@ module WEBrick
|
|||
"Premature end of script headers: #{@script_filename}" if body.nil?
|
||||
|
||||
begin
|
||||
header = HTTPUtils::parse_header(raw_header)
|
||||
header = HTTPUtils::parse_header(raw_header.lines.to_a)
|
||||
if /^(\d+)/ =~ header['status'][0]
|
||||
res.status = $1.to_i
|
||||
header.delete('status')
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -524,7 +524,7 @@ module XSDDateTimeImpl
|
|||
end
|
||||
|
||||
def to_date
|
||||
Date.new0(@data.class.jd_to_ajd(@data.jd, 0, 0), 0, @data.start)
|
||||
Date.new!(@data.class.jd_to_ajd(@data.jd, 0, 0), 0, @data.start)
|
||||
end
|
||||
|
||||
def to_datetime
|
||||
|
@ -573,7 +573,7 @@ module XSDDateTimeImpl
|
|||
fr = DateTime.time_to_day_fraction(t.hour, t.min, [t.sec, 59].min) +
|
||||
t.usec.to_r / 1000000 / SecInDay
|
||||
of = t.utc_offset.to_r / SecInDay
|
||||
DateTime.new0(DateTime.jd_to_ajd(jd, fr, of), of, DateTime::ITALY)
|
||||
DateTime.new!(DateTime.jd_to_ajd(jd, fr, of), of, DateTime::ITALY)
|
||||
else
|
||||
screen_data_str(t)
|
||||
end
|
||||
|
|
|
@ -46,7 +46,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])
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ class TestXSD < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_XSDString_NONE
|
||||
XSD::Charset.module_eval { @encoding_backup = @encoding; @encoding = "NONE" }
|
||||
XSD::Charset.module_eval { @encoding_backup = @internal_encoding; @internal_encoding = "NONE" }
|
||||
begin
|
||||
o = XSD::XSDString.new
|
||||
assert_equal(XSD::Namespace, o.type.namespace)
|
||||
|
@ -85,7 +85,7 @@ class TestXSD < Test::Unit::TestCase
|
|||
p XSD::XSDString.new("\xC0\xC0").to_s
|
||||
end
|
||||
ensure
|
||||
XSD::Charset.module_eval { @encoding = @encoding_backup }
|
||||
XSD::Charset.module_eval { @internal_encoding = @encoding_backup }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue