nokogiri 1.10.9-x64-mingw32 → 1.11.0.rc4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE-DEPENDENCIES.md +1015 -947
  3. data/README.md +24 -22
  4. data/ext/nokogiri/depend +476 -357
  5. data/ext/nokogiri/extconf.rb +485 -352
  6. data/ext/nokogiri/html_document.c +79 -78
  7. data/ext/nokogiri/html_sax_parser_context.c +2 -2
  8. data/ext/nokogiri/include/libexslt/exslt.h +102 -0
  9. data/ext/nokogiri/include/libexslt/exsltconfig.h +70 -0
  10. data/ext/nokogiri/include/libexslt/exsltexports.h +140 -0
  11. data/ext/nokogiri/include/libxml2/libxml/DOCBparser.h +96 -0
  12. data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +306 -0
  13. data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +147 -0
  14. data/ext/nokogiri/include/libxml2/libxml/SAX.h +173 -0
  15. data/ext/nokogiri/include/libxml2/libxml/SAX2.h +178 -0
  16. data/ext/nokogiri/include/libxml2/libxml/c14n.h +126 -0
  17. data/ext/nokogiri/include/libxml2/libxml/catalog.h +182 -0
  18. data/ext/nokogiri/include/libxml2/libxml/chvalid.h +230 -0
  19. data/ext/nokogiri/include/libxml2/libxml/debugXML.h +217 -0
  20. data/ext/nokogiri/include/libxml2/libxml/dict.h +79 -0
  21. data/ext/nokogiri/include/libxml2/libxml/encoding.h +245 -0
  22. data/ext/nokogiri/include/libxml2/libxml/entities.h +151 -0
  23. data/ext/nokogiri/include/libxml2/libxml/globals.h +508 -0
  24. data/ext/nokogiri/include/libxml2/libxml/hash.h +236 -0
  25. data/ext/nokogiri/include/libxml2/libxml/list.h +137 -0
  26. data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +163 -0
  27. data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +81 -0
  28. data/ext/nokogiri/include/libxml2/libxml/parser.h +1241 -0
  29. data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +644 -0
  30. data/ext/nokogiri/include/libxml2/libxml/pattern.h +100 -0
  31. data/ext/nokogiri/include/libxml2/libxml/relaxng.h +217 -0
  32. data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +958 -0
  33. data/ext/nokogiri/include/libxml2/libxml/schematron.h +142 -0
  34. data/ext/nokogiri/include/libxml2/libxml/threads.h +89 -0
  35. data/ext/nokogiri/include/libxml2/libxml/tree.h +1311 -0
  36. data/ext/nokogiri/include/libxml2/libxml/uri.h +94 -0
  37. data/ext/nokogiri/include/libxml2/libxml/valid.h +458 -0
  38. data/ext/nokogiri/include/libxml2/libxml/xinclude.h +129 -0
  39. data/ext/nokogiri/include/libxml2/libxml/xlink.h +189 -0
  40. data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +366 -0
  41. data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +146 -0
  42. data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +945 -0
  43. data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +153 -0
  44. data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +224 -0
  45. data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +57 -0
  46. data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +428 -0
  47. data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +222 -0
  48. data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +88 -0
  49. data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +246 -0
  50. data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +151 -0
  51. data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +140 -0
  52. data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +202 -0
  53. data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +485 -0
  54. data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +488 -0
  55. data/ext/nokogiri/include/libxml2/libxml/xpath.h +566 -0
  56. data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +632 -0
  57. data/ext/nokogiri/include/libxml2/libxml/xpointer.h +114 -0
  58. data/ext/nokogiri/include/libxslt/attributes.h +38 -0
  59. data/ext/nokogiri/include/libxslt/documents.h +93 -0
  60. data/ext/nokogiri/include/libxslt/extensions.h +262 -0
  61. data/ext/nokogiri/include/libxslt/extra.h +72 -0
  62. data/ext/nokogiri/include/libxslt/functions.h +78 -0
  63. data/ext/nokogiri/include/libxslt/imports.h +75 -0
  64. data/ext/nokogiri/include/libxslt/keys.h +53 -0
  65. data/ext/nokogiri/include/libxslt/namespaces.h +68 -0
  66. data/ext/nokogiri/include/libxslt/numbersInternals.h +73 -0
  67. data/ext/nokogiri/include/libxslt/pattern.h +84 -0
  68. data/ext/nokogiri/include/libxslt/preproc.h +43 -0
  69. data/ext/nokogiri/include/libxslt/security.h +104 -0
  70. data/ext/nokogiri/include/libxslt/templates.h +77 -0
  71. data/ext/nokogiri/include/libxslt/transform.h +207 -0
  72. data/ext/nokogiri/include/libxslt/variables.h +118 -0
  73. data/ext/nokogiri/include/libxslt/xslt.h +110 -0
  74. data/ext/nokogiri/include/libxslt/xsltInternals.h +1978 -0
  75. data/ext/nokogiri/include/libxslt/xsltconfig.h +180 -0
  76. data/ext/nokogiri/include/libxslt/xsltexports.h +142 -0
  77. data/ext/nokogiri/include/libxslt/xsltlocale.h +76 -0
  78. data/ext/nokogiri/include/libxslt/xsltutils.h +313 -0
  79. data/ext/nokogiri/nokogiri.c +34 -40
  80. data/ext/nokogiri/nokogiri.h +26 -17
  81. data/ext/nokogiri/xml_document.c +18 -4
  82. data/ext/nokogiri/xml_io.c +8 -6
  83. data/ext/nokogiri/xml_node.c +21 -1
  84. data/ext/nokogiri/xml_node_set.c +1 -1
  85. data/ext/nokogiri/xml_reader.c +6 -17
  86. data/ext/nokogiri/xml_relax_ng.c +29 -11
  87. data/ext/nokogiri/xml_sax_parser.c +2 -7
  88. data/ext/nokogiri/xml_sax_parser_context.c +2 -2
  89. data/ext/nokogiri/xml_schema.c +55 -13
  90. data/ext/nokogiri/xml_xpath_context.c +80 -4
  91. data/ext/nokogiri/xslt_stylesheet.c +1 -8
  92. data/lib/nokogiri.rb +4 -21
  93. data/lib/nokogiri/2.5/nokogiri.so +0 -0
  94. data/lib/nokogiri/2.6/nokogiri.so +0 -0
  95. data/lib/nokogiri/2.7/nokogiri.so +0 -0
  96. data/lib/nokogiri/3.0/nokogiri.so +0 -0
  97. data/lib/nokogiri/css.rb +1 -0
  98. data/lib/nokogiri/css/node.rb +1 -0
  99. data/lib/nokogiri/css/parser.rb +63 -62
  100. data/lib/nokogiri/css/parser.y +2 -2
  101. data/lib/nokogiri/css/parser_extras.rb +39 -36
  102. data/lib/nokogiri/css/syntax_error.rb +1 -0
  103. data/lib/nokogiri/css/tokenizer.rb +1 -0
  104. data/lib/nokogiri/css/xpath_visitor.rb +73 -43
  105. data/lib/nokogiri/decorators/slop.rb +1 -0
  106. data/lib/nokogiri/html.rb +1 -0
  107. data/lib/nokogiri/html/builder.rb +1 -0
  108. data/lib/nokogiri/html/document.rb +13 -26
  109. data/lib/nokogiri/html/document_fragment.rb +1 -0
  110. data/lib/nokogiri/html/element_description.rb +1 -0
  111. data/lib/nokogiri/html/element_description_defaults.rb +1 -0
  112. data/lib/nokogiri/html/entity_lookup.rb +1 -0
  113. data/lib/nokogiri/html/sax/parser.rb +1 -0
  114. data/lib/nokogiri/html/sax/parser_context.rb +1 -0
  115. data/lib/nokogiri/html/sax/push_parser.rb +1 -0
  116. data/lib/nokogiri/jruby/dependencies.rb +20 -0
  117. data/lib/nokogiri/syntax_error.rb +1 -0
  118. data/lib/nokogiri/version.rb +3 -109
  119. data/lib/nokogiri/version/constant.rb +5 -0
  120. data/lib/nokogiri/version/info.rb +182 -0
  121. data/lib/nokogiri/xml.rb +1 -0
  122. data/lib/nokogiri/xml/attr.rb +1 -0
  123. data/lib/nokogiri/xml/attribute_decl.rb +1 -0
  124. data/lib/nokogiri/xml/builder.rb +3 -2
  125. data/lib/nokogiri/xml/cdata.rb +1 -0
  126. data/lib/nokogiri/xml/character_data.rb +1 -0
  127. data/lib/nokogiri/xml/document.rb +20 -15
  128. data/lib/nokogiri/xml/document_fragment.rb +5 -6
  129. data/lib/nokogiri/xml/dtd.rb +1 -0
  130. data/lib/nokogiri/xml/element_content.rb +1 -0
  131. data/lib/nokogiri/xml/element_decl.rb +1 -0
  132. data/lib/nokogiri/xml/entity_decl.rb +1 -0
  133. data/lib/nokogiri/xml/entity_reference.rb +1 -0
  134. data/lib/nokogiri/xml/namespace.rb +1 -0
  135. data/lib/nokogiri/xml/node.rb +587 -249
  136. data/lib/nokogiri/xml/node/save_options.rb +1 -0
  137. data/lib/nokogiri/xml/node_set.rb +1 -0
  138. data/lib/nokogiri/xml/notation.rb +1 -0
  139. data/lib/nokogiri/xml/parse_options.rb +10 -3
  140. data/lib/nokogiri/xml/pp.rb +1 -0
  141. data/lib/nokogiri/xml/pp/character_data.rb +1 -0
  142. data/lib/nokogiri/xml/pp/node.rb +1 -0
  143. data/lib/nokogiri/xml/processing_instruction.rb +1 -0
  144. data/lib/nokogiri/xml/reader.rb +7 -3
  145. data/lib/nokogiri/xml/relax_ng.rb +7 -2
  146. data/lib/nokogiri/xml/sax.rb +1 -0
  147. data/lib/nokogiri/xml/sax/document.rb +1 -0
  148. data/lib/nokogiri/xml/sax/parser.rb +1 -0
  149. data/lib/nokogiri/xml/sax/parser_context.rb +1 -0
  150. data/lib/nokogiri/xml/sax/push_parser.rb +1 -0
  151. data/lib/nokogiri/xml/schema.rb +13 -4
  152. data/lib/nokogiri/xml/searchable.rb +25 -16
  153. data/lib/nokogiri/xml/syntax_error.rb +1 -0
  154. data/lib/nokogiri/xml/text.rb +1 -0
  155. data/lib/nokogiri/xml/xpath.rb +1 -0
  156. data/lib/nokogiri/xml/xpath/syntax_error.rb +1 -0
  157. data/lib/nokogiri/xml/xpath_context.rb +1 -0
  158. data/lib/nokogiri/xslt.rb +1 -0
  159. data/lib/nokogiri/xslt/stylesheet.rb +1 -0
  160. data/lib/xsd/xmlparser/nokogiri.rb +1 -0
  161. metadata +140 -57
  162. data/lib/nokogiri/2.3/nokogiri.so +0 -0
  163. data/lib/nokogiri/2.4/nokogiri.so +0 -0
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  class Node
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  ####
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  class Notation < Struct.new(:name, :public_id, :system_id)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  ###
@@ -5,11 +6,11 @@ module Nokogiri
5
6
  #
