summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/rexml/parsers/baseparser.rb2
-rw-r--r--lib/rexml/rexml.rb2
-rw-r--r--test/rexml/test_document.rb29
-rw-r--r--version.h6
5 files changed, 40 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 933c343d4c..73a48b7521 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Dec 29 10:36:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::STANDALONE):
+ any number spaces can be placed between equal-sign and the value.
+ patch from Ed Howland in [ruby-core:27345].
+
Mon Dec 28 22:01:58 2009 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* test/ruby/test_marshal.rb: added tests for taintness propagation.
diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb
index fc2354a67f..c791b476f9 100644
--- a/lib/rexml/parsers/baseparser.rb
+++ b/lib/rexml/parsers/baseparser.rb
@@ -53,7 +53,7 @@ module REXML
VERSION = /\bversion\s*=\s*["'](.*?)['"]/um
ENCODING = /\bencoding\s*=\s*["'](.*?)['"]/um
- STANDALONE = /\bstandalone\s*=\s["'](.*?)['"]/um
+ STANDALONE = /\bstandalone\s*=\s*["'](.*?)['"]/um
ENTITY_START = /^\s*<!ENTITY/
IDENTITY = /^([!\*\w\-]+)(\s+#{NCNAME_STR})?(\s+["'](.*?)['"])?(\s+['"](.*?)["'])?/u
diff --git a/lib/rexml/rexml.rb b/lib/rexml/rexml.rb
index 95bc2a7f6d..d41718f9e7 100644
--- a/lib/rexml/rexml.rb
+++ b/lib/rexml/rexml.rb
@@ -25,7 +25,7 @@ module REXML
COPYRIGHT = "Copyright \xC2\xA9 2001-2006 Sean Russell <ser@germane-software.com>"
VERSION = "3.1.7.3"
DATE = "2007/275"
- REVISION = "$Revision$".gsub(/\$Revision:|\$/,'').strip
+ REVISION = %w$Revision$[1] || ''
Copyright = COPYRIGHT
Version = VERSION
diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb
index 0261e80b74..1ee1a1d414 100644
--- a/test/rexml/test_document.rb
+++ b/test/rexml/test_document.rb
@@ -2,6 +2,25 @@ require "rexml/document"
require "test/unit"
class REXML::TestDocument < Test::Unit::TestCase
+ def test_version_attributes_to_s
+ doc = REXML::Document.new(<<-eoxml)
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+ <svg id="svg2"
+ xmlns:sodipodi="foo"
+ xmlns:inkscape="bar"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ >
+ </svg>
+ eoxml
+
+ string = doc.to_s
+ assert_match('xmlns:sodipodi', string)
+ assert_match('xmlns:inkscape', string)
+ assert_match('sodipodi:version', string)
+ assert_match('inkscape:version', string)
+ end
+
def test_new
doc = REXML::Document.new(<<EOF)
<?xml version="1.0" encoding="UTF-8"?>
@@ -63,4 +82,14 @@ EOF
ensure
REXML::Document.entity_expansion_limit = 10000
end
+
+ def test_xml_declaration_standalone
+ bug2539 = '[ruby-core:27345]'
+ doc = REXML::Document.new('<?xml version="1.0" standalone="no" ?>')
+ assert_equal('no', doc.stand_alone?, bug2539)
+ doc = REXML::Document.new('<?xml version="1.0" standalone= "no" ?>')
+ assert_equal('no', doc.stand_alone?, bug2539)
+ doc = REXML::Document.new('<?xml version="1.0" standalone= "no" ?>')
+ assert_equal('no', doc.stand_alone?, bug2539)
+ end
end
diff --git a/version.h b/version.h
index 1ab2630db5..65c23d897c 100644
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
#define RUBY_VERSION "1.8.8"
-#define RUBY_RELEASE_DATE "2009-12-28"
+#define RUBY_RELEASE_DATE "2009-12-29"
#define RUBY_VERSION_CODE 188
-#define RUBY_RELEASE_CODE 20091228
+#define RUBY_RELEASE_CODE 20091229
#define RUBY_PATCHLEVEL -1
#define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 8
#define RUBY_RELEASE_YEAR 2009
#define RUBY_RELEASE_MONTH 12
-#define RUBY_RELEASE_DAY 28
+#define RUBY_RELEASE_DAY 29
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];