nokogiri 1.11.0.rc1 → 1.11.1

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/LICENSE-DEPENDENCIES.md +1015 -947
  4. data/README.md +164 -92
  5. data/ext/nokogiri/depend +476 -357
  6. data/ext/nokogiri/extconf.rb +467 -326
  7. data/ext/nokogiri/html_document.c +79 -78
  8. data/ext/nokogiri/html_sax_parser_context.c +4 -2
  9. data/ext/nokogiri/html_sax_push_parser.c +14 -8
  10. data/ext/nokogiri/nokogiri.c +37 -46
  11. data/ext/nokogiri/nokogiri.h +25 -17
  12. data/ext/nokogiri/test_global_handlers.c +41 -0
  13. data/ext/nokogiri/xml_document.c +8 -3
  14. data/ext/nokogiri/xml_io.c +8 -6
  15. data/ext/nokogiri/xml_node.c +1 -1
  16. data/ext/nokogiri/xml_node_set.c +1 -1
  17. data/ext/nokogiri/xml_reader.c +6 -17
  18. data/ext/nokogiri/xml_relax_ng.c +29 -11
  19. data/ext/nokogiri/xml_sax_parser.c +2 -7
  20. data/ext/nokogiri/xml_sax_parser_context.c +4 -2
  21. data/ext/nokogiri/xml_sax_push_parser.c +2 -0
  22. data/ext/nokogiri/xml_schema.c +84 -13
  23. data/ext/nokogiri/xml_syntax_error.c +23 -0
  24. data/ext/nokogiri/xml_syntax_error.h +15 -3
  25. data/ext/nokogiri/xml_xpath_context.c +80 -4
  26. data/ext/nokogiri/xslt_stylesheet.c +1 -4
  27. data/lib/nokogiri.rb +20 -3
  28. data/lib/nokogiri/css/parser.rb +62 -62
  29. data/lib/nokogiri/css/parser.y +2 -2
  30. data/lib/nokogiri/css/parser_extras.rb +38 -36
  31. data/lib/nokogiri/css/xpath_visitor.rb +70 -42
  32. data/lib/nokogiri/html/document.rb +12 -26
  33. data/lib/nokogiri/version.rb +2 -148
  34. data/lib/nokogiri/version/constant.rb +5 -0
  35. data/lib/nokogiri/version/info.rb +182 -0
  36. data/lib/nokogiri/xml/builder.rb +2 -2
  37. data/lib/nokogiri/xml/document.rb +17 -7
  38. data/lib/nokogiri/xml/document_fragment.rb +4 -6
  39. data/lib/nokogiri/xml/node.rb +562 -238
  40. data/lib/nokogiri/xml/parse_options.rb +6 -0
  41. data/lib/nokogiri/xml/relax_ng.rb +6 -2
  42. data/lib/nokogiri/xml/schema.rb +12 -4
  43. data/lib/nokogiri/xml/searchable.rb +24 -16
  44. data/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch +32 -0
  45. data/patches/libxml2/0006-htmlParseComment-treat-as-if-it-closed-the-comment.patch +73 -0
  46. data/patches/libxml2/0007-use-new-htmlParseLookupCommentEnd-to-find-comment-en.patch +103 -0
  47. data/patches/libxml2/0008-use-glibc-strlen.patch +53 -0
  48. data/patches/libxml2/0009-avoid-isnan-isinf.patch +81 -0
  49. metadata +84 -114
