diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-08 20:59:01 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-08 20:59:01 +0000 |
commit | f3e35474078895e1d178e15cfbfc6743f9ffc62d (patch) | |
tree | a3fd49329f497133415a7ec11592b5c693459608 /lib/rexml | |
parent | cceca83afe046b8c2b53eab6ab7c52faa1719b6d (diff) | |
download | ruby-f3e35474078895e1d178e15cfbfc6743f9ffc62d.tar.gz |
* lib/*.rb: Remove unused variable warnings.
Patch by Run Paint [ruby-core:30991]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml')
-rw-r--r-- | lib/rexml/attribute.rb | 2 | ||||
-rw-r--r-- | lib/rexml/child.rb | 2 | ||||
-rw-r--r-- | lib/rexml/doctype.rb | 1 | ||||
-rw-r--r-- | lib/rexml/element.rb | 5 | ||||
-rw-r--r-- | lib/rexml/formatters/transitive.rb | 1 | ||||
-rw-r--r-- | lib/rexml/functions.rb | 1 | ||||
-rw-r--r-- | lib/rexml/parsers/sax2parser.rb | 2 | ||||
-rw-r--r-- | lib/rexml/parsers/xpathparser.rb | 2 | ||||
-rw-r--r-- | lib/rexml/quickpath.rb | 3 | ||||
-rw-r--r-- | lib/rexml/validation/validation.rb | 2 | ||||
-rw-r--r-- | lib/rexml/xpath_parser.rb | 2 |
11 files changed, 7 insertions, 16 deletions
diff --git a/lib/rexml/attribute.rb b/lib/rexml/attribute.rb index 28a5923608..e99927943f 100644 --- a/lib/rexml/attribute.rb +++ b/lib/rexml/attribute.rb @@ -115,7 +115,7 @@ module REXML def doctype if @element doc = @element.document - doctype = doc.doctype if doc + doc.doctype if doc end end diff --git a/lib/rexml/child.rb b/lib/rexml/child.rb index fd59d7283a..de84a312fe 100644 --- a/lib/rexml/child.rb +++ b/lib/rexml/child.rb @@ -88,7 +88,7 @@ module REXML # This doesn't yet handle encodings def bytes - encoding = document.encoding + document.encoding to_s end diff --git a/lib/rexml/doctype.rb b/lib/rexml/doctype.rb index 1a946a1587..678095ae28 100644 --- a/lib/rexml/doctype.rb +++ b/lib/rexml/doctype.rb @@ -115,7 +115,6 @@ module REXML output << " #{@long_name.inspect}" if @long_name output << " #{@uri.inspect}" if @uri unless @children.empty? - next_indent = indent + 1 output << ' [' @children.each { |child| output << "\n" diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb index f999b0b2b1..97fbd0645b 100644 --- a/lib/rexml/element.rb +++ b/lib/rexml/element.rb @@ -874,7 +874,6 @@ module REXML # a.elements.add(Element.new('b')) #-> <a><b/></a> # a.elements.add('c') #-> <a><b/><c/></a> def add element=nil - rv = nil if element.nil? Element.new("", self, @element.context) elsif not element.kind_of?(Element) @@ -1092,7 +1091,7 @@ module REXML delete attr return end - element_document = @element.document + unless value.kind_of? Attribute if @element.document and @element.document.doctype value = Text::normalize( value, @element.document.doctype ) @@ -1197,7 +1196,7 @@ module REXML return @element else # the supplied attribute is a top-level one attr = old - res = super(name) + super(name) end @element end diff --git a/lib/rexml/formatters/transitive.rb b/lib/rexml/formatters/transitive.rb index 3a52e03f01..6cc690d922 100644 --- a/lib/rexml/formatters/transitive.rb +++ b/lib/rexml/formatters/transitive.rb @@ -37,7 +37,6 @@ module REXML # If compact and all children are text, and if the formatted output # is less than the specified width, then try to print everything on # one line - skip = false @level += @indentation node.children.each { |child| write( child, output ) diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb index 2d30e5fe92..7a05d0cf9f 100644 --- a/lib/rexml/functions.rb +++ b/lib/rexml/functions.rb @@ -170,7 +170,6 @@ module REXML # Kouhei fixed this too def Functions::substring_after( string, test ) ruby_string = string(string) - test_string = string(test) return $1 if ruby_string =~ /#{test}(.*)/ "" end diff --git a/lib/rexml/parsers/sax2parser.rb b/lib/rexml/parsers/sax2parser.rb index d0f0c5155e..1e69e14e45 100644 --- a/lib/rexml/parsers/sax2parser.rb +++ b/lib/rexml/parsers/sax2parser.rb @@ -87,7 +87,7 @@ module REXML @listeners.each { |sym,match,block| block.start_document if sym == :start_document or sym.nil? } - root = context = [] + context = [] while true event = @parser.pull case event[0] diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb index 2db37a2578..780e312671 100644 --- a/lib/rexml/parsers/xpathparser.rb +++ b/lib/rexml/parsers/xpathparser.rb @@ -282,7 +282,6 @@ module REXML PI = /^processing-instruction\(/ def NodeTest path, parsed #puts "NodeTest with #{path}" - res = nil case path when /^\*/ path = $' @@ -578,7 +577,6 @@ module REXML NUMBER = /^(\d*\.?\d+)/ NT = /^comment|text|processing-instruction|node$/ def PrimaryExpr path, parsed - arry = [] case path when VARIABLE_REFERENCE varname = $1 diff --git a/lib/rexml/quickpath.rb b/lib/rexml/quickpath.rb index 3ad8023470..06cb4f9115 100644 --- a/lib/rexml/quickpath.rb +++ b/lib/rexml/quickpath.rb @@ -33,7 +33,6 @@ module REXML results = filter(element.to_a, path) when /^[\[!\w:]/u # match on child - matches = [] children = element.to_a results = filter(children, path) else @@ -51,8 +50,6 @@ module REXML when /^\/\//u # Descendant return axe( elements, "descendant-or-self", $' ) when /^\/?\b(\w[-\w]*)\b::/u # Axe - axe_name = $1 - rest = $' return axe( elements, $1, $' ) when /^\/(?=\b([:!\w][-\.\w]*:)?[-!\*\.\w]*\b([^:(]|$)|\*)/u # Child rest = $' diff --git a/lib/rexml/validation/validation.rb b/lib/rexml/validation/validation.rb index f0ffa78912..8042e5d062 100644 --- a/lib/rexml/validation/validation.rb +++ b/lib/rexml/validation/validation.rb @@ -33,7 +33,7 @@ module REXML sattr = [:start_attribute, nil] eattr = [:end_attribute] text = [:text, nil] - k,v = event[2].find { |key,value| + k, = event[2].find { |key,value| sattr[1] = key #puts "Looking for #{sattr.inspect}" m = @current.next( sattr ) diff --git a/lib/rexml/xpath_parser.rb b/lib/rexml/xpath_parser.rb index d9088a25d9..3bffd389d0 100644 --- a/lib/rexml/xpath_parser.rb +++ b/lib/rexml/xpath_parser.rb @@ -687,7 +687,7 @@ module REXML return rv else res = [] - enum = SyncEnumerator.new( set1, set2 ).each { |i1, i2| + SyncEnumerator.new( set1, set2 ).each { |i1, i2| #puts "i1 = #{i1.inspect} (#{i1.class.name})" #puts "i2 = #{i2.inspect} (#{i2.class.name})" i1 = norm( i1 ) |