6
7
  # == Building combinations of parse options
7
8
  # You can build your own combinations of these parse options by using any of the following methods:
8
- # *Note*: All examples attempt to set the +RECOVER+ & +NOENT+ options. All examples use Ruby 2 optional parameter syntax.
9
+ # *Note*: All examples attempt to set the +RECOVER+ & +NOENT+ options.
9
10
  # [Ruby's bitwise operators] You can use the Ruby bitwise operators to set various combinations.
10
- # Nokogiri.XML('<content>Chapter 1</content', options: Nokogiri::XML::ParseOptions.new((1 << 0) | (1 << 1)))
11
+ # Nokogiri.XML('<content>Chapter 1</content', nil, nil, Nokogiri::XML::ParseOptions.new((1 << 0) | (1 << 1)))
11
12
  # [Method chaining] Every option has an equivalent method in lowercase. You can chain these methods together to set various combinations.
12
- # Nokogiri.XML('<content>Chapter 1</content', options: Nokogiri::XML::ParseOptions.new.recover.noent)
13
+ # Nokogiri.XML('<content>Chapter 1</content', nil, nil, Nokogiri::XML::ParseOptions.new.recover.noent)
13
14
  # [Using Ruby Blocks] You can also setup parse combinations in the block passed to Nokogiri.XML or Nokogiri.HTML
