diff options
| author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-18 15:00:23 +0000 |
|---|---|---|
| committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-18 15:00:23 +0000 |
| commit | 817afcc8ab31cd128686304d2676e4c2b8d9c147 (patch) | |
| tree | 20dd23cdd18b64631f1fb70c0af5476fe91edfed /lib | |
| parent | 48408c2a0c2f719044e20c414b99a1b0f4946270 (diff) | |
* 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
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/soap/attachment.rb | 1 | ||||
| -rw-r--r-- | lib/soap/mimemessage.rb | 3 | ||||
| -rw-r--r-- | lib/soap/property.rb | 2 | ||||
| -rw-r--r-- | lib/webrick/https.rb | 1 | ||||
| -rw-r--r-- | lib/webrick/httpservlet/cgihandler.rb | 2 | ||||
| -rw-r--r-- | lib/xsd/codegen/gensupport.rb | 8 | ||||
| -rw-r--r-- | lib/xsd/datatypes.rb | 4 |
7 files changed, 12 insertions, 9 deletions
diff --git a/lib/soap/attachment.rb b/lib/soap/attachment.rb index 1a59b14018..a976146ca4 100644 --- a/lib/soap/attachment.rb +++ b/lib/soap/attachment.rb @@ -37,6 +37,7 @@ class Attachment @string_or_readable = string_or_readable @contenttype = "application/octet-stream" @contentid = nil + @content = nil end def contentid diff --git a/lib/soap/mimemessage.rb b/lib/soap/mimemessage.rb index acb4322e11..9a76798f96 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.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 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/https.rb b/lib/webrick/https.rb index 81b65ce803..8ad89f85dc 100644 --- a/lib/webrick/https.rb +++ b/lib/webrick/https.rb @@ -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 diff --git a/lib/webrick/httpservlet/cgihandler.rb b/lib/webrick/httpservlet/cgihandler.rb index d5895e5285..584208cef3 100644 --- a/lib/webrick/httpservlet/cgihandler.rb +++ b/lib/webrick/httpservlet/cgihandler.rb @@ -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') 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 diff --git a/lib/xsd/datatypes.rb b/lib/xsd/datatypes.rb index bbe6c8578f..25b9774fa2 100644 --- a/lib/xsd/datatypes.rb +++ b/lib/xsd/datatypes.rb @@ -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 |
