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

31 Коммитов

Автор SHA1 Сообщение Дата
naruse 3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
kou 9f4ab1c69d * test/rexml/test_document.rb: Indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 12:29:21 +00:00
kou 64f9f1ba58 * test/rexml/test_document.rb
(REXMLTests::TestDocument::EntityExpansionLimitTest):
  Group tests by general entity and parameter entity.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:47:34 +00:00
kou a38971c595 * test/rexml/test_document.rb
(REXMLTests::TestDocument::EntityExpansionLimitTest): Define
  test XML in each test method because (1) each XML in used only
  one test and (2) related data and code should be close.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:45:27 +00:00
kou a5406b873c * test/rexml/test_document.rb
(REXMLTests::TestDocument::EntityExpansionLimitTest):
  Use one test method for one test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:40:47 +00:00
kou a4a2fbdf64 * test/rexml/test_document.rb
(REXMLTests::TestDocument::EntityExpansionLimitTest): Use
  setup and teardown instead of ensure in test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:17:33 +00:00
kou 9fb2d21d7d * test/rexml/test_document.rb
(REXMLTests::TestDocument::EntityExpansionLimitTest): Indent.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:13:31 +00:00
kou f2588e1c8e * test/rexml/test_document.rb (REXMLTests::TestDocument): Group
entity expansion limit related tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:12:20 +00:00
kou 1e326bb0e5 * test/rexml/test_document.rb (REXMLTests::TestDocument::BomTest):
Fix wrong parent class. It doesn't need inherit tests in
  TestDocument class.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15 11:09:57 +00:00
nagachika 2e8f953d68 * lib/rexml/document.rb: add REXML::Document#document.
reported by Tomas Hoger <thoger@redhat.com> and patched by nahi.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13 13:29:50 +00:00
usa 9cdd297a29 * lib/rexml/entity.rb: keep the entity size within the limitation.
reported by Willis Vandevanter <will@silentrobots.com> and
  patched by nahi.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-27 11:18:02 +00:00
kou 3c908895ab * test/rexml/test_document.rb: Indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-27 13:24:39 +00:00
kou 875f071500 * test/rexml/test_document.rb: Wrap by REXMLTests module.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-27 13:15:58 +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
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 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 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 46ff009168 * lib/rexml/source.rb: force_encoding("UTF-8") when the input
is already UTF-8. patched by Kouhei Sutou [ruby-core:23404]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-14 13:11:11 +00:00
nobu cff7d0c80e * 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].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-29 01:36:26 +00:00
tenderlove 197eea3404 * lib/rexml/formatters/default.rb (write_attribute): fix an
exception when printing a document when duplicate namespaced
  attributes exist. Thanks, Alexey Froloff [ruby-core:2389]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-28 21:40:59 +00:00
shugo a324863b99 * lib/rexml/entity.rb (unnormalized): do not call
document.record_entity_expansion if document is nil.
  see <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502535>.
  Thanks, Naohisa Goto.
* test/rexml/test_document.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-06 17:03:40 +00:00
shugo 364b083425 * test/rexml/test_document.rb: removed garbage.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-13 01:43:51 +00:00
shugo cb9478ae04 * text/rexml/test_document.rb (test_entity_expansion_limit): added tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-13 01:40:36 +00:00
shugo bb1d005da6 * lib/rexml/document.rb: limit entity expansion.
* lib/rexml/entity.rb: ditto.
* test/rexml/test_document.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-01 13:41:38 +00:00