14
15
  # Nokogiri.XML('<content>Chapter 1</content') {|config| config.recover.noent}
15
16
  #
@@ -72,6 +73,8 @@ module Nokogiri
72
73
  DEFAULT_XML = RECOVER | NONET
73
74
  # the default options used for parsing HTML documents
74
75
  DEFAULT_HTML = RECOVER | NOERROR | NOWARNING | NONET
76
+ # the default options used for parsing XML schemas
77
+ DEFAULT_SCHEMA = NONET
75
78
 
76
79
  attr_accessor :options
77
80
  def initialize options = STRICT
@@ -106,6 +109,10 @@ module Nokogiri
106
109
  @options & RECOVER == STRICT
107
110
  end
108
111
 
112
+ def ==(other)
113
+ other.to_i == to_i
114
+ end
115
+
109
116
  alias :to_i :options
110
117
 
111
118
  def inspect
@@ -1,2 +1,3 @@
1
+ # frozen_string_literal: true
1
2
  require 'nokogiri/xml/pp/node'
2
3
  require 'nokogiri/xml/pp/character_data'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  module PP
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  module PP
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  class ProcessingInstruction < Node
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  ###
@@ -87,9 +88,12 @@ module Nokogiri
87
88
  ###
88
89
  # Get a list of attributes for the current node.
89
90
  def attributes
90
- Hash[attribute_nodes.map { |node|
91
- [node.name, node.to_s]
92
- }].merge(namespaces || {})
91
+ attrs_hash = attribute_nodes.each_with_object({}) do |node, hash|
92
+ hash[node.name] = node.to_s
93
+ end
94
+ ns = namespaces
95
+ attrs_hash.merge!(ns) if ns
96
+ attrs_hash
93
97
  end
94
98
 
95
99
  ###
