From: Eric Hodel Date: 2008-09-23T17:00:51+09:00 Subject: [ruby-core:18803] lib warnings patch from RDoc --Apple-Mail-5--963485863 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi, I fixed some warnings I discovered with RDoc when run against ruby19 with -w. My machine is too slow to run the tests right now (my main machine is broken). Can somebody review and check them in for me? --Apple-Mail-5--963485863 Content-Disposition: attachment; filename=lib.warnings.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="lib.warnings.patch" Content-Transfer-Encoding: 7bit Index: lib/uri/mailto.rb =================================================================== --- lib/uri/mailto.rb (revision 19471) +++ lib/uri/mailto.rb (working copy) @@ -135,7 +135,7 @@ module URI @headers = [] if MAILTO_REGEXP =~ @opaque - if arg[-1] + if arg[-1] self.to = $1 self.headers = $2 else Index: lib/uri/generic.rb =================================================================== --- lib/uri/generic.rb (revision 19471) +++ lib/uri/generic.rb (working copy) @@ -516,7 +516,7 @@ module URI if v && v != '' && @parser.regexp[:QUERY] !~ v raise InvalidComponentError, "bad component(expected query component): #{v}" - end + end return true end Index: lib/cgi/core.rb =================================================================== --- lib/cgi/core.rb (revision 19471) +++ lib/cgi/core.rb (working copy) @@ -217,14 +217,14 @@ class CGI buf << "Set-Cookie: #{cookie}#{EOL}" when Array arr = cookie - arr.each {|cookie| buf << "Set-Cookie: #{cookie}#{EOL}" } + arr.each {|c| buf << "Set-Cookie: #{c}#{EOL}" } when Hash hash = cookie - hash.each {|name, cookie| buf << "Set-Cookie: #{cookie}#{EOL}" } + hash.each {|name, c| buf << "Set-Cookie: #{c}#{EOL}" } end end if @output_cookies - @output_cookies.each {|cookie| buf << "Set-Cookie: #{cookie}#{EOL}" } + @output_cookies.each {|c| buf << "Set-Cookie: #{c}#{EOL}" } end ## other headers options.each do |key, value| @@ -463,9 +463,9 @@ class CGI /Content-Disposition:.* filename=(?:"((?:\\.|[^\"])*)"|([^;\s]*))/i.match(head) filename = ($1 or $2 or "") - if /Mac/i.match(env_table['HTTP_USER_AGENT']) and - /Mozilla/i.match(env_table['HTTP_USER_AGENT']) and - (not /MSIE/i.match(env_table['HTTP_USER_AGENT'])) + if /Mac/i =~ env_table['HTTP_USER_AGENT'] and + /Mozilla/i =~ env_table['HTTP_USER_AGENT'] and + /MSIE/i !~ env_table['HTTP_USER_AGENT'] filename = CGI::unescape(filename) end Index: lib/yaml.rb =================================================================== --- lib/yaml.rb (revision 19471) +++ lib/yaml.rb (working copy) @@ -213,7 +213,7 @@ module YAML # end # end # - def YAML.each_document( io, &block ) + def YAML.each_document( io, &block ) yp = parser.load_documents( io, &block ) end @@ -228,7 +228,7 @@ module YAML # end # end # - def YAML.load_documents( io, &doc_proc ) + def YAML.load_documents( io, &doc_proc ) YAML.each_document( io, &doc_proc ) end @@ -243,7 +243,7 @@ module YAML # end # end # - def YAML.each_node( io, &doc_proc ) + def YAML.each_node( io, &doc_proc ) yp = generic_parser.load_documents( io, &doc_proc ) end @@ -258,7 +258,7 @@ module YAML # end # end # - def YAML.parse_documents( io, &doc_proc ) + def YAML.parse_documents( io, &doc_proc ) YAML.each_node( io, &doc_proc ) end --Apple-Mail-5--963485863--