summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/socket/lib/socket.rb2
-rw-r--r--lib/forwardable.rb6
-rw-r--r--lib/matrix.rb5
-rw-r--r--lib/mkmf.rb3
-rw-r--r--test/ripper/test_parser_events.rb4
-rw-r--r--test/ruby/test_objectspace.rb1
-rw-r--r--test/ruby/test_rubyoptions.rb2
-rw-r--r--test/ruby/test_thread.rb2
-rw-r--r--test/test_mathn.rb4
9 files changed, 12 insertions, 17 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index b7dc446..d7bd760 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -577,7 +577,7 @@ class Socket < BasicSocket
def self.udp_server_recv(sockets)
sockets.each {|r|
begin
- msg, sender_addrinfo, rflags, *controls = r.recvmsg_nonblock
+ msg, sender_addrinfo, _, *controls = r.recvmsg_nonblock
rescue IO::WaitReadable
next
end
diff --git a/lib/forwardable.rb b/lib/forwardable.rb
index 06f1571..636d2d0 100644
--- a/lib/forwardable.rb
+++ b/lib/forwardable.rb
@@ -246,7 +246,7 @@ module SingleForwardable
# provided, it is used as the name for the delegate method.
#
def def_single_delegator(accessor, method, ali = method)
- line_no = __LINE__; str = %{
+ str = %{
def #{ali}(*args, &block)
begin
#{accessor}.__send__(:#{method}, *args, &block)
@@ -264,7 +264,3 @@ module SingleForwardable
alias def_delegators def_single_delegators
alias def_delegator def_single_delegator
end
-
-
-
-
diff --git a/lib/matrix.rb b/lib/matrix.rb
index 8e6b08c..3fda08b 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -834,7 +834,6 @@ class Matrix
a = to_a
last_column = column_size - 1
last_row = row_size - 1
- rank = 0
pivot_row = 0
previous_pivot = 1
0.upto(last_column) do |k|
@@ -1237,7 +1236,7 @@ class Vector
# Vector[7, 4, ...]
#
def Vector.[](*array)
- new convert_to_array(array, copy = false)
+ new convert_to_array(array, false)
end
#
@@ -1532,6 +1531,6 @@ class Vector
# Overrides Object#inspect
#
def inspect
- str = "Vector"+@elements.inspect
+ "Vector" + @elements.inspect
end
end
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index cba14ce..696609a 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -153,8 +153,7 @@ def map_dir(dir, map = nil)
map.inject(dir) {|d, (orig, new)| d.gsub(orig, new)}
end
-topdir = File.dirname(libdir = File.dirname(__FILE__))
-extdir = File.expand_path("ext", topdir)
+topdir = File.dirname(File.dirname(__FILE__))
path = File.expand_path($0)
$extmk = path[0, topdir.size+1] == topdir+"/"
$extmk &&= %r"\A(?:ext|enc|tool|test(?:/.+))\z" =~ File.dirname(path[topdir.size+1..-1])
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 2ac623f..5d76941 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -1097,8 +1097,8 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_equal("[fcall(proc,[],&block([],[void()]))]", parse("proc{|;y|}"))
if defined?(Process::RLIMIT_AS)
assert_in_out_err(["-I#{File.dirname(__FILE__)}", "-rdummyparser"],
- 'Process.setrlimit(Process::RLIMIT_AS,102400); puts DummyParser.new("proc{|;y|}").parse',
- ["[fcall(proc,[],&block([],[void()]))]"], [], '[ruby-dev:39423]')
+ 'Process.setrlimit(Process::RLIMIT_AS,102400); puts DummyParser.new("proc{|;y|!y}").parse',
+ ["[fcall(proc,[],&block([],[unary(!,ref(y))]))]"], [], '[ruby-dev:39423]')
end
end
diff --git a/test/ruby/test_objectspace.rb b/test/ruby/test_objectspace.rb
index 571c725..24731a7 100644
--- a/test/ruby/test_objectspace.rb
+++ b/test/ruby/test_objectspace.rb
@@ -61,6 +61,7 @@ End
ObjectSpace.define_finalizer(a) { p :ok }
b = a.dup
ObjectSpace.define_finalizer(a) { p :ok }
+ !b
END
assert_raise(ArgumentError) { ObjectSpace.define_finalizer([], Object.new) }
end
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 65e692e..5befa46 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -182,7 +182,7 @@ class TestRubyOptions < Test::Unit::TestCase
end
def test_syntax_check
- assert_in_out_err(%w(-c -e a=1+1), "", ["Syntax OK"], [])
+ assert_in_out_err(%w(-c -e a=1+1 -e !a), "", ["Syntax OK"], [])
end
def test_invalid_option
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 3c10cce..0322448 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -231,7 +231,7 @@ class TestThread < Test::Unit::TestCase
t1 = Thread.new { sleep }
Thread.pass
t2 = Thread.new { loop { } }
- t3 = Thread.new { }.join
+ Thread.new { }.join
p [Thread.current, t1, t2].map{|t| t.object_id }.sort
p Thread.list.map{|t| t.object_id }.sort
INPUT
diff --git a/test/test_mathn.rb b/test/test_mathn.rb
index d369853..f511adb 100644
--- a/test/test_mathn.rb
+++ b/test/test_mathn.rb
@@ -4,7 +4,7 @@ require_relative 'ruby/envutil'
# mathn redefines too much. It must be isolated to child processes.
class TestMathn < Test::Unit::TestCase
def test_power
- assert_in_out_err ['-r', 'mathn', '-e', 'a=1**2'], "", [], [], '[ruby-core:25740]'
- assert_in_out_err ['-r', 'mathn', '-e', 'a=(1<<126)**2'], "", [], [], '[ruby-core:25740]'
+ assert_in_out_err ['-r', 'mathn', '-e', 'a=1**2;!a'], "", [], [], '[ruby-core:25740]'
+ assert_in_out_err ['-r', 'mathn', '-e', 'a=(1<<126)**2;!a'], "", [], [], '[ruby-core:25740]'
end
end