ruby-changes:15346
From: naruse <ko1@a...>
Date: Tue, 6 Apr 2010 12:02:09 +0900 (JST)
Subject: [ruby-changes:15346] Ruby:r27235 (trunk): Surpress warnings.
naruse 2010-04-06 12:01:52 +0900 (Tue, 06 Apr 2010) New Revision: 27235 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27235 Log: Surpress warnings. Modified files: trunk/ext/dl/lib/dl/cparser.rb trunk/lib/cgi/cookie.rb trunk/lib/rdoc/ruby_lex.rb trunk/lib/xmlrpc/parser.rb trunk/sample/mkproto.rb trunk/test/bigdecimal/test_bigdecimal.rb trunk/test/ruby/test_math.rb Index: sample/mkproto.rb =================================================================== --- sample/mkproto.rb (revision 27234) +++ sample/mkproto.rb (revision 27235) @@ -1,20 +1,20 @@ $/ = nil while line = gets() - if /^((void|VALUE|int|char *\*|ID|struct [\w_]+ *\*|st_table *\*) *)?\n([\w\d_]+)\(.*\)\n\s*((.+;\n)*)\{/ =~ line + if /^((void|VALUE|int|char *\*|ID|struct \w+ *\*|st_table *\*) *)?\n(\w+)\(.*\)\n\s*((.+;\n)*)\{/ =~ line line = $' printf "%s %s(", $2, $3 args = [] for arg in $4.split(/;\n\s*/) arg.gsub!(/ +/, ' ') if arg =~ /,/ - if arg =~ /(([^*]+) *\** *[\w\d_]+),/ + if arg =~ /(([^*]+) *\** *\w+),/ type = $2.strip args.push $1.strip arg = $' else type = "" end - while arg.sub!(/(\** *[\w\d_]+)(,|$)/, "") && $~ + while arg.sub!(/(\** *\w+)(,|$)/, "") && $~ args.push type + " " + $1.strip end else Index: lib/xmlrpc/parser.rb =================================================================== --- lib/xmlrpc/parser.rb (revision 27234) +++ lib/xmlrpc/parser.rb (revision 27235) @@ -133,7 +133,7 @@ hash.delete "___class___" hash.each {|key, value| - obj.instance_variable_set("@#{ key }", value) if key =~ /^([\w_][\w_0-9]*)$/ + obj.instance_variable_set("@#{ key }", value) if key =~ /^([a-zA-Z_]\w*)$/ } obj rescue Index: lib/rdoc/ruby_lex.rb =================================================================== --- lib/rdoc/ruby_lex.rb (revision 27234) +++ lib/rdoc/ruby_lex.rb (revision 27235) @@ -453,7 +453,7 @@ if @lex_state != EXPR_END && @lex_state != EXPR_CLASS && (@lex_state != EXPR_ARG || @space_seen) c = peek(0) - if /\S/ =~ c && (/["'`]/ =~ c || /[\w_]/ =~ c || c == "-") + if /\S/ =~ c && (/["'`]/ =~ c || /\w/ =~ c || c == "-") tk = identify_here_document end end Index: lib/cgi/cookie.rb =================================================================== --- lib/cgi/cookie.rb (revision 27234) +++ lib/cgi/cookie.rb (revision 27235) @@ -54,6 +54,8 @@ # # These keywords correspond to attributes of the cookie object. def initialize(name = "", *value) + @domain = nil + @expires = nil if name.kind_of?(String) @name = name %r|^(.*/)|.match(ENV["SCRIPT_NAME"]) Index: ext/dl/lib/dl/cparser.rb =================================================================== --- ext/dl/lib/dl/cparser.rb (revision 27234) +++ ext/dl/lib/dl/cparser.rb (revision 27235) @@ -39,7 +39,7 @@ tymap ||= {} signature = signature.gsub(/\s+/, " ").strip case signature - when /^([\d\w@\*_\s]+)\(([\d\w\*_\s\,\[\]]*)\)$/ + when /^([\w@\*\s]+)\(([\w\*\s\,\[\]]*)\)$/ ret = $1 (args = $2).strip! ret = ret.split(/\s+/) Index: test/ruby/test_math.rb =================================================================== --- test/ruby/test_math.rb (revision 27234) +++ test/ruby/test_math.rb (revision 27235) @@ -114,8 +114,8 @@ check(0, Math.atanh(Math.sinh(0) / Math.cosh(0))) check(1, Math.atanh(Math.sinh(1) / Math.cosh(1))) check(2, Math.atanh(Math.sinh(2) / Math.cosh(2))) - assert_nothing_raised { assert_infinity Math.atanh(1) } - assert_nothing_raised { assert_infinity -Math.atanh(-1) } + assert_nothing_raised { assert_infinity(Math.atanh(1)) } + assert_nothing_raised { assert_infinity(-Math.atanh(-1)) } assert_raise(Math::DomainError) { Math.atanh(+1.0 + Float::EPSILON) } assert_raise(Math::DomainError) { Math.atanh(-1.0 - Float::EPSILON) } end @@ -134,8 +134,8 @@ check(1, Math.log(10, 10)) check(2, Math.log(100, 10)) assert_equal(1.0/0, Math.log(1.0/0)) - assert_nothing_raised { assert_infinity -Math.log(+0.0) } - assert_nothing_raised { assert_infinity -Math.log(-0.0) } + assert_nothing_raised { assert_infinity(-Math.log(+0.0)) } + assert_nothing_raised { assert_infinity(-Math.log(-0.0)) } assert_raise(Math::DomainError) { Math.log(-1.0) } assert_raise(TypeError) { Math.log(1,nil) } end @@ -145,8 +145,8 @@ check(1, Math.log2(2)) check(2, Math.log2(4)) assert_equal(1.0/0, Math.log2(1.0/0)) - assert_nothing_raised { assert_infinity -Math.log2(+0.0) } - assert_nothing_raised { assert_infinity -Math.log2(-0.0) } + assert_nothing_raised { assert_infinity(-Math.log2(+0.0)) } + assert_nothing_raised { assert_infinity(-Math.log2(-0.0)) } assert_raise(Math::DomainError) { Math.log2(-1.0) } end @@ -155,8 +155,8 @@ check(1, Math.log10(10)) check(2, Math.log10(100)) assert_equal(1.0/0, Math.log10(1.0/0)) - assert_nothing_raised { assert_infinity -Math.log10(+0.0) } - assert_nothing_raised { assert_infinity -Math.log10(-0.0) } + assert_nothing_raised { assert_infinity(-Math.log10(+0.0)) } + assert_nothing_raised { assert_infinity(-Math.log10(-0.0)) } assert_raise(Math::DomainError) { Math.log10(-1.0) } end Index: test/bigdecimal/test_bigdecimal.rb =================================================================== --- test/bigdecimal/test_bigdecimal.rb (revision 27234) +++ test/bigdecimal/test_bigdecimal.rb (revision 27235) @@ -355,6 +355,7 @@ a, b = BigDecimal.new("1").coerce(1.0) assert_instance_of(Float, a) assert_instance_of(Float, b) + assert_equal(2, 1 + BigDecimal.new("1"), '[ruby-core:25697]') end def test_uplus @@ -703,8 +704,4 @@ assert_equal(BigDecimal::SIGN_POSITIVE_ZERO, BigDecimal.new("1E-1" + "0" * 10000).sign) assert_equal(BigDecimal::SIGN_NEGATIVE_ZERO, BigDecimal.new("-1E-1" + "0" * 10000).sign) end - - def test_coerce - assert_equal(2, 1 + BigDecimal.new("1"), '[ruby-core:25697]') - end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/