diff options
Diffstat (limited to 'lib/rexml')
-rw-r--r-- | lib/rexml/document.rb | 2 | ||||
-rw-r--r-- | lib/rexml/dtd/dtd.rb | 5 | ||||
-rw-r--r-- | lib/rexml/element.rb | 4 | ||||
-rw-r--r-- | lib/rexml/functions.rb | 2 | ||||
-rw-r--r-- | lib/rexml/parsers/xpathparser.rb | 2 |
5 files changed, 4 insertions, 11 deletions
diff --git a/lib/rexml/document.rb b/lib/rexml/document.rb index 1e18263dda..8342b96e6a 100644 --- a/lib/rexml/document.rb +++ b/lib/rexml/document.rb @@ -123,7 +123,7 @@ module REXML def xml_decl rv = @children[0] return rv if rv.kind_of? XMLDecl - rv = @children.unshift(XMLDecl.default)[0] + @children.unshift(XMLDecl.default)[0] end # @return the XMLDecl version of this document as a String. diff --git a/lib/rexml/dtd/dtd.rb b/lib/rexml/dtd/dtd.rb index 966e39ea57..62317bac9e 100644 --- a/lib/rexml/dtd/dtd.rb +++ b/lib/rexml/dtd/dtd.rb @@ -24,23 +24,18 @@ module REXML case input when ElementDecl.PATTERN_RE match = $& - source = $' contents << ElementDecl.new( match ) when AttlistDecl.PATTERN_RE matchdata = $~ - source = $' contents << AttlistDecl.new( matchdata ) when EntityDecl.PATTERN_RE matchdata = $~ - source = $' contents << EntityDecl.new( matchdata ) when Comment.PATTERN_RE matchdata = $~ - source = $' contents << Comment.new( matchdata ) when NotationDecl.PATTERN_RE matchdata = $~ - source = $' contents << NotationDecl.new( matchdata ) end end diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb index 94b00d7284..e459704d3c 100644 --- a/lib/rexml/element.rb +++ b/lib/rexml/element.rb @@ -1181,9 +1181,8 @@ module REXML prefix = '' unless prefix end old = fetch(name, nil) - attr = nil if old.kind_of? Hash # the supplied attribute is one of many - attr = old.delete(prefix) + old.delete(prefix) if old.size == 1 repl = nil old.each_value{|v| repl = v} @@ -1192,7 +1191,6 @@ module REXML elsif old.nil? return @element else # the supplied attribute is a top-level one - attr = old super(name) end @element diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb index 20c8961aee..2010be14e0 100644 --- a/lib/rexml/functions.rb +++ b/lib/rexml/functions.rb @@ -363,7 +363,7 @@ module REXML def Functions::sum( nodes ) 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 def Functions::floor( number ) diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb index e643d11511..d30aa34f6e 100644 --- a/lib/rexml/parsers/xpathparser.rb +++ b/lib/rexml/parsers/xpathparser.rb @@ -21,7 +21,7 @@ module REXML path.gsub!(/([\(\[])\s+/, '\1') # Strip ignorable spaces path.gsub!( /\s+([\]\)])/, '\1') parsed = [] - path = OrExpr(path, parsed) + OrExpr(path, parsed) parsed end |