summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ext/extmk.rb16
-rw-r--r--ext/socket/extconf.rb2
-rw-r--r--test/ruby/test_dir_m17n.rb4
-rw-r--r--test/ruby/test_m17n.rb4
-rw-r--r--test/ruby/test_m17n_comb.rb2
-rw-r--r--test/ruby/test_range.rb34
7 files changed, 41 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index c49d62de2a..23a93ed58e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jan 26 21:32:03 2010 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: suppress a warning.
+
+ * ext/extmk.rb: ditto.
+
Tue Jan 26 20:23:22 2010 Yusuke Endoh <mame@tsg.ne.jp>
* vm.c (rb_vm_invoke_proc): this function must not catch TAG_RETURN
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 6715bcee3b..ab48634c1a 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -267,7 +267,7 @@ def parse_args()
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 @@ $mflags.unshift("topdir=#$topdir")
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
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index bebbf97ac7..20952e31f6 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -107,7 +107,7 @@ if have_struct_member("struct sockaddr", "sa_len", headers)
$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")
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb
index 59feb2b089..fb37fe1342 100644
--- a/test/ruby/test_dir_m17n.rb
+++ b/test/ruby/test_dir_m17n.rb
@@ -67,7 +67,7 @@ class TestDir_M17N < Test::Unit::TestCase
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 @@ class TestDir_M17N < Test::Unit::TestCase
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
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 0911a7378c..cb60e0fa76 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1218,8 +1218,8 @@ class TestM17N < Test::Unit::TestCase
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
diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb
index 57a8b16dfa..ab891363b1 100644
--- a/test/ruby/test_m17n_comb.rb
+++ b/test/ruby/test_m17n_comb.rb
@@ -1057,7 +1057,7 @@ class TestM17NComb < Test::Unit::TestCase
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
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index e0ff273836..a2935955de 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -189,8 +189,12 @@ class TestRange < Test::Unit::TestCase
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 @@ class TestRange < Test::Unit::TestCase
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 @@ class TestRange < Test::Unit::TestCase
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