@@ -1,11 +1,12 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  class << self
4
5
  ###
5
6
  # Create a new Nokogiri::XML::RelaxNG document from +string_or_io+.
6
7
  # See Nokogiri::XML::RelaxNG for an example.
7
- def RelaxNG string_or_io
8
- RelaxNG.new(string_or_io)
8
+ def RelaxNG(string_or_io, options = ParseOptions::DEFAULT_SCHEMA)
9
+ RelaxNG.new(string_or_io, options)
9
10
  end
10
11
  end
11
12
 
@@ -26,6 +27,10 @@ module Nokogiri
26
27
  # end
27
28
  #
28
29
  # The list of errors are Nokogiri::XML::SyntaxError objects.
30
+ #
31
+ # NOTE: RelaxNG input is always treated as TRUSTED documents, meaning that they will cause the
32
+ # underlying parsing libraries to access network resources. This is counter to Nokogiri's
33
+ # "untrusted by default" security policy, but is a limitation of the underlying libraries.
29
34
  class RelaxNG < Nokogiri::XML::Schema
30
35
  end
31
36
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'nokogiri/xml/sax/document'
2
3
  require 'nokogiri/xml/sax/parser_context'
3
4
  require 'nokogiri/xml/sax/parser'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  ###
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  module SAX
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  module SAX
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  module SAX
@@ -1,11 +1,12 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  class << self
4
5
  ###
5
6
  # Create a new Nokogiri::XML::Schema object using a +string_or_io+
6
7
  # object.
7
- def Schema string_or_io
8
- Schema.new(string_or_io)
8
+ def Schema(string_or_io, options = ParseOptions::DEFAULT_SCHEMA)
9
+ Schema.new(string_or_io, options)
9
10
  end
10
11
  end
11
12
 
@@ -26,15 +27,23 @@ module Nokogiri
26
27
  # end
27
28
  #
28
29
  # The list of errors are Nokogiri::XML::SyntaxError objects.
30
+ #
31
+ # NOTE: As of v1.11.0, Schema treats inputs as UNTRUSTED by default, and so external entities
32
+ # are not resolved from the network (`http://` or `ftp://`). Previously, parsing treated
33
+ # documents as "trusted" by default which was counter to Nokogiri's "untrusted by default"
34
+ # security policy. If a document is trusted, then the caller may turn off the NONET option via
35
+ # the ParseOptions to re-enable external entity resolution over a network connection.
29
36
  class Schema
30
37
  # Errors while parsing the schema file
31
38
  attr_accessor :errors
39
+ # The Nokogiri::XML::ParseOptions used to parse the schema
40
+ attr_accessor :parse_options
32
41
 
33
42
  ###
34
43
  # Create a new Nokogiri::XML::Schema object using a +string_or_io+
35
44
  # object.
36
- def self.new string_or_io
37
- from_document Nokogiri::XML(string_or_io)
45
+ def self.new string_or_io, options = ParseOptions::DEFAULT_SCHEMA
46
+ from_document(Nokogiri::XML(string_or_io), options)
38
47
  end
39
48
 
40
49
  ###
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  #
@@ -11,7 +12,9 @@ module Nokogiri
11
12
  # Regular expression used by Searchable#search to determine if a query
12
13
  # string is CSS or XPath
13
14
  LOOKS_LIKE_XPATH = /^(\.\/|\/|\.\.|\.$)/
14
-
15
+
16
+ # @!group Searching via XPath or CSS Queries
17
+
15
18
  ###
16
19
  # call-seq: search *paths, [namespace-bindings, xpath-variable-bindings, custom-handler-class]
17
20
  #
@@ -45,7 +48,7 @@ module Nokogiri
45
48
  # )
46
49
  #
47
50
  # See Searchable#xpath and Searchable#css for further usage help.
48
- def search *args
51
+ def search(*args)
49
52
  paths, handler, ns, binds = extract_params(args)
50
53
 
51
54
  xpaths = paths.map(&:to_s).map do |path|
@@ -54,6 +57,7 @@ module Nokogiri
54
57
 
55
58
  xpath(*(xpaths + [ns, handler, binds].compact))
56
59
  end
60
+
57
61
  alias :/ :search
58
62
 
59
63
  ###
@@ -63,9 +67,10 @@ module Nokogiri
63
67
  # result. +paths+ must be one or more XPath or CSS queries.
64
68
  #
65
69
  # See Searchable#search for more information.
66
- def at *args
70
+ def at(*args)
67
71
  search(*args).first
68
72
  end
73
+
69
74
  alias :% :at
70
75
 
71
76
  ###
@@ -101,7 +106,7 @@ module Nokogiri
101
106
  # found in an XML document, where tags names are case-sensitive
102
107
  # (e.g., "H1" is distinct from "h1").
103
108
  #
104
- def css *args
109
+ def css(*args)
105
110
  rules, handler, ns, _ = extract_params(args)
106
111
 
107
112
  css_internal self, rules, handler, ns