@@ -0,0 +1,81 @@
1
+ This patch is a result of rake-compiler-dock using centos 7 (manylinux2014) to cross-compile.
2
+
3
+ Centos, for reasons I have not been able to discern, implements `isnan` and `isinf` as a function
4
+ and not as a macro. Debian knows how to resolve that function at dynamic-link time (despite using a
5
+ macro at compile time), but musl-based systems (like alpine) do not. Running `nm` on nokogiri.so
6
+ created on such a centos system shows:
7
+
8
+ ```
9
+ U __isinf@@GLIBC_2.2.5
10
+ U __isnan@@GLIBC_2.2.5
11
+ ```
12
+
13
+ (see https://github.com/sparklemotion/nokogiri/pull/2142 for more info)
14
+
15
+ This patch avoids using glibc's `isnan` and `isinf` calls, instead using libxml2's fallback
16
+ implementation. There's history here, see libxml2 commit 8813f39:
17
+
18
+ commit 8813f39
19
+ Author: Nick Wellnhofer <wellnhofer@aevum.de>
20
+ Date: 2017-09-21 00:11:26 +0200
21
+
22
+ Simplify XPath NaN, inf and -0 handling
23
+
24
+ Use C99 macros NAN, INFINITY, isnan, isinf. If they're not available:
25
+
26
+ - Assume that (0.0 / 0.0) generates a NaN and !(x == x) tests for NaN.
27
+ - Use C89's HUGE_VAL for INFINITY.
28
+
29
+ Remove manual handling of NaN, infinity and negative zero in functions
30
+ xmlXPathValueFlipSign and xmlXPathDivValues.
31
+
32
+ Remove xmlXPathGetSign. All the tests for negative zero can be replaced
33
+ with a test for negative or positive zero.
34
+
35
+ Simplify xmlXPathRoundFunction.
36
+
37
+ Remove Trio dependency.
38
+
39
+ This should work on IEEE 754 compliant implementations even if the C99
40
+ macros aren't available, but will likely break some ancient platforms.
41
+ If problems arise, my plan is to port the relevant trionan.c solution
42
+ to xpath.c. Note that non-compliant implementations are impossible
43
+ to fully support, anyway, since XPath requires IEEE 754.
44
+
45
+ This patch would be unnecessary if any of the following was true:
46
+
47
+ * centos implements these as macros, and doesn't generate an unresolved symbol for either in the shared library
48
+ * we had a way to ensure `__isinf` and `__isnan` resolve on musl (e.g., we implement them locally)
49
+
50
+ diff --git a/xpath.c b/xpath.c
51
+ index 9f64ab9..5b6d999 100644
52
+ --- a/xpath.c
53
+ +++ b/xpath.c
54
+ @@ -509,11 +509,7 @@ xmlXPathInit(void) {
55
+ */
56
+ int
57
+ xmlXPathIsNaN(double val) {
58
+ -#ifdef isnan
59
+ - return isnan(val);
60
+ -#else
61
+ return !(val == val);
62
+ -#endif
63
+ }
64
+
65
+ /**
66
+ @@ -524,15 +520,11 @@ xmlXPathIsNaN(double val) {
67
+ */
68
+ int
69
+ xmlXPathIsInf(double val) {
70
+ -#ifdef isinf
71
+ - return isinf(val) ? (val > 0 ? 1 : -1) : 0;
72
+ -#else
73
+ if (val >= INFINITY)
74
+ return 1;
75
+ if (val <= -INFINITY)
76
+ return -1;
77
+ return 0;
78
+ -#endif
79
+ }
80
+
81
+ #endif /* SCHEMAS or XPATH */
metadata CHANGED
@@ -1,119 +1,94 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0.rc1
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
- - Aaron Patterson
8
7
  - Mike Dalessio
8
+ - Aaron Patterson
9
9
  - Yoko Harada
10
- - Tim Elliott
11
10
  - Akinori MUSHA
12
11
  - John Shahid
12
+ - Karol Bucek
13
13
  - Lars Kanis
14
+ - Sergio Arbeo
15
+ - Timothy Elliott
16
+ - Nobuyoshi Nakada
14
17
  autorequire:
15
18
  bindir: bin
16
19
  cert_chain: []
17
- date: 2020-02-02 00:00:00.000000000 Z
20
+ date: 2021-01-06 00:00:00.000000000 Z
18
21
  dependencies:
19
22
  - !ruby/object:Gem::Dependency
20
- name: mini_portile2
23
+ name: racc
21
24
  requirement: !ruby/object:Gem::Requirement
22
25
  requirements:
23
26
  - - "~>"
24
27
  - !ruby/object:Gem::Version
25
- version: 2.4.0
28
+ version: '1.4'
26
29
  type: :runtime
27
30
  prerelease: false
28
31
  version_requirements: !ruby/object:Gem::Requirement
29
32
  requirements:
30
33
  - - "~>"
31
34
  - !ruby/object:Gem::Version
32
- version: 2.4.0
35
+ version: '1.4'
33
36
  - !ruby/object:Gem::Dependency
34
- name: concourse
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '0.30'
40
- type: :development
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '0.30'
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.18'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '3.18'
61
- - !ruby/object:Gem::Dependency
62
- name: hoe-bundler
37
+ name: mini_portile2
63
38
  requirement: !ruby/object:Gem::Requirement
64
39
  requirements:
65
40
  - - "~>"
66
41
  - !ruby/object:Gem::Version
67
- version: '1.2'
68
- type: :development
42
+ version: 2.5.0
43
+ type: :runtime
69
44
  prerelease: false
70
45
  version_requirements: !ruby/object:Gem::Requirement
71
46
  requirements:
72
47
  - - "~>"
73
48
  - !ruby/object:Gem::Version
74
- version: '1.2'
49
+ version: 2.5.0
75
50
  - !ruby/object:Gem::Dependency
76
- name: hoe-debugging
51
+ name: bundler
77
52
  requirement: !ruby/object:Gem::Requirement
78
53
  requirements:
79
54
  - - "~>"
80
55
  - !ruby/object:Gem::Version
81
- version: '2.0'
56
+ version: '2.2'
82
57
  type: :development
83
58
  prerelease: false
84
59
  version_requirements: !ruby/object:Gem::Requirement
85
60
  requirements:
86
61
  - - "~>"
87
62
  - !ruby/object:Gem::Version
88
- version: '2.0'
63
+ version: '2.2'
89
64
  - !ruby/object:Gem::Dependency
90
- name: hoe-gemspec
65
+ name: concourse
91
66
  requirement: !ruby/object:Gem::Requirement
92
67
  requirements:
93
68
  - - "~>"
94
69
  - !ruby/object:Gem::Version
95
- version: '1.0'
70
+ version: '0.41'
96
71
  type: :development
97
72
  prerelease: false
98
73
  version_requirements: !ruby/object:Gem::Requirement
99
74
  requirements:
100
75
  - - "~>"
101
76
  - !ruby/object:Gem::Version
102
- version: '1.0'
77
+ version: '0.41'
103
78
  - !ruby/object:Gem::Dependency
104
- name: hoe-git
79
+ name: hoe-markdown
105
80
  requirement: !ruby/object:Gem::Requirement
106
81
  requirements:
107
82
  - - "~>"
108
83
  - !ruby/object:Gem::Version
109
- version: '1.6'
84
+ version: '1.1'
110
85
  type: :development
111
86
  prerelease: false
112
87
  version_requirements: !ruby/object:Gem::Requirement
113
88
  requirements:
114
89
  - - "~>"
115
90
  - !ruby/object:Gem::Version
116
- version: '1.6'
91
+ version: '1.1'
117
92
  - !ruby/object:Gem::Dependency
118
93
  name: minitest
119
94
  requirement: !ruby/object:Gem::Requirement
@@ -129,19 +104,19 @@ dependencies:
129
104
  - !ruby/object:Gem::Version
130
105
  version: '5.8'
131
106
  - !ruby/object:Gem::Dependency
132
- name: racc
107
+ name: minitest-reporters
133
108
  requirement: !ruby/object:Gem::Requirement
134
109
  requirements:
135
110
  - - "~>"
136
111
  - !ruby/object:Gem::Version
137
- version: 1.4.14
112
+ version: '1.4'
138
113
  type: :development
139
114
  prerelease: false
140
115
  version_requirements: !ruby/object:Gem::Requirement
141
116
  requirements:
142
117
  - - "~>"
143
118
  - !ruby/object:Gem::Version
144
- version: 1.4.14
119
+ version: '1.4'
145
120
  - !ruby/object:Gem::Dependency
146
121
  name: rake
147
122
  requirement: !ruby/object:Gem::Requirement
@@ -176,14 +151,14 @@ dependencies:
176
151
  requirements:
177
152
  - - "~>"
178
153
  - !ruby/object:Gem::Version
179
- version: '1.0'
154
+ version: '1.1'
180
155
  type: :development
181
156
  prerelease: false
182
157
  version_requirements: !ruby/object:Gem::Requirement
183
158
  requirements:
184
159
  - - "~>"
185
160
  - !ruby/object:Gem::Version
186
- version: '1.0'
161
+ version: '1.1'
187
162
  - !ruby/object:Gem::Dependency
188
163
  name: rexical
189
164
  requirement: !ruby/object:Gem::Requirement
@@ -204,103 +179,90 @@ dependencies:
204
179
  requirements:
205
180
  - - "~>"
206
181
  - !ruby/object:Gem::Version
207
- version: '0.73'
182
+ version: '1.7'
208
183
  type: :development
209
184
  prerelease: false
210
185
  version_requirements: !ruby/object:Gem::Requirement
211
186
  requirements:
212
187
  - - "~>"
213
188
  - !ruby/object:Gem::Version
214
- version: '0.73'
189
+ version: '1.7'
215
190
  - !ruby/object:Gem::Dependency
216
191
  name: simplecov
217
192
  requirement: !ruby/object:Gem::Requirement
218
193
  requirements:
219
194
  - - "~>"
220
195
  - !ruby/object:Gem::Version
221
- version: '0.16'
196
+ version: '0.20'
222
197
  type: :development
223
198
  prerelease: false
224
199
  version_requirements: !ruby/object:Gem::Requirement
225
200
  requirements:
226
201
  - - "~>"
227
202
  - !ruby/object:Gem::Version
228
- version: '0.16'
203
+ version: '0.20'
229
204
  - !ruby/object:Gem::Dependency
230
- name: rdoc
205
+ name: yard
231
206
  requirement: !ruby/object:Gem::Requirement
232
207
  requirements:
233
- - - ">="
234
- - !ruby/object:Gem::Version
235
- version: '4.0'
236
- - - "<"
208
+ - - "~>"
237
209
  - !ruby/object:Gem::Version
238
- version: '7'
210
+ version: '0.9'
239
211
  type: :development
240
212
  prerelease: false
241
213
  version_requirements: !ruby/object:Gem::Requirement
242
214
  requirements:
243
- - - ">="
244
- - !ruby/object:Gem::Version
245
- version: '4.0'
246
- - - "<"
215
+ - - "~>"
247
216
  - !ruby/object:Gem::Version
248
- version: '7'
249
- description: |-
250
- Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among
251
- Nokogiri's many features is the ability to search documents via XPath
252
- 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
217
+ version: '0.9'
218
+ description: |
219
+ Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a
220
+ sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is
221
+ fast and standards-compliant by relying on native parsers like libxml2 (C) and xerces (Java).
222
+ email: nokogiri-talk@googlegroups.com
261
223
  executables:
262
224
  - nokogiri
263
225
  extensions:
264
226
  - ext/nokogiri/extconf.rb
265
227
  extra_rdoc_files:
266
- - LICENSE-DEPENDENCIES.md
267
- - LICENSE.md
268
- - README.md
269
- - ext/nokogiri/html_document.c
270
- - ext/nokogiri/html_element_description.c
271
- - ext/nokogiri/html_entity_lookup.c
272
- - ext/nokogiri/html_sax_parser_context.c
273
- - ext/nokogiri/html_sax_push_parser.c
274
- - ext/nokogiri/nokogiri.c
228
+ - ext/nokogiri/xml_dtd.c
229
+ - ext/nokogiri/xml_xpath_context.c
275
230
  - ext/nokogiri/xml_attr.c
276
- - ext/nokogiri/xml_attribute_decl.c
277
- - ext/nokogiri/xml_cdata.c
278
231
  - ext/nokogiri/xml_comment.c
279
- - ext/nokogiri/xml_document.c
280
- - ext/nokogiri/xml_document_fragment.c
281
- - ext/nokogiri/xml_dtd.c
232
+ - ext/nokogiri/nokogiri.c
233
+ - ext/nokogiri/xml_sax_parser_context.c
234
+ - ext/nokogiri/xml_node_set.c
235
+ - ext/nokogiri/xml_reader.c
236
+ - ext/nokogiri/xml_libxml2_hacks.c
237
+ - ext/nokogiri/xml_cdata.c
282
238
  - ext/nokogiri/xml_element_content.c
239
+ - ext/nokogiri/html_entity_lookup.c
240
+ - ext/nokogiri/xml_namespace.c
241
+ - ext/nokogiri/xml_io.c
242
+ - ext/nokogiri/xml_document.c
283
243
  - ext/nokogiri/xml_element_decl.c
244
+ - ext/nokogiri/xml_schema.c
245
+ - ext/nokogiri/html_document.c
246
+ - ext/nokogiri/xml_processing_instruction.c
247
+ - ext/nokogiri/xml_text.c
248
+ - ext/nokogiri/xml_syntax_error.c
249
+ - ext/nokogiri/xml_document_fragment.c
250
+ - ext/nokogiri/xml_sax_push_parser.c
284
251
  - ext/nokogiri/xml_encoding_handler.c
252
+ - ext/nokogiri/html_sax_push_parser.c
253
+ - ext/nokogiri/xml_relax_ng.c
285
254
  - ext/nokogiri/xml_entity_decl.c
286
- - ext/nokogiri/xml_entity_reference.c
287
- - ext/nokogiri/xml_io.c
288
- - ext/nokogiri/xml_libxml2_hacks.c
289
- - ext/nokogiri/xml_namespace.c
255
+ - ext/nokogiri/test_global_handlers.c
290
256
  - ext/nokogiri/xml_node.c
291
- - ext/nokogiri/xml_node_set.c
292
- - ext/nokogiri/xml_processing_instruction.c
293
- - ext/nokogiri/xml_reader.c
294
- - ext/nokogiri/xml_relax_ng.c
295
- - ext/nokogiri/xml_sax_parser.c
296
- - ext/nokogiri/xml_sax_parser_context.c
297
- - ext/nokogiri/xml_sax_push_parser.c
298
- - ext/nokogiri/xml_schema.c
299
- - ext/nokogiri/xml_syntax_error.c
300
- - ext/nokogiri/xml_text.c
301
- - ext/nokogiri/xml_xpath_context.c
257
+ - ext/nokogiri/xml_entity_reference.c
302
258
  - ext/nokogiri/xslt_stylesheet.c
259
+ - ext/nokogiri/html_sax_parser_context.c
260
+ - ext/nokogiri/xml_sax_parser.c
261
+ - ext/nokogiri/xml_attribute_decl.c
262
+ - ext/nokogiri/html_element_description.c
263
+ - README.md
303
264
  files:
265
+ - Gemfile
304
266
  - LICENSE-DEPENDENCIES.md
305
267
  - LICENSE.md
306
268
  - README.md
@@ -320,6 +282,7 @@ files:
320
282
  - ext/nokogiri/html_sax_push_parser.h
321
283
  - ext/nokogiri/nokogiri.c
322
284
  - ext/nokogiri/nokogiri.h
285
+ - ext/nokogiri/test_global_handlers.c
323
286
  - ext/nokogiri/xml_attr.c
324
287
  - ext/nokogiri/xml_attr.h
325
288
  - ext/nokogiri/xml_attribute_decl.c
@@ -400,6 +363,8 @@ files:
400
363
  - lib/nokogiri/jruby/dependencies.rb
401
364
  - lib/nokogiri/syntax_error.rb
402
365
  - lib/nokogiri/version.rb
366
+ - lib/nokogiri/version/constant.rb
367
+ - lib/nokogiri/version/info.rb
403
368
  - lib/nokogiri/xml.rb
404
369
  - lib/nokogiri/xml/attr.rb
405
370
  - lib/nokogiri/xml/attribute_decl.rb
@@ -444,6 +409,11 @@ files:
444
409
  - patches/libxml2/0002-Remove-script-macro-support.patch
445
410
  - patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch
446
411
  - patches/libxml2/0004-libxml2.la-is-in-top_builddir.patch
412
+ - patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch
413
+ - patches/libxml2/0006-htmlParseComment-treat-as-if-it-closed-the-comment.patch
414
+ - patches/libxml2/0007-use-new-htmlParseLookupCommentEnd-to-find-comment-en.patch
415
+ - patches/libxml2/0008-use-glibc-strlen.patch
416
+ - patches/libxml2/0009-avoid-isnan-isinf.patch
447
417
  - ports/archives/libxml2-2.9.10.tar.gz
448
418
  - ports/archives/libxslt-1.1.34.tar.gz
449
419
  homepage: https://nokogiri.org
@@ -465,15 +435,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
465
435
  requirements:
466
436
  - - ">="
467
437
  - !ruby/object:Gem::Version
468
- version: 2.4.0
438
+ version: 2.5.0
469
439
  required_rubygems_version: !ruby/object:Gem::Requirement
470
440
  requirements:
471
- - - ">"
441
+ - - ">="
472
442
  - !ruby/object:Gem::Version
473
- version: 1.3.1
443
+ version: '0'
474
444
  requirements: []
475
- rubygems_version: 3.1.2
445
+ rubygems_version: 3.1.4
476
446
  signing_key:
477
447
  specification_version: 4
478
- summary: Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser
448
+ summary: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
479
449
  test_files: []