projects
/
booh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fbf1c32
)
avoid "warning: Hash#index is deprecated; use Hash#key" with ruby 1.9
author
Guillaume Cottenceau
<gcottenc@gmail.com>
Fri, 3 Sep 2010 07:18:02 +0000
(09:18 +0200)
committer
Guillaume Cottenceau
<gcottenc@gmail.com>
Fri, 3 Sep 2010 07:18:02 +0000
(09:18 +0200)
lib/booh/rexml/element.rb
patch
|
blob
|
history
diff --git
a/lib/booh/rexml/element.rb
b/lib/booh/rexml/element.rb
index 2676fcff4efac990b426b84bd7a99fdf09da5c3b..fbc5d0c40ac997933ff775b2b202b655872a96a8 100644
(file)
--- a/
lib/booh/rexml/element.rb
+++ b/
lib/booh/rexml/element.rb
@@
-551,9
+551,13
@@
module REXML
#################################################
def attribute( name, namespace=nil )
#################################################
def attribute( name, namespace=nil )
- prefix = nil
- prefix = namespaces.index(namespace) if namespace
- attributes.get_attribute( "#{prefix ? prefix + ':' : ''}#{name}" )
+ prefix = nil
+ if namespaces.respond_to? :key
+ prefix = namespaces.key(namespace) if namespace
+ else
+ prefix = namespaces.index(namespace) if namespace
+ end
+ attributes.get_attribute( "#{prefix ? prefix + ':' : ''}#{name}" )
end
# Evaluates to +true+ if this element has any attributes set, false
end
# Evaluates to +true+ if this element has any attributes set, false