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

249 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada ffa9298076
Fixed a typo 2019-11-04 16:38:36 +09:00
Sutou Kouhei 412cd56766
Import REXML 3.2.3 (#2548) 2019-10-12 12:07:15 +09:00
Sutou Kouhei 2d8c037e97 [ruby/rexml] gemspec: update
https://github.com/ruby/rexml/commit/404bd99a7c
2019-08-04 11:56:02 +09:00
Kouhei Sutou 310a2a9860 [ruby/rexml] xpath: add missing value conversions for equality and relational expressions
GitHub: fix #18

Reported by Mirko Budszuhn. Thanks!!!

https://github.com/ruby/rexml/commit/0dca2a2ba0
2019-08-04 11:55:55 +09:00
Kouhei Sutou 39f275edf7 [ruby/rexml] xpath number: fix a bug that false is converted to NaN
GitHub: fix #18

It must be 0.

Reported by Mirko Budszuhn. Thanks!!!

https://github.com/ruby/rexml/commit/b48f3afa3b
2019-08-04 11:55:49 +09:00
Kouhei Sutou 643344dc94 [ruby/rexml] xpath local_name: fix a bug that nil is returned for nonexistent case
It must be an empty string.

https://github.com/ruby/rexml/commit/81bc7cd4f5
2019-08-04 11:55:43 +09:00
Kouhei Sutou 5f78b138b1 [ruby/rexml] xpath boolean: implement
https://github.com/ruby/rexml/commit/feb8ddb1ec
2019-08-04 11:55:37 +09:00
Kouhei Sutou 6ef8294397 [ruby/rexml] xpath: fix a bug for equality or relational expressions
GitHub: fix #17

There is a bug when they are used against node set. They should return
boolean value but they returned node set.

Reported by Mirko Budszuhn. Thanks!!!

https://github.com/ruby/rexml/commit/a02bf38440
2019-08-04 11:55:31 +09:00
Kouhei Sutou c46ba8e9a3 [ruby/rexml] Use PP
https://github.com/ruby/rexml/commit/185062a4a4
2019-08-04 11:55:26 +09:00
Kouhei Sutou 54525fbfd4 [ruby/rexml] xpath: add support for changing to debug mode by environment variable
https://github.com/ruby/rexml/commit/59378a16ea
2019-08-04 11:55:20 +09:00
Kouhei Sutou de55e0a008 [ruby/rexml] Bump version
https://github.com/ruby/rexml/commit/54452c103a
2019-08-04 11:55:14 +09:00
ujihisa f85caf40a6 [ruby/rexml] Message less confusing error to human (#16)
* Message less confusing error to human

* Problem: Following error message is not helpful, because you have to reason
  that '' actually means it's in the top-level, and the 'div' (not '</div>') is
  an end tag

        require "rexml/parsers/lightparser"
        REXML::Parsers::LightParser.new('</div>').parse
        #=> Missing end tag for '' (got 'div')

* Solution: add a special case in error handling just to change the error message

        require "rexml/parsers/lightparser"
        REXML::Parsers::LightParser.new('</div>').parse
        #=> Unexpected top-level end tag (got 'div')

* Refactor by removing unnecessary `md` check

* Thanks @a_matsuda to review this at asakusa.rb!

https://github.com/ruby/rexml/commit/f6528d4477
2019-08-04 11:55:03 +09:00
Alyssa Ross ee8985ef0e [ruby/rexml] Fix crash with nil XPath variables (#13)
Patch by Alyssa Ross. Thanks!!!
https://github.com/ruby/rexml/commit/2a53c54f58
2019-08-04 11:54:50 +09:00
FUJI Goro (gfx) 982208c650 [ruby/rexml] use #inspect to print meta-characters in error messages
https://github.com/ruby/rexml/commit/a124a19b9a
2019-08-04 11:54:44 +09:00
Kouhei Sutou 81354bbd1b [ruby/rexml] Bump version
https://github.com/ruby/rexml/commit/c0e3f14564
2019-08-04 11:54:38 +09:00
Kouhei Sutou 0f18bc7fca [ruby/rexml] Fix attribute's default namespace behavior
NOTE: It's a backward incompatible change. If we have any serious
problems with this change, we may revert this change.

The XML namespace specification says the default namespace doesn't
apply to attribute names but it does in REXML without this change:

https://www.w3.org/TR/xml-names/#uniqAttrs

> the default namespace does not apply to attribute names

REXML reports a parse error for the following XML that is described as
a valid XML in the XML nsmaspace specification without this change:

    <!-- http://www.w3.org is bound to n1 and is the default -->
    <x xmlns:n1="http://www.w3.org"
       xmlns="http://www.w3.org" >
      <good a="1"     b="2" />
      <good a="1"     n1:a="2" />
    </x>

If attribute doesn't have prefix, the attribute should return "" for
both #prefix and #namespace.

https://github.com/ruby/rexml/commit/9e4fd552bc
2019-08-04 11:54:27 +09:00
Kouhei Sutou 9b36f0a787 [ruby/rexml] Format
https://github.com/ruby/rexml/commit/2384586811
2019-08-04 11:54:22 +09:00
Kouhei Sutou 84c3742466 [ruby/rexml] Revert "xpath: remove needless nil check"
This reverts commit 61b73c1bf8dc64d97fba7f0a8c503c24b11313f5.

"*:local_name" becomes prefix=nil.

https://github.com/ruby/rexml/commit/9e7dd4cd4e
2019-08-04 11:54:16 +09:00
Kouhei Sutou 096e766355 [ruby/rexml] xpath: remove needless nil check
It must not be nil.

https://github.com/ruby/rexml/commit/61b73c1bf8
2019-08-04 11:54:11 +09:00
Kouhei Sutou 27c11892c8 [ruby/rexml] Add a TODO for Attribute#namespace
https://github.com/ruby/rexml/commit/70310a06e5
2019-08-04 11:54:05 +09:00
Kouhei Sutou 3583fa166c [ruby/rexml] xpath: fix a bug that no namespace attribute isn't matched with prefix
[ruby-list:50733]

Reported by Yasuhiro KIMURA. Thanks!!!

https://github.com/ruby/rexml/commit/8f3c5c176a
2019-08-04 11:54:00 +09:00
Kouhei Sutou f76cfb55d7 [ruby/rexml] Bump version
https://github.com/ruby/rexml/commit/0f79e71210
2019-08-04 11:53:49 +09:00
kazu 44aaff6d31 [DOC] Fix close tags [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 09:10:10 +00:00
kou 04e0609a06 Import REXML 3.1.9
It restores removed REXML::Parsers::BaseParser::UNQME_STR.
Because it's used by kramdown.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-25 02:26:30 +00:00
kou 0d1abb904e rexml: upgrade to 3.1.8
See https://github.com/ruby/rexml/blob/master/NEWS.md for change summary.

Changes for spec/ has been reported: https://github.com/ruby/spec/pull/639


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-20 02:49:10 +00:00
marcandre e859e668d2 lib/*: Prefer require_relative over require.
[#15206] [Fix GH-1976]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 17:52:33 +00:00
stomar ef0615b6ef default gems: add missing comment in gemspec
* lib/csv/csv.gemspec: [DOC] add comment for require fallback
  in Ruby repository.

* lib/logger.gemspec: ditto.
* lib/prime.gemspec: ditto.
* lib/rexml/rexml.gemspec: ditto.
* lib/rss/rss.gemspec: ditto.
* lib/webrick/webrick.gemspec: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-12 19:58:11 +00:00
hsbt d59fc41fba Fallback to load version constant for ruby core repository.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-07 12:32:29 +00:00
hsbt 4973f30474 Fixed wrong require path
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-02 07:04:28 +00:00
hsbt 0f5b67526a Promote REXML to default gems.
* upstream repostiory is https://github.com/ruby/rexml

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-02 06:02:51 +00:00
kou 766ee6e550 rexml: Suppress warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-01 03:12:37 +00:00
kou 1d67b9de28 rexml: disable XPath 1.0 compatible "#{ELEMENT_NAME}" processing by default
It breaks backward compatibility than I thought. So it's disabled by
default. It means that REXML's XPath processor isn't compatible with
XPath 1.0. But it will be acceptable for users.

We can enable it by specifying "strict: true" to
REXML::XPathParser.new explicitly.

* lib/rexml/xpath.rb,
  lib/rexml/xpath_parser.rb: Accept "strict: true" option.

* test/rexml/test_contrib.rb,
  test/rexml/xpath/test_base.rb: Use not XPath 1.0 compatible behavior.

* test/rexml/test_jaxen.rb: Use XPath 1.0 compatible behavior.

* test/rss/test_1.0.rb,
  test/rss/test_dublincore.rb,
  spec/ruby/library/rexml/element/namespace_spec.rb,
  spec/ruby/library/rexml/element/namespaces_spec.rb,
  spec/ruby/library/rexml/element/prefixes_spec.rb: Enable again.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28 01:36:18 +00:00
kou 7a6f34103d rexml: Fix XPath bug of //#{ELEMENT_NAME}[#{POSITION}]
The position should be counted for each nodeset but the previous
implementation counts position for union-ed nodeset.

For example, "/a/*/*[1]" should be matched to "<c1/>" and "<c2/>" with
the following XML.

    <a>
      <b>
        <c1/>
      </b>
      <b>
        <c2/>
      </b>
    </a>

But the previous implementation just returns only "<c1/>".

* lib/rexml/element.rb (REXML::Attributes#each_attribute):
  Support Enumerator for no block use.

* lib/rexml/element.rb (REXML::Attributes#each):
  Support Enumerator for no block use.

* lib/rexml/functions.rb (REXML::Functions.string):
  Support NaN again.

* lib/rexml/xpath_parser.rb: Re-implement "Step" evaluator.
  It should evaluate "AxisSpecifier", "NodeTest" and "Predicate" in one
  step to respect position for each nodeset.

* test/rexml/test_jaxen.rb: Enable more tests. Remained tests should
  be also enabled but it'll not be near future.

* test/rexml/xpath/test_base.rb: Fix expected value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 09:38:06 +00:00
kou 4d15e619eb rexml: Fix XPath bug of /#{ELEMENT_NAME}
It doesn't mean that all elements which name "ELEMENT_NAME" with any
namespace URI including null namespace URI. It means that all elements
which name "ELEMENT_NAME" with null namespace URI.

https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-NodeTest

> if the QName does not have a prefix, then the namespace URI is null
> (this is the same way attribute names are expanded).

We need to use "*[local-name()='#{ELEMENT_NAME}']" for all elements
which name "ELEMENT_NAME" with any namespace URI including null
namespace URI in XPath 1.0. But it's inconvenient. So this change
includes "*:#{LOCAL_NAME}" syntax support that is introduced since
XPath 2.0.

* lib/rexml/parsers/xpathparser.rb: Support "*:#{LOCAL_NAME}" syntax that
  is introduced since XPath 2.0.

* lib/rexml/xpath_parser.rb:
  * Fix namespace URI processing for "#{ELEMENT_NAME}". Now,
    "#{ELEMENT_NAME}" doesn't accept elements with null namespace URI.
  * Add "*:#{LOCAL_NAME}" support.

* test/rexml/test_contrib.rb,
  test/rexml/test_core.rb,
  test/rexml/xpath/test_base.rb: Follow this change.

* test/rexml/test_jaxen.rb: Fix namespace processing.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-22 08:09:04 +00:00
kou da89931dcc rexml: Fix XPath concat() implementation
* lib/rexml/functions.rb (REXML::Functions.concat): Implement.

* test/rexml/test_jaxen.rb: Enable one more test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 06:43:58 +00:00
kou 6793c0a227 rexml: Fix XPath string() implementation
* lib/rexml/functions.rb( REXML::Functions.string):
  * Support context node.
  * Fix implementation for document node to remove out of root nodes.
  * Support processing instruction node.
  * Improve implementation for integer to omit decimals.

* test/rexml/test_jaxen.rb: Enable processing instruction test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21 06:39:43 +00:00
kou 9090241e61 rexml: Fix a XPath bug that white spaces aren't ignored
lib/rexml/parsers/xpathparser.rb: Ignore white spaces in relative
location path.

test/rexml/xpath/test_base.rb: Add more test patterns and use more
debug friendly assertion style.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-19 21:34:40 +00:00
kou e0f7bb39b7 rexml: Fix a XPath bug of -
[Bug #14600]

* lib/rexml/parsers/xpathparser.rb: Fix a bug that "N-M" requires a space
  before "-".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-09 16:00:49 +00:00
kou e440bfaed1 rexml: Fix a XPath bug of /child::node()
[Bug #14600]
    
* lib/rexml/xpath_parser.rb: Fix a bug that "/child::node()" returns
  XML declaration and text nodes out of root element.

* test/rexml/test_jaxen.rb: Enable more tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 06:53:57 +00:00
kou 478d3dffa2 rexml: Add codes for debugging XPath logic
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 06:51:07 +00:00
kou 1d6ca665f5 rexml: Fix a XPath bug of function()/path
[Bug #14600]
    
* lib/rexml/functions.rb: Fix a bug that "function()/path" always returns
  nothing.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 06:36:06 +00:00
kou b537823f3d rexml: Fix a XPath bug of @attribute/parent
[Bug #14600]
    
* lib/rexml/functions.rb: Fix a bug that "@attribute/parent" doesn't
  return element of its attribute.

* test/rexml/test_jaxen.rb: Enable more tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 03:27:20 +00:00
kou d050a28f76 rexml: Fix a XPath bug of $variable
[Bug #14600]
    
* lib/rexml/functions.rb: Fix a bug that "$variable" returns
  node instead of ndoe set.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 03:26:01 +00:00
kou c592ce4023 rexml: Fix a XPath bug of name(node-set)
[Bug #14600]
    
* lib/rexml/functions.rb: Fix a bug that "name(node-set)" returns
  element instead of element name.
  
* test/rexml/test_jaxen.rb: Enable more tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 15:51:08 +00:00
kou f0c734660f Start re-enabling Jaxen tests
[Bug #14600]
Reported by MSP-Greg. Thanks!!!

* lib/rexml/xpath_parser.rb: Fix a bug that "following_siblings::*[N]"
  doesn't work.

* test/rexml/test_jaxen.rb: Enable only axis test for now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-01 16:17:52 +00:00
shyouhei f2a91397fd Add uplevel keyword to Kernel#warn and use it
If uplevel keyword is given, the warning message is prepended
with caller file and line information and the string "warning: ".
The use of the uplevel keyword makes Kernel#warn format output
similar to how rb_warn formats output.

This patch modifies net/ftp and net/imap to use Kernel#warn
instead of $stderr.puts or $stderr.printf, since they are used
for printing warnings.

This makes lib/cgi/core and tempfile use $stderr.puts instead of
warn for debug logging, since they are used for debug printing
and not for warning.

This does not modify bundler, rubygems, or rdoc, as those are
maintained outside of ruby and probably wish to remain backwards
compatible with older ruby versions.

rb_warn_m code is originally from nobu, but I've changed it
so that it only includes the path and lineno from uplevel
(not the method), and also prepends the string "warning: ",
to make it more similar to rb_warn.

From: Jeremy Evans code@jeremyevans.net
Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 11:56:25 +00:00
stomar 71e3a3e8e3 rexml: improve docs
* lib/rexml/entity.rb: [DOC] drop a pointless comment.
  Reported by Michael Gee (mikegee).  [Fix GH-1736]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-02 20:06:38 +00:00
duerst fda0371535 fix documentation of REXML::Formatters::Default (id_hack -> ie_hack) [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-14 16:04:35 +00:00
kou 2bbc30520f REXML: Fix a bug that unexpected methods can be called as a XPath function
[HackerOne:249295]

Reported by Andrea Jegher. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-13 12:14:24 +00:00
kou cff3941b81 rexml: Remove needless document
[Fix GH-1671]

Patch by madblobfish. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-28 14:16:17 +00:00