@@ -114,7 +119,7 @@ module Nokogiri
114
119
  # match. +rules+ must be one or more CSS selectors.
115
120
  #
116
121
  # See Searchable#css for more information.
117
- def at_css *args
122
+ def at_css(*args)
118
123
  css(*args).first
119
124
  end
120
125
 
@@ -148,7 +153,7 @@ module Nokogiri
148
153
  # end
149
154
  # }.new)
150
155
  #
151
- def xpath *args
156
+ def xpath(*args)
152
157
  paths, handler, ns, binds = extract_params(args)
153
158
 
154
159
  xpath_internal self, paths, handler, ns, binds
@@ -161,17 +166,19 @@ module Nokogiri
161
166
  # match. +paths+ must be one or more XPath queries.
162
167
  #
163
168
  # See Searchable#xpath for more information.
164
- def at_xpath *args
169
+ def at_xpath(*args)
165
170
  xpath(*args).first
166
171
  end
167
172
 
173
+ # @!endgroup
174
+
168
175
  private
169
176
 
170
- def css_internal node, rules, handler, ns
177
+ def css_internal(node, rules, handler, ns)
171
178
  xpath_internal node, css_rules_to_xpath(rules, ns), handler, ns, nil
172
179
  end
173
180
 
174
- def xpath_internal node, paths, handler, ns, binds
181
+ def xpath_internal(node, paths, handler, ns, binds)
175
182
  document = node.document
176
183
  return NodeSet.new(document) unless document
177
184
 
@@ -186,12 +193,12 @@ module Nokogiri
186
193
  end
187
194
  end
188
195
 
189
- def xpath_impl node, path, handler, ns, binds
196
+ def xpath_impl(node, path, handler, ns, binds)
190
197
  ctx = XPathContext.new(node)
191
198
  ctx.register_namespaces(ns)
192
- path = path.gsub(/xmlns:/, ' :') unless Nokogiri.uses_libxml?
199
+ path = path.gsub(/xmlns:/, " :") unless Nokogiri.uses_libxml?
193
200
 
194
- binds.each do |key,value|
201
+ binds.each do |key, value|
195
202
  ctx.register_variable key.to_s, value
196
203
  end if binds
197
204
 
@@ -202,13 +209,15 @@ module Nokogiri
202
209
  rules.map { |rule| xpath_query_from_css_rule(rule, ns) }
203
210
  end
204
211
 
205
- def xpath_query_from_css_rule rule, ns
212
+ def xpath_query_from_css_rule(rule, ns)
213
+ visitor = Nokogiri::CSS::XPathVisitorOptimallyUseBuiltins.new
206
214
  self.class::IMPLIED_XPATH_CONTEXTS.map do |implied_xpath_context|
207
- CSS.xpath_for(rule.to_s, :prefix => implied_xpath_context, :ns => ns)
208
- end.join(' | ')
215
+ CSS.xpath_for(rule.to_s, {:prefix => implied_xpath_context, :ns => ns,
216
+ :visitor => visitor})
217
+ end.join(" | ")
209
218
  end
210
219
 
211
- def extract_params params # :nodoc:
220
+ def extract_params(params) # :nodoc:
212
221
  handler = params.find do |param|
213
222
  ![Hash, String, Symbol].include?(param.class)
214
223
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  ###
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  class Text < Nokogiri::XML::CharacterData
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'nokogiri/xml/xpath/syntax_error'
2
3
 
3
4
  module Nokogiri
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  class XPath
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XML
3
4
  class XPathContext
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'nokogiri/xslt/stylesheet'
2
3
 
3
4
  module Nokogiri
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module XSLT
3
4
  ###
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'nokogiri'
2
3
 
3
4
  module XSD # :nodoc:
metadata CHANGED
@@ -1,49 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.9
4
+ version: 1.11.0.rc4
5
5
  platform: x64-mingw32
6
6
  authors:
7
- - Aaron Patterson
8
7
  - Mike Dalessio
8
+ - Aaron Patterson
9
+ - John Shahid
9
10
  - Yoko Harada
10
- - Tim Elliott
11
11
  - Akinori MUSHA
12
- - John Shahid
13
12
  - Lars Kanis
13
+ - Tim Elliott
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2020-03-01 00:00:00.000000000 Z
17
+ date: 2020-12-29 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
- name: mini_portile2
20
+ name: racc
21
21
  requirement: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 2.4.0
25
+ version: '1.4'
26
26
  type: :runtime
27
27
  prerelease: false
28
28
  version_requirements: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: 2.4.0
32
+ version: '1.4'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: concourse
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.24'
39
+ version: '0.41'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.41'
47
+ - !ruby/object:Gem::Dependency
48
+ name: hoe
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.22'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 3.22.1
40
57
  type: :development
41
58
  prerelease: false
42
59
  version_requirements: !ruby/object:Gem::Requirement
43
60
  requirements:
