[前][次][番号順一覧][スレッド一覧]

ruby-changes:16626

From: marcandre <ko1@a...>
Date: Mon, 12 Jul 2010 02:00:19 +0900 (JST)
Subject: [ruby-changes:16626] Ruby:r28619 (trunk): * lib/csv.rb: Fix unused variable warnings.

marcandre	2010-07-12 01:59:10 +0900 (Mon, 12 Jul 2010)

  New Revision: 28619

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28619

  Log:
    * 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

  Modified files:
    trunk/ChangeLog
    trunk/lib/csv.rb
    trunk/lib/date.rb
    trunk/lib/debug.rb
    trunk/lib/drb/drb.rb
    trunk/lib/drb/invokemethod.rb
    trunk/lib/irb/ruby-lex.rb
    trunk/lib/irb/slex.rb
    trunk/lib/logger.rb
    trunk/lib/pathname.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 28618)
+++ ChangeLog	(revision 28619)
@@ -1,3 +1,24 @@
+Mon Jul 12 01:58:56 2010  Marc-Andre Lafortune  <ruby-core@m...>
+
+	* 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@r...>
 
 	* README.EXT{,.ja} (rb_block_call): fixed about third/fourth
Index: lib/csv.rb
===================================================================
--- lib/csv.rb	(revision 28618)
+++ lib/csv.rb	(revision 28619)
@@ -1813,9 +1813,6 @@
       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 @@
     @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 = {
Index: lib/pathname.rb
===================================================================
--- lib/pathname.rb	(revision 28618)
+++ lib/pathname.rb	(revision 28619)
@@ -496,7 +496,7 @@
   def relative?
     path = @path
     while r = chop_basename(path)
-      path, basename = r
+      path, = r
     end
     path == ''
   end
@@ -509,7 +509,7 @@
   #
   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 @@
     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
Index: lib/irb/ruby-lex.rb
===================================================================
--- lib/irb/ruby-lex.rb	(revision 28618)
+++ lib/irb/ruby-lex.rb	(revision 28619)
@@ -623,7 +623,7 @@
 	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
Index: lib/irb/slex.rb
===================================================================
--- lib/irb/slex.rb	(revision 28618)
+++ lib/irb/slex.rb	(revision 28619)
@@ -35,7 +35,7 @@
       D_DETAIL.pp token
 
       postproc = block if block_given?
-      node = create(token, preproc, postproc)
+      create(token, preproc, postproc)
     end
 
     def def_rules(*tokens, &block)
Index: lib/logger.rb
===================================================================
--- lib/logger.rb	(revision 28618)
+++ lib/logger.rb	(revision 28619)
@@ -176,7 +176,7 @@
 
 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 @@
         @mutex.synchronize do
           @dev.close rescue nil
         end
-      rescue Exception => ignored
+      rescue Exception
         @dev.close rescue nil
       end
     end
Index: lib/date.rb
===================================================================
--- lib/date.rb	(revision 28618)
+++ lib/date.rb	(revision 28619)
@@ -470,7 +470,7 @@
     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 @@
     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 @@
 	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 @@
 	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 @@
       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
Index: lib/debug.rb
===================================================================
--- lib/debug.rb	(revision 28618)
+++ lib/debug.rb	(revision 28619)
@@ -125,7 +125,7 @@
 
   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 @@
   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
Index: lib/drb/drb.rb
===================================================================
--- lib/drb/drb.rb	(revision 28618)
+++ lib/drb/drb.rb	(revision 28619)
@@ -820,7 +820,7 @@
 
     # 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 @@
     # 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
Index: lib/drb/invokemethod.rb
===================================================================
--- lib/drb/invokemethod.rb	(revision 28618)
+++ lib/drb/invokemethod.rb	(revision 28619)
@@ -7,7 +7,7 @@
 	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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]