summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rexml/element.rb7
-rw-r--r--lib/rexml/encodings/SHIFT_JIS.rb2
-rw-r--r--lib/rexml/rexml.rb8
-rw-r--r--lib/rexml/xpath_parser.rb2
4 files changed, 12 insertions, 7 deletions
diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb
index b61d811141..d616d0311f 100644
--- a/lib/rexml/element.rb
+++ b/lib/rexml/element.rb
@@ -455,7 +455,12 @@ module REXML
# doc.root.text = 'Russell' #-> '<a><b/>Russell<c/></a>'
# doc.root.text = nil #-> '<a><b/><c/></a>'
def text=( text )
- text = Text.new( text, whitespace(), nil, raw() ) if text.kind_of? String
+ if text.kind_of? String
+ text = Text.new( text, whitespace(), nil, raw() )
+ else
+ text = Text.new( text.to_s, whitespace(), nil, raw() ) unless text.kind_of? Text
+ end
+
old_text = get_text
if text.nil?
old_text.remove unless old_text.nil?
diff --git a/lib/rexml/encodings/SHIFT_JIS.rb b/lib/rexml/encodings/SHIFT_JIS.rb
index e355704a7c..6e8f759373 100644
--- a/lib/rexml/encodings/SHIFT_JIS.rb
+++ b/lib/rexml/encodings/SHIFT_JIS.rb
@@ -1 +1 @@
-require 'rexml/encodings/SHIFT-JIS'
+require 'rexml/encodings/Shift-JIS'
diff --git a/lib/rexml/rexml.rb b/lib/rexml/rexml.rb
index 67b36a87f6..f14b1902d6 100644
--- a/lib/rexml/rexml.rb
+++ b/lib/rexml/rexml.rb
@@ -2,8 +2,8 @@
#
# URL: http://www.germane-software.com/software/rexml
# Author: Sean Russell <ser@germane-software.com>
-# Version: @ANT_VERSION@
-# Date: @ANT_DATE@
+# Version: 3.0.1
+# Date: +2004/093
@@ -21,6 +21,6 @@
# A tutorial is available in docs/tutorial.html
module REXML
Copyright = "Copyright © 2001, 2002, 2003, 2004 Sean Russell <ser@germane-software.com>"
- Date = "+2004/088"
- Version = "3.0.0"
+ Date = "+2004/093"
+ Version = "3.0.1"
end
diff --git a/lib/rexml/xpath_parser.rb b/lib/rexml/xpath_parser.rb
index 377a51e885..d58e75ebdb 100644
--- a/lib/rexml/xpath_parser.rb
+++ b/lib/rexml/xpath_parser.rb
@@ -321,7 +321,7 @@ module REXML
node_idx = []
np = node.node_type == :attribute ? node.element : node
while np.parent and np.parent.node_type == :element
- node_idx << np.parent.children.index( np )
+ node_idx << np.parent.index( np )
np = np.parent
end
new_arry << [ node_idx.reverse.join, node ]