44
61
  - - "~>"
45
62
  - !ruby/object:Gem::Version
46
- version: '0.24'
63
+ version: '3.22'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 3.22.1
47
67
  - !ruby/object:Gem::Dependency
48
68
  name: hoe-bundler
49
69
  requirement: !ruby/object:Gem::Requirement
@@ -100,6 +120,20 @@ dependencies:
100
120
  - - "~>"
101
121
  - !ruby/object:Gem::Version
102
122
  version: '1.6'
123
+ - !ruby/object:Gem::Dependency
124
+ name: hoe-markdown
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '1.1'
130
+ type: :development
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: '1.1'
103
137
  - !ruby/object:Gem::Dependency
104
138
  name: minitest
105
139
  requirement: !ruby/object:Gem::Requirement
@@ -115,61 +149,61 @@ dependencies:
115
149
  - !ruby/object:Gem::Version
116
150
  version: '5.8'
117
151
  - !ruby/object:Gem::Dependency
118
- name: racc
152
+ name: minitest-reporters
119
153
  requirement: !ruby/object:Gem::Requirement
120
154
  requirements:
121
155
  - - "~>"
122
156
  - !ruby/object:Gem::Version
123
- version: 1.4.14
157
+ version: '1.4'
124
158
  type: :development
125
159
  prerelease: false
126
160
  version_requirements: !ruby/object:Gem::Requirement
127
161
  requirements:
128
162
  - - "~>"
129
163
  - !ruby/object:Gem::Version
130
- version: 1.4.14
164
+ version: '1.4'
131
165
  - !ruby/object:Gem::Dependency
132
166
  name: rake
133
167
  requirement: !ruby/object:Gem::Requirement
134
168
  requirements:
135
169
  - - "~>"
136
170
  - !ruby/object:Gem::Version
137
- version: '12.0'
171
+ version: '13.0'
138
172
  type: :development
139
173
  prerelease: false
140
174
  version_requirements: !ruby/object:Gem::Requirement
141
175
  requirements:
142
176
  - - "~>"
143
177
  - !ruby/object:Gem::Version
144
- version: '12.0'
178
+ version: '13.0'
145
179
  - !ruby/object:Gem::Dependency
146
180
  name: rake-compiler
147
181
  requirement: !ruby/object:Gem::Requirement
148
182
  requirements:
149
183
  - - "~>"
150
184
  - !ruby/object:Gem::Version
151
- version: 1.1.0
185
+ version: '1.1'
152
186
  type: :development
153
187
  prerelease: false
154
188
  version_requirements: !ruby/object:Gem::Requirement
155
189
  requirements:
156
190
  - - "~>"
157
191
  - !ruby/object:Gem::Version
158
- version: 1.1.0
192
+ version: '1.1'
159
193
  - !ruby/object:Gem::Dependency
160
194
  name: rake-compiler-dock
161
195
  requirement: !ruby/object:Gem::Requirement
162
196
  requirements:
163
197
  - - "~>"
164
198
  - !ruby/object:Gem::Version
165
- version: 0.7.0
199
+ version: '1.1'
166
200
  type: :development
167
201
  prerelease: false
168
202
  version_requirements: !ruby/object:Gem::Requirement
169
203
  requirements:
170
204
  - - "~>"
171
205
  - !ruby/object:Gem::Version
172
- version: 0.7.0
206
+ version: '1.1'
173
207
  - !ruby/object:Gem::Dependency
174
208
  name: rexical
175
209
  requirement: !ruby/object:Gem::Requirement
@@ -190,28 +224,28 @@ dependencies:
190
224
  requirements:
191
225
  - - "~>"
192
226
  - !ruby/object:Gem::Version
193
- version: '0.73'
227
+ version: '0.88'
194
228
  type: :development
195
229
  prerelease: false
196
230
  version_requirements: !ruby/object:Gem::Requirement
197
231
  requirements:
198
232
  - - "~>"
199
233
  - !ruby/object:Gem::Version
200
- version: '0.73'
234
+ version: '0.88'
201
235
  - !ruby/object:Gem::Dependency
202
236
  name: simplecov
203
237
  requirement: !ruby/object:Gem::Requirement
204
238
  requirements:
205
239
  - - "~>"
206
240
  - !ruby/object:Gem::Version
207
- version: '0.16'
241
+ version: 0.17.0
208
242
  type: :development
209
243
  prerelease: false
210
244
  version_requirements: !ruby/object:Gem::Requirement
211
245
  requirements:
212
246
  - - "~>"
213
247
  - !ruby/object:Gem::Version
214
- version: '0.16'
248
+ version: 0.17.0
215
249
  - !ruby/object:Gem::Dependency
216
250
  name: rdoc
217
251
  requirement: !ruby/object:Gem::Requirement
@@ -232,32 +266,11 @@ dependencies:
232
266
  - - "<"
233
267
  - !ruby/object:Gem::Version
234
268
  version: '7'
