nokogiri 1.15.1-x86-mingw32 → 1.15.3-x86-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b95072fcad1db8a6197e1721775095c78c3010557cfce3ff5d16f8fd82380413
4
- data.tar.gz: c783e409e0a5a8e3763db82845c2e10f18ce1563dd3aa2373f052283ca4cc0bb
3
+ metadata.gz: 067b1ec07b7811bcf66618fbc14d82c3ab18406ddb290c7deb1ba0f2ac975c56
4
+ data.tar.gz: 2580c66f4f00754d8af4bdead7b59b0342963f72ad2fd40a70192704bf1559c6
5
5
  SHA512:
6
- metadata.gz: caae54dc4bd01ddd25fd13d2ee7fd2bb4a0bebe3e9671c77fc771b37d326a665cda398993cf4916288e668dd15b057d022741d96c8df63f590f5028336bdf8b0
7
- data.tar.gz: 05ba5769ab2c277c76452f0eae9782fbeec5ac420efc8450ef9661d7d97a9edf172af5b07efd79680fdf1a82c8d93254a6c4f8dcb4d4d5feca0eb65c98f18ff1
6
+ metadata.gz: f338a3b74fa08a9cb9e82c9cdd6d930bb2b01af86b9e2d6c9f177b0846e7620e62f7d61e14df609169e1a78ee236fb5a4e37f02bb8dd4b4a0a26f15db6e9d690
7
+ data.tar.gz: 6538eb3a8c61e77d09f401d3bfa7167043f3738e5b1ae87728047b4d07ef53b8ef142e3cf6fb46e49f1bd0015e70395d204896c6105e776c7e8661b12651841b
data/Gemfile CHANGED
@@ -31,7 +31,7 @@ group :development do
31
31
  gem "rubocop", "1.51.0"
32
32
  gem "rubocop-minitest", "0.31.0"
33
33
  gem "rubocop-packaging", "0.5.2"
34
- gem "rubocop-performance", "1.17.1"
34
+ gem "rubocop-performance", "1.18.0"
35
35
  gem "rubocop-rake", "= 0.6.0"
36
36
  gem "rubocop-shopify", "2.13.0"
37
37
  end
@@ -12,39 +12,45 @@ VALUE cNokogiriXmlCData;
12
12
  * raise a TypeError exception.
13
13
  */
14
14
  static VALUE
