ruby-changes:14583
From: akr <ko1@a...>
Date: Tue, 26 Jan 2010 21:35:11 +0900 (JST)
Subject: [ruby-changes:14583] Ruby:r26426 (trunk): * ext/socket/extconf.rb: suppress a warning.
akr 2010-01-26 21:34:51 +0900 (Tue, 26 Jan 2010) New Revision: 26426 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26426 Log: * ext/socket/extconf.rb: suppress a warning. * ext/extmk.rb: ditto. Modified files: trunk/ChangeLog trunk/ext/extmk.rb trunk/ext/socket/extconf.rb trunk/test/ruby/test_dir_m17n.rb trunk/test/ruby/test_m17n.rb trunk/test/ruby/test_m17n_comb.rb trunk/test/ruby/test_range.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 26425) +++ ChangeLog (revision 26426) @@ -1,3 +1,9 @@ +Tue Jan 26 21:32:03 2010 Tanaka Akira <akr@f...> + + * ext/socket/extconf.rb: suppress a warning. + + * ext/extmk.rb: ditto. + Tue Jan 26 20:23:22 2010 Yusuke Endoh <mame@t...> * vm.c (rb_vm_invoke_proc): this function must not catch TAG_RETURN Index: ext/socket/extconf.rb =================================================================== --- ext/socket/extconf.rb (revision 26425) +++ ext/socket/extconf.rb (revision 26426) @@ -107,7 +107,7 @@ $defs[-1] = "-DHAVE_SA_LEN " end -have_header("netinet/tcp.h") if not /cygwin/ =~ RUBY_PLATFORM # for cygwin 1.1.5 +have_header("netinet/tcp.h") if /cygwin/ !~ RUBY_PLATFORM # for cygwin 1.1.5 have_header("netinet/udp.h") if have_func("sendmsg") | have_func("recvmsg") Index: ext/extmk.rb =================================================================== --- ext/extmk.rb (revision 26425) +++ ext/extmk.rb (revision 26426) @@ -267,7 +267,7 @@ if arg = v.first arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg end - $makeflags.concat(v.reject {|arg| /\AMINIRUBY=/ =~ arg}.quote) + $makeflags.concat(v.reject {|arg2| /\AMINIRUBY=/ =~ arg2}.quote) $mflags.concat(v) end opts.on('--message [MESSAGE]', String) do |v| @@ -570,19 +570,19 @@ ENV.delete("RUBYOPT") if $command_output message = "echo #{message}" - cmd = $makeflags.map {|s|s.sub(/.*[$(){};\s].*/, %q['\&'])}.join(' ') - open($command_output, 'wb') do |f| + cmd = $makeflags.map {|ss|ss.sub(/.*[$(){};\s].*/, %q['\&'])}.join(' ') + open($command_output, 'wb') do |ff| case $command_output when /\.sh\z/ - f.puts message, "rm -f $0; exec \"$@\" #{cmd}" + ff.puts message, "rm -f $0; exec \"$@\" #{cmd}" when /\.bat\z/ - ["@echo off", message, "%* #{cmd}", "del %0 & exit %ERRORLEVEL%"].each do |s| - f.print s, "\r\n" + ["@echo off", message, "%* #{cmd}", "del %0 & exit %ERRORLEVEL%"].each do |ss| + ff.print ss, "\r\n" end else - f.puts cmd + ff.puts cmd end - f.chmod(0755) + ff.chmod(0755) end else puts message Index: test/ruby/test_m17n.rb =================================================================== --- test/ruby/test_m17n.rb (revision 26425) +++ test/ruby/test_m17n.rb (revision 26426) @@ -1218,8 +1218,8 @@ assert_equal(Encoding::US_ASCII, eval("\n# -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII"))) # leading expressions - assert_equal(Encoding::ASCII_8BIT, eval("1+1 # -*- encoding: US-ASCII -*-\n__ENCODING__".force_encoding("ASCII-8BIT"))) - assert_equal(Encoding::US_ASCII, eval("1+1 # -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII"))) + assert_equal(Encoding::ASCII_8BIT, eval("v=1 # -*- encoding: US-ASCII -*-\n__ENCODING__".force_encoding("ASCII-8BIT"))) + assert_equal(Encoding::US_ASCII, eval("v=1 # -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII"))) end def test_regexp_usascii Index: test/ruby/test_range.rb =================================================================== --- test/ruby/test_range.rb (revision 26425) +++ test/ruby/test_range.rb (revision 26426) @@ -189,8 +189,12 @@ o1 = Object.new o2 = Object.new - def o1.<=>(x); -1; end - def o2.<=>(x); 0; end + def o1.setcmp(v) @cmpresult = v end + o1.setcmp(-1) + def o1.<=>(x); @cmpresult; end + def o2.setcmp(v) @cmpresult = v end + o2.setcmp(0) + def o2.<=>(x); @cmpresult; end class << o1; self; end.class_eval do define_method(:succ) { o2 } end @@ -206,19 +210,19 @@ r2.each {|x| a << x } assert_equal([o1], a) - def o2.<=>(x); 1; end + o2.setcmp(1) a = [] r1.each {|x| a << x } assert_equal([o1], a) - def o2.<=>(x); nil; end + o2.setcmp(nil) a = [] r1.each {|x| a << x } assert_equal([o1], a) - def o1.<=>(x); nil; end + o1.setcmp(nil) a = [] r2.each {|x| a << x } @@ -270,20 +274,24 @@ def test_beg_len o = Object.new assert_raise(TypeError) { [][o] } - def o.begin; -10; end + class << o; attr_accessor :begin end + o.begin = -10 assert_raise(TypeError) { [][o] } - def o.end; 0; end + class << o; attr_accessor :end end + o.end = 0 assert_raise(NoMethodError) { [][o] } - def o.exclude_end?; false; end + def o.exclude_end=(v) @exclude_end = v end + def o.exclude_end?() @exclude_end end + o.exclude_end = false assert_nil([0][o]) assert_raise(RangeError) { [0][o] = 1 } - def o.begin; 10; end - def o.end; 10; end + o.begin = 10 + o.end = 10 assert_nil([0][o]) - def o.begin; 0; end + o.begin = 0 assert_equal([0], [0][o]) - def o.begin; 2; end - def o.end; 0; end + o.begin = 2 + o.end = 0 assert_equal([], [0, 1, 2][o]) end Index: test/ruby/test_m17n_comb.rb =================================================================== --- test/ruby/test_m17n_comb.rb (revision 26425) +++ test/ruby/test_m17n_comb.rb (revision 26426) @@ -1057,7 +1057,7 @@ def test_str_oct STRINGS.each {|s| t = s.oct - t2 = a(s)[/\A[0-9a-fA-FxXbB]*/].oct + t2 = a(s)[/\A[0-9a-fA-FxX]*/].oct assert_equal(t2, t) } end Index: test/ruby/test_dir_m17n.rb =================================================================== --- test/ruby/test_dir_m17n.rb (revision 26425) +++ test/ruby/test_dir_m17n.rb (revision 26426) @@ -67,7 +67,7 @@ s2 = File.stat(filename2) rescue nil s3 = File.stat(filename3) rescue nil s4 = File.stat(filename4) rescue nil - exit (s1 && s2 && !s3 && !s4) ? true : false + exit((s1 && s2 && !s3 && !s4) ? true : false) EOS } end @@ -122,7 +122,7 @@ s1 = File.stat(filename1) rescue nil s2 = File.stat(filename2) rescue nil s3 = File.stat(filename3) rescue nil - exit (s1 && s2 && s3) ? true : false + exit((s1 && s2 && s3) ? true : false) EOS } end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/