235
- - !ruby/object:Gem::Dependency
236
- name: hoe
237
- requirement: !ruby/object:Gem::Requirement
238
- requirements:
239
- - - "~>"
240
- - !ruby/object:Gem::Version
241
- version: '3.22'
242
- type: :development
243
- prerelease: false
244
- version_requirements: !ruby/object:Gem::Requirement
245
- requirements:
246
- - - "~>"
247
- - !ruby/object:Gem::Version
248
- version: '3.22'
249
269
  description: |-
250
270
  Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among
251
271
  Nokogiri's many features is the ability to search documents via XPath
252
272
  or CSS3 selectors.
253
- email:
254
- - aaronp@rubyforge.org
255
- - mike.dalessio@gmail.com
256
- - yokolet@gmail.com
257
- - tle@holymonkey.com
258
- - knu@idaemons.org
259
- - jvshahid@gmail.com
260
- - lars@greiz-reinsdorf.de
273
+ email: nokogiri-talk@googlegroups.com
261
274
  executables:
262
275
  - nokogiri
263
276
  extensions: []
@@ -317,6 +330,77 @@ files:
317
330
  - ext/nokogiri/html_sax_parser_context.h
318
331
  - ext/nokogiri/html_sax_push_parser.c
319
332
  - ext/nokogiri/html_sax_push_parser.h
333
+ - ext/nokogiri/include/libexslt/exslt.h
334
+ - ext/nokogiri/include/libexslt/exsltconfig.h
335
+ - ext/nokogiri/include/libexslt/exsltexports.h
336
+ - ext/nokogiri/include/libxml2/libxml/DOCBparser.h
337
+ - ext/nokogiri/include/libxml2/libxml/HTMLparser.h
338
+ - ext/nokogiri/include/libxml2/libxml/HTMLtree.h
339
+ - ext/nokogiri/include/libxml2/libxml/SAX.h
340
+ - ext/nokogiri/include/libxml2/libxml/SAX2.h
341
+ - ext/nokogiri/include/libxml2/libxml/c14n.h
342
+ - ext/nokogiri/include/libxml2/libxml/catalog.h
343
+ - ext/nokogiri/include/libxml2/libxml/chvalid.h
344
+ - ext/nokogiri/include/libxml2/libxml/debugXML.h
345
+ - ext/nokogiri/include/libxml2/libxml/dict.h
346
+ - ext/nokogiri/include/libxml2/libxml/encoding.h
347
+ - ext/nokogiri/include/libxml2/libxml/entities.h
348
+ - ext/nokogiri/include/libxml2/libxml/globals.h
349
+ - ext/nokogiri/include/libxml2/libxml/hash.h
350
+ - ext/nokogiri/include/libxml2/libxml/list.h
351
+ - ext/nokogiri/include/libxml2/libxml/nanoftp.h
352
+ - ext/nokogiri/include/libxml2/libxml/nanohttp.h
353
+ - ext/nokogiri/include/libxml2/libxml/parser.h
354
+ - ext/nokogiri/include/libxml2/libxml/parserInternals.h
355
+ - ext/nokogiri/include/libxml2/libxml/pattern.h
356
+ - ext/nokogiri/include/libxml2/libxml/relaxng.h
357
+ - ext/nokogiri/include/libxml2/libxml/schemasInternals.h
358
+ - ext/nokogiri/include/libxml2/libxml/schematron.h
359
+ - ext/nokogiri/include/libxml2/libxml/threads.h
360
+ - ext/nokogiri/include/libxml2/libxml/tree.h
361
+ - ext/nokogiri/include/libxml2/libxml/uri.h
362
+ - ext/nokogiri/include/libxml2/libxml/valid.h
363
+ - ext/nokogiri/include/libxml2/libxml/xinclude.h
364
+ - ext/nokogiri/include/libxml2/libxml/xlink.h
365
+ - ext/nokogiri/include/libxml2/libxml/xmlIO.h
366
+ - ext/nokogiri/include/libxml2/libxml/xmlautomata.h
367
+ - ext/nokogiri/include/libxml2/libxml/xmlerror.h
368
+ - ext/nokogiri/include/libxml2/libxml/xmlexports.h
369
+ - ext/nokogiri/include/libxml2/libxml/xmlmemory.h
370
+ - ext/nokogiri/include/libxml2/libxml/xmlmodule.h
371
+ - ext/nokogiri/include/libxml2/libxml/xmlreader.h
372
+ - ext/nokogiri/include/libxml2/libxml/xmlregexp.h
373
+ - ext/nokogiri/include/libxml2/libxml/xmlsave.h
374
+ - ext/nokogiri/include/libxml2/libxml/xmlschemas.h
375
+ - ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h
376
+ - ext/nokogiri/include/libxml2/libxml/xmlstring.h
377
+ - ext/nokogiri/include/libxml2/libxml/xmlunicode.h
378
+ - ext/nokogiri/include/libxml2/libxml/xmlversion.h
379
+ - ext/nokogiri/include/libxml2/libxml/xmlwriter.h
380
+ - ext/nokogiri/include/libxml2/libxml/xpath.h
381
+ - ext/nokogiri/include/libxml2/libxml/xpathInternals.h
382
+ - ext/nokogiri/include/libxml2/libxml/xpointer.h
383
+ - ext/nokogiri/include/libxslt/attributes.h
384
+ - ext/nokogiri/include/libxslt/documents.h
385
+ - ext/nokogiri/include/libxslt/extensions.h
386
+ - ext/nokogiri/include/libxslt/extra.h
387
+ - ext/nokogiri/include/libxslt/functions.h
388
+ - ext/nokogiri/include/libxslt/imports.h
389
+ - ext/nokogiri/include/libxslt/keys.h
390
+ - ext/nokogiri/include/libxslt/namespaces.h
391
+ - ext/nokogiri/include/libxslt/numbersInternals.h
392
+ - ext/nokogiri/include/libxslt/pattern.h
393
+ - ext/nokogiri/include/libxslt/preproc.h
394
+ - ext/nokogiri/include/libxslt/security.h
395
+ - ext/nokogiri/include/libxslt/templates.h
396
+ - ext/nokogiri/include/libxslt/transform.h
397
+ - ext/nokogiri/include/libxslt/variables.h
398
+ - ext/nokogiri/include/libxslt/xslt.h
399
+ - ext/nokogiri/include/libxslt/xsltInternals.h
400
+ - ext/nokogiri/include/libxslt/xsltconfig.h
401
+ - ext/nokogiri/include/libxslt/xsltexports.h
402
+ - ext/nokogiri/include/libxslt/xsltlocale.h
403
+ - ext/nokogiri/include/libxslt/xsltutils.h
320
404
  - ext/nokogiri/nokogiri.c
