Граф коммитов

67 Коммитов

Автор SHA1 Сообщение Дата
kou 4e44eeaeb1 * lib/rexml/text.rb (REXML::Text.normalize): Fix a bug that all
entity filters are ignored. [ruby-dev:47278] [Bug #8302]
  Patch by Ippei Obayashi. Thanks!!!
* test/rexml/test_entity.rb (EntityTester#test_entity_filter): Add
  a test of the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-26 14:36:30 +00:00
kou 562648e48c * lib/rexml/element.rb (REXML::Attributes#to_a): Support
namespaced attributes. [ruby-dev:47277] [Bug #8301]
  Patch by Ippei Obayashi. Thanks!!!
* test/rexml/test_attributes.rb
  (AttributesTester#test_to_a_with_namespaces): Add a test of the
  above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-26 13:56:34 +00:00
akr 8f671120f1 * test/csv/test_features.rb, test/logger/test_logger.rb
test/mkmf/test_have_macro.rb, test/net/http/test_http.rb,
  test/openssl/test_config.rb, test/psych/test_encoding.rb,
  test/psych/test_exception.rb, test/psych/test_psych.rb,
  test/psych/test_tainted.rb, test/readline/test_readline.rb,
  test/rexml/test_contrib.rb, test/ruby/test_autoload.rb,
  test/ruby/test_beginendblock.rb, test/ruby/test_exception.rb,
  test/ruby/test_file.rb, test/ruby/test_io.rb,
  test/ruby/test_marshal.rb, test/ruby/test_process.rb,
  test/ruby/test_require.rb, test/ruby/test_rubyoptions.rb,
  test/syslog/test_syslog_logger.rb, test/webrick/test_httpauth.rb,
  test/zlib/test_zlib.rb: Use Tempfile.create.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-20 23:03:52 +00:00
kou 3b6d093451 * lib/rexml/security.rb (REXML::Security): create.
* lib/rexml/rexml.rb: move entity_expansion_limit and
  entity_expansion_text_limit accessors to ...
* lib/rexml/security.rb: ... here.
* lib/rexml/document.rb: use REXML::Security.
* lib/rexml/text.rb: use REXML::Security.
* test/rexml/test_document.rb: use REXML::Security.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-27 12:24:31 +00:00
naruse ef33958094 Use require_relative to require local library
* from 1.9 require relative path from the file must use require_relative.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-24 13:10:46 +00:00
usa 1ad9075734 * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):
new attribute to read/write entity expansion text limit.  the default
  limit is 10Kb.

* lib/rexml/text.rb (REXML::Text.unnormalize): check above attribute.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-22 09:35:46 +00:00
nobu 13d3f023c6 test: remove or replace trailing spaces
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07 05:02:18 +00:00
kou ac9a8ac624 * lib/rexml/output.rb (REXML::Output): Don't output BOM in middle
of the output string.
* test/rexml/test_document.rb: Add a test for the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03 05:42:40 +00:00
kou 82aef2ae50 * test/rexml/test_document.rb: Fix tests that expect encoding name
isn't normalized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03 04:58:03 +00:00
kou bdbc8c5b74 Revert r37439 and r37441
r37439:
	* lib/rexml/xmldecl.rb (REXML::XMLDecl): Stop using REXML::Encoding
	  module because XMLDecl doesn't convert encoding. This causes
	  removing XML encoding name normalization (encoding.upcase).
	  Encoding name in XML declaration is what user specifies.
	  I think this is reasonable change.
	* test/rexml/test_xml_declaration.rb: Add tests for the above change.

r37441:
	* test/rexml/test_core.rb (Tester#test_ticket_88): Follow the
	  change that encoding name in XML declaration isn't normalized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03 04:46:06 +00:00
kou dbfb5deab6 * test/rexml/test_encoding.rb (EncodingTester#test_in_different_out):
Fix a test that expects encoding in XML declaration is changed by
  Output's encoding. It is dropped feature.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03 04:03:55 +00:00
kou 9c606a0a4c * test/rexml/test_core.rb (Tester#test_ticket_88): Follow the
change that encoding name in XML declaration isn't normalized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03 03:55:06 +00:00
kou 3f817764e2 * lib/rexml/document.rb (REXML::Document#write): Document encoding
option. Now different encoding between XML file's encoding and
  XML declaration's encodiong is support.
  [Feature #4872] (work in progress)
* lib/rexml/xmldecl.rb (REXML::XMLDecl#write): Always use XMLDecl's
  encoding.
* test/rexml/test_document.rb: Update tests for the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03 03:53:09 +00:00
kou 69eedf6a18 * lib/rexml/xmldecl.rb (REXML::XMLDecl): Stop using REXML::Encoding
module because XMLDecl doesn't convert encoding. This causes
  removing XML encoding name normalization (encoding.upcase).
  Encoding name in XML declaration is what user specifies.
  I think this is reasonable change.
* test/rexml/test_xml_declaration.rb: Add tests for the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03 03:41:26 +00:00
kou bd2024165c * test/rexml/test_xml_declaration.rb (TestXmlDeclaration#test_*):
Remove needless prefix from test names.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03 03:06:50 +00:00
kou 9a2dc8f9da * test/rexml/test_xml_declaration_parent_child.rb: Rename to ...
* test/rexml/test_xml_declaration.rb: ... this.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03 03:05:28 +00:00
kou 4e23505398 * test/rexml/test_document.rb: Remove needless indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 14:54:59 +00:00
kou 5f18ce9a02 * test/rexml/test_document.rb: Add tests for parsing XML encoded
by UTF-8 with BOM.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 14:53:07 +00:00
kou a7322e3678 * lib/rexml/parsers/baseparser.rb: Fix a bug that UTF-8 is used
for UTF-16XX encoded XML that doesn't have encoding="UTF-16" in
  XML declration.
* test/rexml/test_document.rb: Add tests for the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 12:42:37 +00:00
kou a750424cab * test/rexml/test_document.rb: Group tests that they parse
UTF-16XX encoded XML that has encoding="UTF-16" in XML declaration.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 12:39:37 +00:00
kou 100b3be9ae * test/rexml/test_document.rb: Add tests for parsing XML encoded
by UTF-16 with BOM.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 12:19:58 +00:00
kou af83fcfe4d * lib/rexml/document.rb (REXML::Document#write): Add :encoding option
to support custom XML encoding.
  [Feature #4872] (work in progress)
* test/rexml/test_document.rb: Add tests for the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 06:43:38 +00:00
kou de2e09e0bc * lib/rexml/document.rb (REXML::Document#write): Accept options
Hash as argument.
* test/rexml/test_document.rb: Add tests for the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 05:59:59 +00:00
naruse f6327e732f Suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-23 21:37:39 +00:00
nobu ff3b2cb1ce * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05 01:29:43 +00:00
nobu 63a164f32e test: fix test conditions
* test/csv/test_features.rb (TestCSV#test_gzip_reader_bug_fix): test
  only if zlib is available.

* test/csv/test_features.rb (TestCSV#test_gzip_writer_bug_fix): ditto.

* test/open-uri/test_open-uri.rb (TestOpenURI#test_content_encoding):
  ditto.

* test/rexml/test_order.rb (OrderTester#test_more_ordering): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-08 06:50:03 +00:00
kou 92cecf79b4 * lib/rexml/parsers/baseparser.rb, test/rexml/test_namespace.rb:
fix the default xml namespace URI validation.
  Reported by Miho Hiramatsu. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-02 12:42:27 +00:00
usa 0bfa4abd1b * test/rexml/test_order.rb (OrderTester#test_more_ordering): use
GZip::GzReader.open instead of GZip::GzReader.new with File.new.
  fixed a test error on Windows introduced at r33946.

* ChangeLog: mention the causes.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-08 04:31:56 +00:00
ayumin 379d519f0b * test/rexml/test_sax.rb: add require 'rexml/document.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-26 18:52:10 +00:00
ayumin 32b81702d7 fix test/rexml/test_encoding.rb failure
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 18:03:23 +00:00
kou 2bb6fcb6fd * lib/rexml/parsers/baseparser.rb, test/rexml/test_comment.rb:
allow a single hyphen in comment. [Bug 5278]
  Reported by Thomas Fritzsche. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 14:42:44 +00:00
kou da672779e2 * lib/rexml/formatters/pretty.rb
(REXML::Formatters::Pretty#write_text),
  test/rexml/test_core.rb
  (Tester#test_pretty_format_long_text_finite): don't ignore
  'width' parameter in pretty formatter. fixes #4498
  Reported by Michael Frasca. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11 07:29:48 +00:00
kou 962956e8a1 * test/rexml/test_core.rb
(Tester#test_pretty_format_long_text_finite): remove needless
  assert_nothing_raised.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11 07:12:12 +00:00
kou 80cb3351dd * lib/rexml/parsers/xpathparser.rb
(REXML::Parsers::XPathParser#parse),
  test/rexml/test_elements.rb
  (ElementsTester::test_each_with_frozen_condition):
  don't modify original XPath. fixes #4164
  Reported by Pavel Shved. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11 07:05:42 +00:00
kou 8aecece693 * test/rexml/test_elements.rb (ElementsTester): remove needless
prefix from test name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11 06:53:59 +00:00
kou 40e7d79391 * test/rexml/test_core.rb (Tester::test_text_frozen): split frozen
string test. refs #4783


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-27 14:57:55 +00:00
shyouhei 42f704a8fa prevent an error when passing a frozen string to REXML::Text.new
dup the string passed in instead of cloning so that it's frozen state is ignored

Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-27 02:34:23 +00:00
nobu 3a47cf3395 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 11:55:52 +00:00
naruse f25ff846f6 * lib/rexml/encoding.rb (REXML::Encoding#encoding=): store @encoding
a String which means the name of the encoding.
  this partially revert r29646.

* lib/rexml/document.rb: follow above.

* lib/rexml/output.rb: ditto.

* lib/rexml/parsers/baseparser.rb: ditto.

* lib/rexml/source.rb: ditto.

* lib/rexml/xmldecl.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-02 15:36:48 +00:00
naruse 84b96e1be4 Fix tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-19 12:43:27 +00:00
nobu 182b614869 * test/rexml/test_contrib.rb (ContribTester#test_pos): should not
use fixed path name for tests.  [ruby-dev:42827]
* test/rexml/test_sax.rb (SAX2Tester#test_socket): should not use
  fixed port for tests.  [ruby-dev:42828]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 21:25:49 +00:00
kou 40a5012381 * test/rexml/test_light.rb: really suppress a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-07 12:57:35 +00:00
kou d5e607eb52 * test/rexml/test_light.rb: suppress a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-07 12:55:12 +00:00
kou 9ce40aacef * lib/rexml/doctype.rb, test/rexml/test_doctype.rb: suppress warnings.
[ruby-core:33305]
  Reported by Aaron Patterson. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-07 12:10:23 +00:00
kou 1f70a6ba67 * test/rexml/test_doctype.rb: add Accessor to test case name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-07 11:32:45 +00:00
kou 25a6a3fd99 * test/rexml/test_doctype.rb: Doctype -> DocType.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-07 11:31:46 +00:00
kou eb20de889c * test/rexml/test_doctype_mixin.rb: rename to ...
* test/rexml/test_doctype.rb: ... this to remove needless name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-07 11:30:19 +00:00
kou 54142064c4 * test/rexml/test_core.rb
(Tester#test_pretty_format_long_text_finite): skip a test that
  uses long string on small memory system. [ruby-dev:42599]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-19 13:11:20 +00:00
kou 6fcd0b37b3 * lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
REXML::Formatters::Pretty#wrap used a recursive method call to
  format text.  This switches it to use an iterative approach.
  [ruby-core:33245]
  Patch by Jeremy Evans. Thanks!!!

* test/rexml/test_core.rb: add a test for it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-18 14:25:03 +00:00
kou 994f066f76 * lib/rexml/encoding.rb: use Ruby native encoding mechnism. [ruby-dev:42464]
* lib/rexml/encodings/: remove.

* lib/rexml/document.rb, lib/rexml/formatters/default.rb,
  lib/rexml/output.rb, lib/rexml/parseexception.rb,
  lib/rexml/parsers/baseparser.rb, lib/rexml/source.rb,
  lib/rexml/xmldecl.rb: use Ruby's native Encoding object.

* test/rexml/, test/rss/: follow the above encoding chagnes.

* NEWS: add REXML's incompatible change about encoding.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-30 12:10:56 +00:00