nokogiri 1.10.8-x64-mingw32 → 1.11.0.rc3-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.
- checksums.yaml +4 -4
- data/README.md +24 -22
- data/ext/nokogiri/extconf.rb +50 -37
- data/ext/nokogiri/nokogiri.c +12 -6
- data/ext/nokogiri/nokogiri.h +13 -0
- data/ext/nokogiri/xml_document.c +16 -2
- data/ext/nokogiri/xml_io.c +8 -6
- data/ext/nokogiri/xml_node.c +20 -0
- data/ext/nokogiri/xml_reader.c +6 -17
- data/ext/nokogiri/xml_schema.c +29 -0
- data/ext/nokogiri/xslt_stylesheet.c +0 -4
- data/lib/nokogiri.rb +3 -20
- data/lib/nokogiri/2.4/nokogiri.so +0 -0
- data/lib/nokogiri/2.5/nokogiri.so +0 -0
- data/lib/nokogiri/2.6/nokogiri.so +0 -0
- data/lib/nokogiri/{2.3 → 2.7}/nokogiri.so +0 -0
- data/lib/nokogiri/css.rb +1 -0
- data/lib/nokogiri/css/node.rb +1 -0
- data/lib/nokogiri/css/parser.rb +61 -60
- data/lib/nokogiri/css/parser_extras.rb +39 -36
- data/lib/nokogiri/css/syntax_error.rb +1 -0
- data/lib/nokogiri/css/tokenizer.rb +1 -0
- data/lib/nokogiri/css/xpath_visitor.rb +3 -1
- data/lib/nokogiri/decorators/slop.rb +1 -0
- data/lib/nokogiri/html.rb +1 -0
- data/lib/nokogiri/html/builder.rb +1 -0
- data/lib/nokogiri/html/document.rb +1 -0
- data/lib/nokogiri/html/document_fragment.rb +1 -0
- data/lib/nokogiri/html/element_description.rb +1 -0
- data/lib/nokogiri/html/element_description_defaults.rb +1 -0
- data/lib/nokogiri/html/entity_lookup.rb +1 -0
- data/lib/nokogiri/html/sax/parser.rb +1 -0
- data/lib/nokogiri/html/sax/parser_context.rb +1 -0
- data/lib/nokogiri/html/sax/push_parser.rb +1 -0
- data/lib/nokogiri/jruby/dependencies.rb +20 -0
- data/lib/nokogiri/syntax_error.rb +1 -0
- data/lib/nokogiri/version.rb +86 -45
- data/lib/nokogiri/xml.rb +1 -0
- data/lib/nokogiri/xml/attr.rb +1 -0
- data/lib/nokogiri/xml/attribute_decl.rb +1 -0
- data/lib/nokogiri/xml/builder.rb +3 -2
- data/lib/nokogiri/xml/cdata.rb +1 -0
- data/lib/nokogiri/xml/character_data.rb +1 -0
- data/lib/nokogiri/xml/document.rb +3 -8
- data/lib/nokogiri/xml/document_fragment.rb +1 -0
- data/lib/nokogiri/xml/dtd.rb +1 -0
- data/lib/nokogiri/xml/element_content.rb +1 -0
- data/lib/nokogiri/xml/element_decl.rb +1 -0
- data/lib/nokogiri/xml/entity_decl.rb +1 -0
- data/lib/nokogiri/xml/entity_reference.rb +1 -0
- data/lib/nokogiri/xml/namespace.rb +1 -0
- data/lib/nokogiri/xml/node.rb +539 -224
- data/lib/nokogiri/xml/node/save_options.rb +1 -0
- data/lib/nokogiri/xml/node_set.rb +1 -0
- data/lib/nokogiri/xml/notation.rb +1 -0
- data/lib/nokogiri/xml/parse_options.rb +4 -3
- data/lib/nokogiri/xml/pp.rb +1 -0
- data/lib/nokogiri/xml/pp/character_data.rb +1 -0
- data/lib/nokogiri/xml/pp/node.rb +1 -0
- data/lib/nokogiri/xml/processing_instruction.rb +1 -0
- data/lib/nokogiri/xml/reader.rb +7 -3
- data/lib/nokogiri/xml/relax_ng.rb +1 -0
- data/lib/nokogiri/xml/sax.rb +1 -0
- data/lib/nokogiri/xml/sax/document.rb +1 -0
- data/lib/nokogiri/xml/sax/parser.rb +1 -0
- data/lib/nokogiri/xml/sax/parser_context.rb +1 -0
- data/lib/nokogiri/xml/sax/push_parser.rb +1 -0
- data/lib/nokogiri/xml/schema.rb +1 -0
- data/lib/nokogiri/xml/searchable.rb +22 -15
- data/lib/nokogiri/xml/syntax_error.rb +1 -0
- data/lib/nokogiri/xml/text.rb +1 -0
- data/lib/nokogiri/xml/xpath.rb +1 -0
- data/lib/nokogiri/xml/xpath/syntax_error.rb +1 -0
- data/lib/nokogiri/xml/xpath_context.rb +1 -0
- data/lib/nokogiri/xslt.rb +1 -0
- data/lib/nokogiri/xslt/stylesheet.rb +1 -0
- data/lib/xsd/xmlparser/nokogiri.rb +1 -0
- metadata +46 -40
@@ -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.
|
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',
|
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',
|
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
|
#
|
data/lib/nokogiri/xml/pp.rb
CHANGED
data/lib/nokogiri/xml/pp/node.rb
CHANGED
data/lib/nokogiri/xml/reader.rb
CHANGED
@@ -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
|
-
|
91
|
-
|
92
|
-
|
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
|
###
|
data/lib/nokogiri/xml/sax.rb
CHANGED
data/lib/nokogiri/xml/schema.rb
CHANGED
@@ -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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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:/,
|
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,13 @@ 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
|
212
|
+
def xpath_query_from_css_rule(rule, ns)
|
206
213
|
self.class::IMPLIED_XPATH_CONTEXTS.map do |implied_xpath_context|
|
207
214
|
CSS.xpath_for(rule.to_s, :prefix => implied_xpath_context, :ns => ns)
|
208
|
-
end.join(
|
215
|
+
end.join(" | ")
|
209
216
|
end
|
210
217
|
|
211
|
-
def extract_params
|
218
|
+
def extract_params(params) # :nodoc:
|
212
219
|
handler = params.find do |param|
|
213
220
|
![Hash, String, Symbol].include?(param.class)
|
214
221
|
end
|
data/lib/nokogiri/xml/text.rb
CHANGED
data/lib/nokogiri/xml/xpath.rb
CHANGED
data/lib/nokogiri/xslt.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0.rc3
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
@@ -14,36 +14,42 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2020-
|
17
|
+
date: 2020-09-08 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
|
-
name:
|
20
|
+
name: concourse
|
21
21
|
requirement: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version:
|
26
|
-
type: :
|
25
|
+
version: '0.34'
|
26
|
+
type: :development
|
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:
|
32
|
+
version: '0.34'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
34
|
+
name: hoe
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '3.22'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 3.22.1
|
40
43
|
type: :development
|
41
44
|
prerelease: false
|
42
45
|
version_requirements: !ruby/object:Gem::Requirement
|
43
46
|
requirements:
|
44
47
|
- - "~>"
|
45
48
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
49
|
+
version: '3.22'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 3.22.1
|
47
53
|
- !ruby/object:Gem::Dependency
|
48
54
|
name: hoe-bundler
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,6 +106,20 @@ dependencies:
|
|
100
106
|
- - "~>"
|
101
107
|
- !ruby/object:Gem::Version
|
102
108
|
version: '1.6'
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: hoe-markdown
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - "~>"
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '1.1'
|
116
|
+
type: :development
|
117
|
+
prerelease: false
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - "~>"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '1.1'
|
103
123
|
- !ruby/object:Gem::Dependency
|
104
124
|
name: minitest
|
105
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,42 +154,42 @@ dependencies:
|
|
134
154
|
requirements:
|
135
155
|
- - "~>"
|
136
156
|
- !ruby/object:Gem::Version
|
137
|
-
version: '
|
157
|
+
version: '13.0'
|
138
158
|
type: :development
|
139
159
|
prerelease: false
|
140
160
|
version_requirements: !ruby/object:Gem::Requirement
|
141
161
|
requirements:
|
142
162
|
- - "~>"
|
143
163
|
- !ruby/object:Gem::Version
|
144
|
-
version: '
|
164
|
+
version: '13.0'
|
145
165
|
- !ruby/object:Gem::Dependency
|
146
166
|
name: rake-compiler
|
147
167
|
requirement: !ruby/object:Gem::Requirement
|
148
168
|
requirements:
|
149
169
|
- - "~>"
|
150
170
|
- !ruby/object:Gem::Version
|
151
|
-
version: 1.1
|
171
|
+
version: '1.1'
|
152
172
|
type: :development
|
153
173
|
prerelease: false
|
154
174
|
version_requirements: !ruby/object:Gem::Requirement
|
155
175
|
requirements:
|
156
176
|
- - "~>"
|
157
177
|
- !ruby/object:Gem::Version
|
158
|
-
version: 1.1
|
178
|
+
version: '1.1'
|
159
179
|
- !ruby/object:Gem::Dependency
|
160
180
|
name: rake-compiler-dock
|
161
181
|
requirement: !ruby/object:Gem::Requirement
|
162
182
|
requirements:
|
163
183
|
- - "~>"
|
164
184
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
185
|
+
version: '1.0'
|
166
186
|
type: :development
|
167
187
|
prerelease: false
|
168
188
|
version_requirements: !ruby/object:Gem::Requirement
|
169
189
|
requirements:
|
170
190
|
- - "~>"
|
171
191
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
192
|
+
version: '1.0'
|
173
193
|
- !ruby/object:Gem::Dependency
|
174
194
|
name: rexical
|
175
195
|
requirement: !ruby/object:Gem::Requirement
|
@@ -190,28 +210,28 @@ dependencies:
|
|
190
210
|
requirements:
|
191
211
|
- - "~>"
|
192
212
|
- !ruby/object:Gem::Version
|
193
|
-
version: '0.
|
213
|
+
version: '0.88'
|
194
214
|
type: :development
|
195
215
|
prerelease: false
|
196
216
|
version_requirements: !ruby/object:Gem::Requirement
|
197
217
|
requirements:
|
198
218
|
- - "~>"
|
199
219
|
- !ruby/object:Gem::Version
|
200
|
-
version: '0.
|
220
|
+
version: '0.88'
|
201
221
|
- !ruby/object:Gem::Dependency
|
202
222
|
name: simplecov
|
203
223
|
requirement: !ruby/object:Gem::Requirement
|
204
224
|
requirements:
|
205
225
|
- - "~>"
|
206
226
|
- !ruby/object:Gem::Version
|
207
|
-
version:
|
227
|
+
version: 0.17.0
|
208
228
|
type: :development
|
209
229
|
prerelease: false
|
210
230
|
version_requirements: !ruby/object:Gem::Requirement
|
211
231
|
requirements:
|
212
232
|
- - "~>"
|
213
233
|
- !ruby/object:Gem::Version
|
214
|
-
version:
|
234
|
+
version: 0.17.0
|
215
235
|
- !ruby/object:Gem::Dependency
|
216
236
|
name: rdoc
|
217
237
|
requirement: !ruby/object:Gem::Requirement
|
@@ -232,20 +252,6 @@ dependencies:
|
|
232
252
|
- - "<"
|
233
253
|
- !ruby/object:Gem::Version
|
234
254
|
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
255
|
description: |-
|
250
256
|
Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among
|
251
257
|
Nokogiri's many features is the ability to search documents via XPath
|
@@ -376,10 +382,10 @@ files:
|
|
376
382
|
- ext/nokogiri/xslt_stylesheet.c
|
377
383
|
- ext/nokogiri/xslt_stylesheet.h
|
378
384
|
- lib/nokogiri.rb
|
379
|
-
- lib/nokogiri/2.3/nokogiri.so
|
380
385
|
- lib/nokogiri/2.4/nokogiri.so
|
381
386
|
- lib/nokogiri/2.5/nokogiri.so
|
382
387
|
- lib/nokogiri/2.6/nokogiri.so
|
388
|
+
- lib/nokogiri/2.7/nokogiri.so
|
383
389
|
- lib/nokogiri/css.rb
|
384
390
|
- lib/nokogiri/css/node.rb
|
385
391
|
- lib/nokogiri/css/parser.rb
|
@@ -400,6 +406,7 @@ files:
|
|
400
406
|
- lib/nokogiri/html/sax/parser.rb
|
401
407
|
- lib/nokogiri/html/sax/parser_context.rb
|
402
408
|
- lib/nokogiri/html/sax/push_parser.rb
|
409
|
+
- lib/nokogiri/jruby/dependencies.rb
|
403
410
|
- lib/nokogiri/syntax_error.rb
|
404
411
|
- lib/nokogiri/version.rb
|
405
412
|
- lib/nokogiri/xml.rb
|
@@ -464,18 +471,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
464
471
|
requirements:
|
465
472
|
- - ">="
|
466
473
|
- !ruby/object:Gem::Version
|
467
|
-
version: '2.
|
474
|
+
version: '2.4'
|
468
475
|
- - "<"
|
469
476
|
- !ruby/object:Gem::Version
|
470
|
-
version: 2.
|
477
|
+
version: 2.8.dev
|
471
478
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
472
479
|
requirements:
|
473
|
-
- - "
|
480
|
+
- - ">"
|
474
481
|
- !ruby/object:Gem::Version
|
475
|
-
version:
|
482
|
+
version: 1.3.1
|
476
483
|
requirements: []
|
477
|
-
|
478
|
-
rubygems_version: 2.7.9
|
484
|
+
rubygems_version: 3.1.2
|
479
485
|
signing_key:
|
480
486
|
specification_version: 4
|
481
487
|
summary: Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser
|