* 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
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>
|
Sun Jul 11 21:20:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* README.EXT{,.ja} (rb_block_call): fixed about third/fourth
|
* README.EXT{,.ja} (rb_block_call): fixed about third/fourth
|
||||||
|
@ -1813,9 +1813,6 @@ class CSV
|
|||||||
end
|
end
|
||||||
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,
|
# 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
|
# 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)
|
@field_size_limit = options.delete(:field_size_limit)
|
||||||
|
|
||||||
# prebuild Regexps for faster parsing
|
# prebuild Regexps for faster parsing
|
||||||
esc_col_sep = escape_re(@col_sep)
|
|
||||||
esc_row_sep = escape_re(@row_sep)
|
esc_row_sep = escape_re(@row_sep)
|
||||||
esc_quote = escape_re(@quote_char)
|
esc_quote = escape_re(@quote_char)
|
||||||
@parsers = {
|
@parsers = {
|
||||||
|
10
lib/date.rb
10
lib/date.rb
@ -470,7 +470,7 @@ class Date
|
|||||||
end
|
end
|
||||||
|
|
||||||
def jd_to_weeknum(jd, f=0, sg=GREGORIAN) # :nodoc:
|
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
|
a = find_fdoy(y, sg) + 6
|
||||||
w, d = (jd - (a - ((a - f) + 1) % 7) + 7).divmod(7)
|
w, d = (jd - (a - ((a - f) + 1) % 7) + 7).divmod(7)
|
||||||
return y, w, d
|
return y, w, d
|
||||||
@ -486,7 +486,7 @@ class Date
|
|||||||
end
|
end
|
||||||
|
|
||||||
def jd_to_nth_kday(jd, sg=GREGORIAN) # :nodoc:
|
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)
|
j = find_fdom(y, m, sg)
|
||||||
return y, m, ((jd - j) / 7).floor + 1, jd_to_wday(jd)
|
return y, m, ((jd - j) / 7).floor + 1, jd_to_wday(jd)
|
||||||
end
|
end
|
||||||
@ -645,7 +645,7 @@ class Date
|
|||||||
d += 8
|
d += 8
|
||||||
end
|
end
|
||||||
if w < 0
|
if w < 0
|
||||||
ny, nw, nd =
|
ny, nw, =
|
||||||
jd_to_commercial(commercial_to_jd(y + 1, 1, 1, sg) + w * 7, sg)
|
jd_to_commercial(commercial_to_jd(y + 1, 1, 1, sg) + w * 7, sg)
|
||||||
return unless ny == y
|
return unless ny == y
|
||||||
w = nw
|
w = nw
|
||||||
@ -660,7 +660,7 @@ class Date
|
|||||||
d += 7
|
d += 7
|
||||||
end
|
end
|
||||||
if w < 0
|
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)
|
jd_to_weeknum(weeknum_to_jd(y + 1, 1, f, f, sg) + w * 7, f, sg)
|
||||||
return unless ny == y
|
return unless ny == y
|
||||||
w = nw
|
w = nw
|
||||||
@ -677,7 +677,7 @@ class Date
|
|||||||
if n < 0
|
if n < 0
|
||||||
ny, nm = (y * 12 + m).divmod(12)
|
ny, nm = (y * 12 + m).divmod(12)
|
||||||
nm, = (nm + 1) .divmod(1)
|
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)
|
jd_to_nth_kday(nth_kday_to_jd(ny, nm, 1, k, sg) + n * 7, sg)
|
||||||
return unless [ny, nm] == [y, m]
|
return unless [ny, nm] == [y, m]
|
||||||
n = nn
|
n = nn
|
||||||
|
@ -125,7 +125,7 @@ class Context
|
|||||||
|
|
||||||
def debug_eval(str, binding)
|
def debug_eval(str, binding)
|
||||||
begin
|
begin
|
||||||
val = eval(str, binding)
|
eval(str, binding)
|
||||||
rescue StandardError, ScriptError => e
|
rescue StandardError, ScriptError => e
|
||||||
at = eval("caller(1)", binding)
|
at = eval("caller(1)", binding)
|
||||||
stdout.printf "%s:%s\n", at.shift, e.to_s.sub(/\(eval\):1:(in `.*?':)?/, '')
|
stdout.printf "%s:%s\n", at.shift, e.to_s.sub(/\(eval\):1:(in `.*?':)?/, '')
|
||||||
@ -585,7 +585,7 @@ EOHELP
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format_frame(pos)
|
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,
|
sprintf "#%d %s:%s%s\n", pos + 1, file, line,
|
||||||
(id ? ":in `#{id.id2name}'" : "")
|
(id ? ":in `#{id.id2name}'" : "")
|
||||||
end
|
end
|
||||||
|
@ -820,7 +820,7 @@ module DRb
|
|||||||
|
|
||||||
# Open a client connection to +uri+ using configuration +config+.
|
# Open a client connection to +uri+ using configuration +config+.
|
||||||
def self.open(uri, config)
|
def self.open(uri, config)
|
||||||
host, port, option = parse_uri(uri)
|
host, port, = parse_uri(uri)
|
||||||
host.untaint
|
host.untaint
|
||||||
port.untaint
|
port.untaint
|
||||||
soc = TCPSocket.open(host, port)
|
soc = TCPSocket.open(host, port)
|
||||||
@ -852,7 +852,7 @@ module DRb
|
|||||||
# configuration +config+.
|
# configuration +config+.
|
||||||
def self.open_server(uri, config)
|
def self.open_server(uri, config)
|
||||||
uri = 'druby://:0' unless uri
|
uri = 'druby://:0' unless uri
|
||||||
host, port, opt = parse_uri(uri)
|
host, port, _ = parse_uri(uri)
|
||||||
config = {:tcp_original_host => host}.update(config)
|
config = {:tcp_original_host => host}.update(config)
|
||||||
if host.size == 0
|
if host.size == 0
|
||||||
host = getservername
|
host = getservername
|
||||||
|
@ -7,7 +7,7 @@ module DRb
|
|||||||
if x.size == 1 && x[0].class == Array
|
if x.size == 1 && x[0].class == Array
|
||||||
x[0] = DRbArray.new(x[0])
|
x[0] = DRbArray.new(x[0])
|
||||||
end
|
end
|
||||||
block_value = @block.call(*x)
|
@block.call(*x)
|
||||||
end
|
end
|
||||||
|
|
||||||
def perform_with_block
|
def perform_with_block
|
||||||
|
@ -623,7 +623,7 @@ class RubyLex
|
|||||||
tk_c = TkLPAREN
|
tk_c = TkLPAREN
|
||||||
end
|
end
|
||||||
@indent_stack.push tk_c
|
@indent_stack.push tk_c
|
||||||
tk = Token(tk_c)
|
Token(tk_c)
|
||||||
end
|
end
|
||||||
|
|
||||||
@OP.def_rule("[]", proc{|op, io| @lex_state == EXPR_FNAME}) do
|
@OP.def_rule("[]", proc{|op, io| @lex_state == EXPR_FNAME}) do
|
||||||
|
@ -35,7 +35,7 @@ module IRB
|
|||||||
D_DETAIL.pp token
|
D_DETAIL.pp token
|
||||||
|
|
||||||
postproc = block if block_given?
|
postproc = block if block_given?
|
||||||
node = create(token, preproc, postproc)
|
create(token, preproc, postproc)
|
||||||
end
|
end
|
||||||
|
|
||||||
def def_rules(*tokens, &block)
|
def def_rules(*tokens, &block)
|
||||||
|
@ -176,7 +176,7 @@ require 'monitor'
|
|||||||
|
|
||||||
class Logger
|
class Logger
|
||||||
VERSION = "1.2.7"
|
VERSION = "1.2.7"
|
||||||
id, name, rev = %w$Id$
|
_, name, rev = %w$Id$
|
||||||
if name
|
if name
|
||||||
name = name.chomp(",v")
|
name = name.chomp(",v")
|
||||||
else
|
else
|
||||||
@ -530,7 +530,7 @@ private
|
|||||||
@mutex.synchronize do
|
@mutex.synchronize do
|
||||||
@dev.close rescue nil
|
@dev.close rescue nil
|
||||||
end
|
end
|
||||||
rescue Exception => ignored
|
rescue Exception
|
||||||
@dev.close rescue nil
|
@dev.close rescue nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -496,7 +496,7 @@ class Pathname
|
|||||||
def relative?
|
def relative?
|
||||||
path = @path
|
path = @path
|
||||||
while r = chop_basename(path)
|
while r = chop_basename(path)
|
||||||
path, basename = r
|
path, = r
|
||||||
end
|
end
|
||||||
path == ''
|
path == ''
|
||||||
end
|
end
|
||||||
@ -509,7 +509,7 @@ class Pathname
|
|||||||
#
|
#
|
||||||
def each_filename # :yield: filename
|
def each_filename # :yield: filename
|
||||||
return to_enum(__method__) unless block_given?
|
return to_enum(__method__) unless block_given?
|
||||||
prefix, names = split_names(@path)
|
_, names = split_names(@path)
|
||||||
names.each {|filename| yield filename }
|
names.each {|filename| yield filename }
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
@ -565,7 +565,7 @@ class Pathname
|
|||||||
path = @path
|
path = @path
|
||||||
yield self
|
yield self
|
||||||
while r = chop_basename(path)
|
while r = chop_basename(path)
|
||||||
path, name = r
|
path, = r
|
||||||
break if path.empty?
|
break if path.empty?
|
||||||
yield self.class.new(del_trailing_separator(path))
|
yield self.class.new(del_trailing_separator(path))
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user