321
405
  - ext/nokogiri/nokogiri.h
322
406
  - ext/nokogiri/xml_attr.c
@@ -376,10 +460,10 @@ files:
376
460
  - ext/nokogiri/xslt_stylesheet.c
377
461
  - ext/nokogiri/xslt_stylesheet.h
378
462
  - lib/nokogiri.rb
379
- - lib/nokogiri/2.3/nokogiri.so
380
- - lib/nokogiri/2.4/nokogiri.so
381
463
  - lib/nokogiri/2.5/nokogiri.so
382
464
  - lib/nokogiri/2.6/nokogiri.so
465
+ - lib/nokogiri/2.7/nokogiri.so
466
+ - lib/nokogiri/3.0/nokogiri.so
383
467
  - lib/nokogiri/css.rb
384
468
  - lib/nokogiri/css/node.rb
385
469
  - lib/nokogiri/css/parser.rb
@@ -400,8 +484,11 @@ files:
400
484
  - lib/nokogiri/html/sax/parser.rb
401
485
  - lib/nokogiri/html/sax/parser_context.rb
402
486
  - lib/nokogiri/html/sax/push_parser.rb
487
+ - lib/nokogiri/jruby/dependencies.rb
403
488
  - lib/nokogiri/syntax_error.rb
404
489
  - lib/nokogiri/version.rb
490
+ - lib/nokogiri/version/constant.rb
491
+ - lib/nokogiri/version/info.rb
405
492
  - lib/nokogiri/xml.rb
406
493
  - lib/nokogiri/xml/attr.rb
407
494
  - lib/nokogiri/xml/attribute_decl.rb
@@ -451,10 +538,7 @@ metadata:
451
538
  documentation_uri: https://nokogiri.org/rdoc/index.html
452
539
  changelog_uri: https://nokogiri.org/CHANGELOG.html
453
540
  source_code_uri: https://github.com/sparklemotion/nokogiri
454
- post_install_message: 'Nokogiri is built with the packaged libraries: libxml2-2.9.10,
455
- libxslt-1.1.34, zlib-1.2.11, libiconv-1.15.
456
-
457
- '
541
+ post_install_message:
458
542
  rdoc_options:
459
543
  - "--main"
460
544
  - README.md
@@ -464,18 +548,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
464
548
  requirements:
465
549
  - - ">="
466
550
  - !ruby/object:Gem::Version
467
- version: '2.3'
551
+ version: '2.5'
468
552
  - - "<"
469
553
  - !ruby/object:Gem::Version
470
- version: 2.7.dev
554
+ version: 3.1.dev
471
555
  required_rubygems_version: !ruby/object:Gem::Requirement
472
556
  requirements:
473
- - - ">="
557
+ - - ">"
474
558
  - !ruby/object:Gem::Version
475
- version: '0'
559
+ version: 1.3.1
476
560
  requirements: []
477
- rubyforge_project:
478
- rubygems_version: 2.7.9
561
+ rubygems_version: 3.2.3
479
562
  signing_key:
480
563
  specification_version: 4
481
564
  summary: Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser