summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog21
-rw-r--r--lib/csv.rb4
-rw-r--r--lib/date.rb10
-rw-r--r--lib/debug.rb4
-rw-r--r--lib/drb/drb.rb4
-rw-r--r--lib/drb/invokemethod.rb2
-rw-r--r--lib/irb/ruby-lex.rb2
-rw-r--r--lib/irb/slex.rb2
-rw-r--r--lib/logger.rb4
-rw-r--r--lib/pathname.rb6
10 files changed, 38 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 6eff28019a1..deb0a374d82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+Mon Jul 12 01:58:56 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/csv.rb: Fix unused variable warnings.
+ Patch by Run Paint [ruby-core:30991]
+
+ * lib/date.rb: ditto
+
+ * lib/debug.rb: ditto
+
+ * lib/drb/drb.rb: ditto
+
+ * lib/drb/invokemethod.rb: ditto
+
+ * lib/irb/ruby-lex.rb: ditto
+
+ * lib/irb/slex.rb: ditto
+
+ * lib/logger.rb: ditto
+
+ * lib/pathname.rb: ditto
+
Sun Jul 11 21:20:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* README.EXT{,.ja} (rb_block_call): fixed about third/fourth
diff --git a/lib/csv.rb b/lib/csv.rb
index d870dfe229e..20a1977c9c0 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -1813,9 +1813,6 @@ class CSV
end
end
- # begin with a blank line, so we can always add to it
- line = ""
-
#
# it can take multiple calls to <tt>@io.gets()</tt> to get a full line,
# because of \r and/or \n characters embedded in quoted fields
@@ -2080,7 +2077,6 @@ class CSV
@field_size_limit = options.delete(:field_size_limit)
# prebuild Regexps for faster parsing
- esc_col_sep = escape_re(@col_sep)
esc_row_sep = escape_re(@row_sep)
esc_quote = escape_re(@quote_char)
@parsers = {
diff --git a/lib/date.rb b/lib/date.rb
index 3bb0875023e..5295ce9b7f7 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -470,7 +470,7 @@ class Date
end
def jd_to_weeknum(jd, f=0, sg=GREGORIAN) # :nodoc:
- y, m, d = jd_to_civil(jd, sg)
+ y, _, d = jd_to_civil(jd, sg)
a = find_fdoy(y, sg) + 6
w, d = (jd - (a - ((a - f) + 1) % 7) + 7).divmod(7)
return y, w, d
@@ -486,7 +486,7 @@ class Date
end
def jd_to_nth_kday(jd, sg=GREGORIAN) # :nodoc:
- y, m, d = jd_to_civil(jd, sg)
+ y, m, = jd_to_civil(jd, sg)
j = find_fdom(y, m, sg)
return y, m, ((jd - j) / 7).floor + 1, jd_to_wday(jd)
end
@@ -645,7 +645,7 @@ class Date
d += 8
end
if w < 0
- ny, nw, nd =
+ ny, nw, =
jd_to_commercial(commercial_to_jd(y + 1, 1, 1, sg) + w * 7, sg)
return unless ny == y
w = nw
@@ -660,7 +660,7 @@ class Date
d += 7
end
if w < 0
- ny, nw, nd, nf =
+ ny, nw, =
jd_to_weeknum(weeknum_to_jd(y + 1, 1, f, f, sg) + w * 7, f, sg)
return unless ny == y
w = nw
@@ -677,7 +677,7 @@ class Date
if n < 0
ny, nm = (y * 12 + m).divmod(12)
nm, = (nm + 1) .divmod(1)
- ny, nm, nn, nk =
+ ny, nm, nn, =
jd_to_nth_kday(nth_kday_to_jd(ny, nm, 1, k, sg) + n * 7, sg)
return unless [ny, nm] == [y, m]
n = nn
diff --git a/lib/debug.rb b/lib/debug.rb
index 10236c352d6..b97486d2360 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -125,7 +125,7 @@ class Context
def debug_eval(str, binding)
begin
- val = eval(str, binding)
+ eval(str, binding)
rescue StandardError, ScriptError => e
at = eval("caller(1)", binding)
stdout.printf "%s:%s\n", at.shift, e.to_s.sub(/\(eval\):1:(in `.*?':)?/, '')
@@ -585,7 +585,7 @@ EOHELP
end
def format_frame(pos)
- bind, file, line, id = @frames[pos]
+ _, file, line, id = @frames[pos]
sprintf "#%d %s:%s%s\n", pos + 1, file, line,
(id ? ":in `#{id.id2name}'" : "")
end
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index 84a21440ed6..cacca145e9f 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -820,7 +820,7 @@ module DRb
# Open a client connection to +uri+ using configuration +config+.
def self.open(uri, config)
- host, port, option = parse_uri(uri)
+ host, port, = parse_uri(uri)
host.untaint
port.untaint
soc = TCPSocket.open(host, port)
@@ -852,7 +852,7 @@ module DRb
# configuration +config+.
def self.open_server(uri, config)
uri = 'druby://:0' unless uri
- host, port, opt = parse_uri(uri)
+ host, port, _ = parse_uri(uri)
config = {:tcp_original_host => host}.update(config)
if host.size == 0
host = getservername
diff --git a/lib/drb/invokemethod.rb b/lib/drb/invokemethod.rb
index 220d0ad68dc..5a231ed67b3 100644
--- a/lib/drb/invokemethod.rb
+++ b/lib/drb/invokemethod.rb
@@ -7,7 +7,7 @@ module DRb
if x.size == 1 && x[0].class == Array
x[0] = DRbArray.new(x[0])
end
- block_value = @block.call(*x)
+ @block.call(*x)
end
def perform_with_block
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 76e3ebac446..72600289b8e 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -623,7 +623,7 @@ class RubyLex
tk_c = TkLPAREN
end
@indent_stack.push tk_c
- tk = Token(tk_c)
+ Token(tk_c)
end
@OP.def_rule("[]", proc{|op, io| @lex_state == EXPR_FNAME}) do
diff --git a/lib/irb/slex.rb b/lib/irb/slex.rb
index fac62bfd931..b395eaa475c 100644
--- a/lib/irb/slex.rb
+++ b/lib/irb/slex.rb
@@ -35,7 +35,7 @@ module IRB
D_DETAIL.pp token
postproc = block if block_given?
- node = create(token, preproc, postproc)
+ create(token, preproc, postproc)
end
def def_rules(*tokens, &block)
diff --git a/lib/logger.rb b/lib/logger.rb
index 6c33f7b3be6..5c00fe24c29 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -176,7 +176,7 @@ require 'monitor'
class Logger
VERSION = "1.2.7"
- id, name, rev = %w$Id$
+ _, name, rev = %w$Id$
if name
name = name.chomp(",v")
else
@@ -530,7 +530,7 @@ private
@mutex.synchronize do
@dev.close rescue nil
end
- rescue Exception => ignored
+ rescue Exception
@dev.close rescue nil
end
end
diff --git a/lib/pathname.rb b/lib/pathname.rb
index cede33d2731..f24fd4d76d1 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -496,7 +496,7 @@ class Pathname
def relative?
path = @path
while r = chop_basename(path)
- path, basename = r
+ path, = r
end
path == ''
end
@@ -509,7 +509,7 @@ class Pathname
#
def each_filename # :yield: filename
return to_enum(__method__) unless block_given?
- prefix, names = split_names(@path)
+ _, names = split_names(@path)
names.each {|filename| yield filename }
nil
end
@@ -565,7 +565,7 @@ class Pathname
path = @path
yield self
while r = chop_basename(path)
- path, name = r
+ path, = r
break if path.empty?
yield self.class.new(del_trailing_separator(path))
end