15
- new (int argc, VALUE *argv, VALUE klass)
15
+ rb_xml_cdata_s_new(int argc, VALUE *argv, VALUE klass)
16
16
  {
17
- xmlDocPtr xml_doc;
18
- xmlNodePtr node;
19
- VALUE doc;
20
- VALUE content;
21
- VALUE rest;
17
+ xmlDocPtr c_document;
18
+ xmlNodePtr c_node;
19
+ VALUE rb_document;
20
+ VALUE rb_content;
21
+ VALUE rb_rest;
22
22
  VALUE rb_node;
23
- xmlChar *content_str = NULL;
24
- int content_str_len = 0;
23
+ xmlChar *c_content = NULL;
24
+ int c_content_len = 0;
25
25
 
26
- rb_scan_args(argc, argv, "2*", &doc, &content, &rest);
26
+ rb_scan_args(argc, argv, "2*", &rb_document, &rb_content, &rb_rest);
27
27
 
28
- if (rb_obj_is_kind_of(doc, cNokogiriXmlDocument)) {
29
- xml_doc = noko_xml_document_unwrap(doc);
30
- } else {
28
+ if (!rb_obj_is_kind_of(rb_document, cNokogiriXmlNode)) {
29
+ rb_raise(rb_eTypeError,
30
+ "expected first parameter to be a Nokogiri::XML::Document, received %"PRIsVALUE,
31
+ rb_obj_class(rb_document));
32
+ }
33
+
34
+ if (!rb_obj_is_kind_of(rb_document, cNokogiriXmlDocument)) {
31
35
  xmlNodePtr deprecated_node_type_arg;
32
36
  // TODO: deprecate allowing Node
33
37
  NOKO_WARN_DEPRECATION("Passing a Node as the first parameter to CDATA.new is deprecated. Please pass a Document instead. This will become an error in a future release of Nokogiri.");
34
- Noko_Node_Get_Struct(doc, xmlNode, deprecated_node_type_arg);
35
- xml_doc = deprecated_node_type_arg->doc;
38
+ Noko_Node_Get_Struct(rb_document, xmlNode, deprecated_node_type_arg);
39
+ c_document = deprecated_node_type_arg->doc;
40
+ } else {
41
+ c_document = noko_xml_document_unwrap(rb_document);
36
42
  }
37
43
 
38
- if (!NIL_P(content)) {
39
- content_str = (xmlChar *)StringValuePtr(content);
40
- content_str_len = RSTRING_LENINT(content);
44
+ if (!NIL_P(rb_content)) {
45
+ c_content = (xmlChar *)StringValuePtr(rb_content);
46
+ c_content_len = RSTRING_LENINT(rb_content);
41
47
  }
42
48
 
43
- node = xmlNewCDataBlock(xml_doc, content_str, content_str_len);
49
+ c_node = xmlNewCDataBlock(c_document, c_content, c_content_len);
44
50
 
45
- noko_xml_document_pin_node(node);
51
+ noko_xml_document_pin_node(c_node);
46
52
 
47
- rb_node = noko_xml_node_wrap(klass, node);
53
+ rb_node = noko_xml_node_wrap(klass, c_node);
48
54
  rb_obj_call_init(rb_node, argc, argv);
49
55
 
50
56
  if (rb_block_given_p()) { rb_yield(rb_node); }
@@ -61,5 +67,5 @@ noko_init_xml_cdata(void)
61
67
  */
62
68
  cNokogiriXmlCData = rb_define_class_under(mNokogiriXml, "CDATA", cNokogiriXmlText);
63
69
 
64
- rb_define_singleton_method(cNokogiriXmlCData, "new", new, -1);
70
+ rb_define_singleton_method(cNokogiriXmlCData, "new", rb_xml_cdata_s_new, -1);
65
71
  }
@@ -350,7 +350,7 @@ ok:
350
350
 
351
351
  xmlUnlinkNode(original_reparentee);
352
352
 
353
- if (prf != xmlAddPrevSibling && prf != xmlAddNextSibling
353
+ if (prf != xmlAddPrevSibling && prf != xmlAddNextSibling && prf != xmlAddChild
354
354
  && reparentee->type == XML_TEXT_NODE && pivot->next && pivot->next->type == XML_TEXT_NODE) {
355
355
  /*
356
356
  * libxml merges text nodes in a right-to-left fashion, meaning that if
@@ -203,7 +203,7 @@ read_memory(int argc, VALUE *argv, VALUE klass)
203
203
  * [Returns] Nokogiri::XML::Schema
204
204
  */
205
205
  static VALUE
206
- from_document(int argc, VALUE *argv, VALUE klass)
206
+ rb_xml_schema_s_from_document(int argc, VALUE *argv, VALUE klass)
207
207
  {
208
208
  VALUE rb_document;
209
209
  VALUE rb_parse_options;
@@ -214,14 +214,20 @@ from_document(int argc, VALUE *argv, VALUE klass)
214
214
 
215
215
  rb_scan_args(argc, argv, "11", &rb_document, &rb_parse_options);
216
216
 
217
- if (rb_obj_is_kind_of(rb_document, cNokogiriXmlDocument)) {
218
- c_document = noko_xml_document_unwrap(rb_document);
219
- } else {
217
+ if (!rb_obj_is_kind_of(rb_document, cNokogiriXmlNode)) {
218
+ rb_raise(rb_eTypeError,
219
+ "expected parameter to be a Nokogiri::XML::Document, received %"PRIsVALUE,
220
+ rb_obj_class(rb_document));
221
+ }
222
+
223
+ if (!rb_obj_is_kind_of(rb_document, cNokogiriXmlDocument)) {
220
224
  xmlNodePtr deprecated_node_type_arg;
221
225
  // TODO: deprecate allowing Node
222
226
  NOKO_WARN_DEPRECATION("Passing a Node as the first parameter to Schema.from_document is deprecated. Please pass a Document instead. This will become an error in a future release of Nokogiri.");
223
227
  Noko_Node_Get_Struct(rb_document, xmlNode, deprecated_node_type_arg);
224
228
  c_document = deprecated_node_type_arg->doc;
229
+ } else {
230
+ c_document = noko_xml_document_unwrap(rb_document);
225
231
  }
226
232
 
227
233
  if (noko_xml_document_has_wrapped_blank_nodes_p(c_document)) {
@@ -249,7 +255,7 @@ noko_init_xml_schema(void)
249
255
  rb_undef_alloc_func(cNokogiriXmlSchema);
250
256
 
251
257
  rb_define_singleton_method(cNokogiriXmlSchema, "read_memory", read_memory, -1);
252
- rb_define_singleton_method(cNokogiriXmlSchema, "from_document", from_document, -1);
258
+ rb_define_singleton_method(cNokogiriXmlSchema, "from_document", rb_xml_schema_s_from_document, -1);
253
259
 
254
260
  rb_define_private_method(cNokogiriXmlSchema, "validate_document", validate_document, 1);
255
261
  rb_define_private_method(cNokogiriXmlSchema, "validate_file", validate_file, 1);
@@ -9,33 +9,39 @@ VALUE cNokogiriXmlText ;
9
9
  * Create a new Text element on the +document+ with +content+
10
10
  */
11
11
  static VALUE
12
- new (int argc, VALUE *argv, VALUE klass)
12
+ rb_xml_text_s_new(int argc, VALUE *argv, VALUE klass)
13
13
  {
14
- xmlDocPtr doc;
15
- xmlNodePtr node;
16
- VALUE string;
17
- VALUE document;
18
- VALUE rest;
14
+ xmlDocPtr c_document;
15
+ xmlNodePtr c_node;
16
+ VALUE rb_string;
17
+ VALUE rb_document;
18
+ VALUE rb_rest;
19
19
  VALUE rb_node;
20
20
 
21
- rb_scan_args(argc, argv, "2*", &string, &document, &rest);
21
+ rb_scan_args(argc, argv, "2*", &rb_string, &rb_document, &rb_rest);
22
22
 
23
- if (rb_obj_is_kind_of(document, cNokogiriXmlDocument)) {
24
- doc = noko_xml_document_unwrap(document);
25
- } else {
23
+ if (!rb_obj_is_kind_of(rb_document, cNokogiriXmlNode)) {
24
+ rb_raise(rb_eTypeError,
25
+ "expected second parameter to be a Nokogiri::XML::Document, received %"PRIsVALUE,
26
+ rb_obj_class(rb_document));
27
+ }
28
+
29
+ if (!rb_obj_is_kind_of(rb_document, cNokogiriXmlDocument)) {
26
30
  xmlNodePtr deprecated_node_type_arg;
27
31
  // TODO: deprecate allowing Node
28
32
  NOKO_WARN_DEPRECATION("Passing a Node as the second parameter to Text.new is deprecated. Please pass a Document instead. This will become an error in a future release of Nokogiri.");
29
- Noko_Node_Get_Struct(document, xmlNode, deprecated_node_type_arg);
30
- doc = deprecated_node_type_arg->doc;
33
+ Noko_Node_Get_Struct(rb_document, xmlNode, deprecated_node_type_arg);
34
+ c_document = deprecated_node_type_arg->doc;
35
+ } else {
36
+ c_document = noko_xml_document_unwrap(rb_document);
31
37
  }
32
38
 
33
- node = xmlNewText((xmlChar *)StringValueCStr(string));
34
- node->doc = doc;
39
+ c_node = xmlNewText((xmlChar *)StringValueCStr(rb_string));
40
+ c_node->doc = c_document;
35
41
 
36
- noko_xml_document_pin_node(node);
42
+ noko_xml_document_pin_node(c_node);
37
43
 
38
- rb_node = noko_xml_node_wrap(klass, node) ;
44
+ rb_node = noko_xml_node_wrap(klass, c_node) ;
39
45
  rb_obj_call_init(rb_node, argc, argv);
40
46
 
41
47
  if (rb_block_given_p()) { rb_yield(rb_node); }
@@ -52,5 +58,5 @@ noko_init_xml_text(void)
52
58
  */
53
59
  cNokogiriXmlText = rb_define_class_under(mNokogiriXml, "Text", cNokogiriXmlCharacterData);
54
60
 
55
- rb_define_singleton_method(cNokogiriXmlText, "new", new, -1);
61
+ rb_define_singleton_method(cNokogiriXmlText, "new", rb_xml_text_s_new, -1);
56
62
  }
Binary file
Binary file
Binary file
Binary file
@@ -6,10 +6,10 @@ rescue LoadError
6
6
  require 'net/sourceforge/htmlunit/neko-htmlunit/2.63.0/neko-htmlunit-2.63.0.jar'
7
7
  require 'nu/validator/jing/20200702VNU/jing-20200702VNU.jar'
8
8
  require 'xerces/xercesImpl/2.12.2/xercesImpl-2.12.2.jar'
9
- require 'org/nokogiri/nekodtd/0.1.11.noko1/nekodtd-0.1.11.noko1.jar'
10
9
  require 'net/sf/saxon/Saxon-HE/9.6.0-4/Saxon-HE-9.6.0-4.jar'
11
10
  require 'xalan/xalan/2.7.3/xalan-2.7.3.jar'
12
11
  require 'xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar'
12
+ require 'org/nokogiri/nekodtd/0.1.11.noko2/nekodtd-0.1.11.noko2.jar'
13
13
  require 'isorelax/isorelax/20030108/isorelax-20030108.jar'
14
14
  end
15
15
 
@@ -18,10 +18,10 @@ if defined? Jars
18
18
  require_jar 'net.sourceforge.htmlunit', 'neko-htmlunit', '2.63.0'
19
19
  require_jar 'nu.validator', 'jing', '20200702VNU'
20
20
  require_jar 'xerces', 'xercesImpl', '2.12.2'
21
- require_jar 'org.nokogiri', 'nekodtd', '0.1.11.noko1'
22
21
  require_jar 'net.sf.saxon', 'Saxon-HE', '9.6.0-4'
23
22
  require_jar 'xalan', 'xalan', '2.7.3'
24
23
  require_jar 'xml-apis', 'xml-apis', '1.4.01'
24
+ require_jar 'org.nokogiri', 'nekodtd', '0.1.11.noko2'
25
25
  require_jar 'isorelax', 'isorelax', '20030108'
26
26
  end
27
27
 
@@ -32,7 +32,7 @@ module Nokogiri
32
32
  "net.sf.saxon:Saxon-HE" => "9.6.0-4",
33
33
  "net.sourceforge.htmlunit:neko-htmlunit" => "2.63.0",
34
34
  "nu.validator:jing" => "20200702VNU",
35
- "org.nokogiri:nekodtd" => "0.1.11.noko1",
35
+ "org.nokogiri:nekodtd" => "0.1.11.noko2",
36
36
  "xalan:serializer" => "2.7.3",
37
37
  "xalan:xalan" => "2.7.3",
38
38
  "xerces:xercesImpl" => "2.12.2",
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Nokogiri
4
4
  # The version of Nokogiri you are using
5
- VERSION = "1.15.1"
5
+ VERSION = "1.15.3"
6
6
  end
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.15.1
4
+ version: 1.15.3
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Mike Dalessio
@@ -20,7 +20,7 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2023-05-19 00:00:00.000000000 Z
23
+ date: 2023-07-05 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: racc