mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/cgi/core.rb: remove unused variables.
* lib/erb.rb: ditto. * lib/mkmf.rb: ditto. * lib/net/http/response.rb: ditto. * lib/optparse/version.rb: ditto. * lib/prime.rb: ditto. * lib/racc/parser.rb: ditto. * lib/rexml/document.rb: ditto. * lib/rexml/dtd/dtd.rb: ditto. * lib/rexml/element.rb: ditto. * lib/rexml/functions.rb: ditto. * lib/rexml/parsers/xpathparser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
42425c89a4
commit
448c87008e
13 changed files with 23 additions and 20 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
||||||
|
Sun Jul 27 19:49:36 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
||||||
|
|
||||||
|
* lib/cgi/core.rb: remove unused variables.
|
||||||
|
* lib/erb.rb: ditto.
|
||||||
|
* lib/mkmf.rb: ditto.
|
||||||
|
* lib/net/http/response.rb: ditto.
|
||||||
|
* lib/optparse/version.rb: ditto.
|
||||||
|
* lib/prime.rb: ditto.
|
||||||
|
* lib/racc/parser.rb: ditto.
|
||||||
|
* lib/rexml/document.rb: ditto.
|
||||||
|
* lib/rexml/dtd/dtd.rb: ditto.
|
||||||
|
* lib/rexml/element.rb: ditto.
|
||||||
|
* lib/rexml/functions.rb: ditto.
|
||||||
|
* lib/rexml/parsers/xpathparser.rb: ditto.
|
||||||
|
|
||||||
Sun Jul 27 05:11:21 2014 Zachary Scott <e@zzak.io>
|
Sun Jul 27 05:11:21 2014 Zachary Scott <e@zzak.io>
|
||||||
|
|
||||||
* lib/irb.rb: [DOC] PROMPT_I cannot be nil, patch by @hgillane
|
* lib/irb.rb: [DOC] PROMPT_I cannot be nil, patch by @hgillane
|
||||||
|
|
|
@ -479,7 +479,6 @@ class CGI
|
||||||
@files = {}
|
@files = {}
|
||||||
boundary_rexp = /--#{Regexp.quote(boundary)}(#{EOL}|--)/
|
boundary_rexp = /--#{Regexp.quote(boundary)}(#{EOL}|--)/
|
||||||
boundary_size = "#{EOL}--#{boundary}#{EOL}".bytesize
|
boundary_size = "#{EOL}--#{boundary}#{EOL}".bytesize
|
||||||
boundary_end = nil
|
|
||||||
buf = ''
|
buf = ''
|
||||||
bufsize = 10 * 1024
|
bufsize = 10 * 1024
|
||||||
max_count = MAX_MULTIPART_COUNT
|
max_count = MAX_MULTIPART_COUNT
|
||||||
|
|
|
@ -717,7 +717,7 @@ class ERB
|
||||||
comment = $1 if comment[/-\*-\s*(.*?)\s*-*-$/]
|
comment = $1 if comment[/-\*-\s*(.*?)\s*-*-$/]
|
||||||
if %r"coding\s*[=:]\s*([[:alnum:]\-_]+)" =~ comment
|
if %r"coding\s*[=:]\s*([[:alnum:]\-_]+)" =~ comment
|
||||||
enc = $1.sub(/-(?:mac|dos|unix)/i, '')
|
enc = $1.sub(/-(?:mac|dos|unix)/i, '')
|
||||||
enc = Encoding.find(enc)
|
Encoding.find(enc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -667,7 +667,6 @@ SRC
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
upper = 1
|
upper = 1
|
||||||
lower = 0
|
|
||||||
until try_static_assert("#{const} <= #{upper}", headers, opt)
|
until try_static_assert("#{const} <= #{upper}", headers, opt)
|
||||||
lower = upper
|
lower = upper
|
||||||
upper <<= 1
|
upper <<= 1
|
||||||
|
@ -2253,7 +2252,7 @@ static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
|
||||||
fseprepl = proc {|s|
|
fseprepl = proc {|s|
|
||||||
s = s.gsub("/", fsep)
|
s = s.gsub("/", fsep)
|
||||||
s = s.gsub(/(\$\(\w+)(\))/) {$1+sep+$2}
|
s = s.gsub(/(\$\(\w+)(\))/) {$1+sep+$2}
|
||||||
s = s.gsub(/(\$\{\w+)(\})/) {$1+sep+$2}
|
s.gsub(/(\$\{\w+)(\})/) {$1+sep+$2}
|
||||||
}
|
}
|
||||||
rsep = ":#{fsep}=/"
|
rsep = ":#{fsep}=/"
|
||||||
else
|
else
|
||||||
|
|
|
@ -306,7 +306,6 @@ class Net::HTTPResponse
|
||||||
# See RFC 2616 section 3.6.1 for definitions
|
# See RFC 2616 section 3.6.1 for definitions
|
||||||
|
|
||||||
def read_chunked(dest, chunk_data_io) # :nodoc:
|
def read_chunked(dest, chunk_data_io) # :nodoc:
|
||||||
len = nil
|
|
||||||
total = 0
|
total = 0
|
||||||
while true
|
while true
|
||||||
line = @socket.readline
|
line = @socket.readline
|
||||||
|
|
|
@ -51,7 +51,7 @@ class << OptionParser
|
||||||
raise NameError, path unless Module === klass
|
raise NameError, path unless Module === klass
|
||||||
klass.constants.grep(/#{name}/i) do |c|
|
klass.constants.grep(/#{name}/i) do |c|
|
||||||
klass.const_defined?(c) or next
|
klass.const_defined?(c) or next
|
||||||
c = klass.const_get(c)
|
klass.const_get(c)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -180,7 +180,7 @@ class Prime
|
||||||
# Prime.int_from_prime_division([[2,2], [3,1]]) #=> 12
|
# Prime.int_from_prime_division([[2,2], [3,1]]) #=> 12
|
||||||
def int_from_prime_division(pd)
|
def int_from_prime_division(pd)
|
||||||
pd.inject(1){|value, (prime, index)|
|
pd.inject(1){|value, (prime, index)|
|
||||||
value *= prime**index
|
value * prime**index
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -380,7 +380,6 @@ module Racc
|
||||||
_, _, _, _,
|
_, _, _, _,
|
||||||
_, _, _, shift_n, reduce_n,
|
_, _, _, shift_n, reduce_n,
|
||||||
_, _, * = arg
|
_, _, * = arg
|
||||||
nerr = 0 # tmp
|
|
||||||
|
|
||||||
if act > 0 and act < shift_n
|
if act > 0 and act < shift_n
|
||||||
#
|
#
|
||||||
|
@ -431,7 +430,6 @@ module Racc
|
||||||
case @racc_error_status
|
case @racc_error_status
|
||||||
when 0
|
when 0
|
||||||
unless arg[21] # user_yyerror
|
unless arg[21] # user_yyerror
|
||||||
nerr += 1
|
|
||||||
on_error @racc_t, @racc_val, @racc_vstack
|
on_error @racc_t, @racc_val, @racc_vstack
|
||||||
end
|
end
|
||||||
when 3
|
when 3
|
||||||
|
|
|
@ -123,7 +123,7 @@ module REXML
|
||||||
def xml_decl
|
def xml_decl
|
||||||
rv = @children[0]
|
rv = @children[0]
|
||||||
return rv if rv.kind_of? XMLDecl
|
return rv if rv.kind_of? XMLDecl
|
||||||
rv = @children.unshift(XMLDecl.default)[0]
|
@children.unshift(XMLDecl.default)[0]
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return the XMLDecl version of this document as a String.
|
# @return the XMLDecl version of this document as a String.
|
||||||
|
|
|
@ -24,23 +24,18 @@ module REXML
|
||||||
case input
|
case input
|
||||||
when ElementDecl.PATTERN_RE
|
when ElementDecl.PATTERN_RE
|
||||||
match = $&
|
match = $&
|
||||||
source = $'
|
|
||||||
contents << ElementDecl.new( match )
|
contents << ElementDecl.new( match )
|
||||||
when AttlistDecl.PATTERN_RE
|
when AttlistDecl.PATTERN_RE
|
||||||
matchdata = $~
|
matchdata = $~
|
||||||
source = $'
|
|
||||||
contents << AttlistDecl.new( matchdata )
|
contents << AttlistDecl.new( matchdata )
|
||||||
when EntityDecl.PATTERN_RE
|
when EntityDecl.PATTERN_RE
|
||||||
matchdata = $~
|
matchdata = $~
|
||||||
source = $'
|
|
||||||
contents << EntityDecl.new( matchdata )
|
contents << EntityDecl.new( matchdata )
|
||||||
when Comment.PATTERN_RE
|
when Comment.PATTERN_RE
|
||||||
matchdata = $~
|
matchdata = $~
|
||||||
source = $'
|
|
||||||
contents << Comment.new( matchdata )
|
contents << Comment.new( matchdata )
|
||||||
when NotationDecl.PATTERN_RE
|
when NotationDecl.PATTERN_RE
|
||||||
matchdata = $~
|
matchdata = $~
|
||||||
source = $'
|
|
||||||
contents << NotationDecl.new( matchdata )
|
contents << NotationDecl.new( matchdata )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1181,9 +1181,8 @@ module REXML
|
||||||
prefix = '' unless prefix
|
prefix = '' unless prefix
|
||||||
end
|
end
|
||||||
old = fetch(name, nil)
|
old = fetch(name, nil)
|
||||||
attr = nil
|
|
||||||
if old.kind_of? Hash # the supplied attribute is one of many
|
if old.kind_of? Hash # the supplied attribute is one of many
|
||||||
attr = old.delete(prefix)
|
old.delete(prefix)
|
||||||
if old.size == 1
|
if old.size == 1
|
||||||
repl = nil
|
repl = nil
|
||||||
old.each_value{|v| repl = v}
|
old.each_value{|v| repl = v}
|
||||||
|
@ -1192,7 +1191,6 @@ module REXML
|
||||||
elsif old.nil?
|
elsif old.nil?
|
||||||
return @element
|
return @element
|
||||||
else # the supplied attribute is a top-level one
|
else # the supplied attribute is a top-level one
|
||||||
attr = old
|
|
||||||
super(name)
|
super(name)
|
||||||
end
|
end
|
||||||
@element
|
@element
|
||||||
|
|
|
@ -363,7 +363,7 @@ module REXML
|
||||||
|
|
||||||
def Functions::sum( nodes )
|
def Functions::sum( nodes )
|
||||||
nodes = [nodes] unless nodes.kind_of? Array
|
nodes = [nodes] unless nodes.kind_of? Array
|
||||||
nodes.inject(0) { |r,n| r += number(string(n)) }
|
nodes.inject(0) { |r,n| r + number(string(n)) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def Functions::floor( number )
|
def Functions::floor( number )
|
||||||
|
|
|
@ -21,7 +21,7 @@ module REXML
|
||||||
path.gsub!(/([\(\[])\s+/, '\1') # Strip ignorable spaces
|
path.gsub!(/([\(\[])\s+/, '\1') # Strip ignorable spaces
|
||||||
path.gsub!( /\s+([\]\)])/, '\1')
|
path.gsub!( /\s+([\]\)])/, '\1')
|
||||||
parsed = []
|
parsed = []
|
||||||
path = OrExpr(path, parsed)
|
OrExpr(path, parsed)
|
||||||
parsed
|
parsed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue