mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c6820cc3be
commit
70510d026f
10 changed files with 38 additions and 21 deletions
21
ChangeLog
21
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
|
||||
|
|
|
@ -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 = {
|
||||
|
|
10
lib/date.rb
10
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue