nokogiri 1.12.0-arm64-darwin → 1.12.3-arm64-darwin

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: 5ef11e520b314cd3977f4a283755e4e9a39754bd39b19c74e0e0ada53ca6e654
4
- data.tar.gz: a9ef6d5177830f3cca91b659bb813d894247eb017a737031e55a18d40f30fc5f
3
+ metadata.gz: 67439071bb75de96494d56a70bd1d5c376cedfc0c90cf335f647774e91f67d8e
4
+ data.tar.gz: 8042f5aad6c0f3e7470cc7c75509f5b0e99b261ef35ffa3fe4bbf12c30efef6f
5
5
  SHA512:
6
- metadata.gz: a2c3f2e1548c196571949d1fe5585588463123c351b6c78631d31ed5284e8ac06b19e09a0e0f75a8935915bf2a532c995b86ed73ad5861575410896c2432b475
7
- data.tar.gz: 3a7995df0b0b8ff35f0f833bf8dbbf80963dfcab2b1b205f7646aa78f96124e558c8b0943a9e589ce96f4d780502beff50dc3a674c6594c27d135f2f4680adc6
6
+ metadata.gz: ff1c390c99842af6292eba69249d785dc8c36c4cf1107de763519932268a82a4bd731155615976fa9cebd9e769c8c598694b8ec4a61f7af69ce365a100d23684
7
+ data.tar.gz: f256b5e01a83e04f86f401d9111110397e9ffc2db24ba760f8e43bb78bca4ab8e9ff162ce3ba900aba046a152026b173c8016eccea9e4457e8770d41983bc73b
@@ -594,6 +594,10 @@ append_cppflags(ENV["CPPFLAGS"].split) unless ENV["CPPFLAGS"].nil?
594
594
  append_ldflags(ENV["LDFLAGS"].split) unless ENV["LDFLAGS"].nil?
595
595
  $LIBS = concat_flags($LIBS, ENV["LIBS"])
596
596
 
597
+ # nokogumbo code uses C90/C99 features, let's make sure older compilers won't give
598
+ # errors/warnings. see #2302
599
+ append_cflags(["-std=c99", "-Wno-declaration-after-statement"])
600
+
597
601
  # always include debugging information
598
602
  append_cflags("-g")
599
603
 
data/ext/nokogiri/gumbo.c CHANGED
@@ -75,7 +75,7 @@ new_html_doc(const char *dtd_name, const char *system, const char *public)
75
75
  htmlDocPtr doc = htmlNewDocNoDtD(/* URI */ NULL, /* ExternalID */NULL);
76
76
  assert(doc);
77
77
  if (dtd_name) {
78
- xmlCreateIntSubset(doc, BAD_CAST dtd_name, BAD_CAST public, BAD_CAST system);
78
+ xmlCreateIntSubset(doc, (const xmlChar *)dtd_name, (const xmlChar *)public, (const xmlChar *)system);
79
79
  }
80
80
  return doc;
81
81
  }
@@ -120,11 +120,11 @@ lookup_or_add_ns(
120
120
  const char *prefix
121
121
  )
122
122
  {
123
- xmlNsPtr ns = xmlSearchNs(doc, root, BAD_CAST prefix);
123
+ xmlNsPtr ns = xmlSearchNs(doc, root, (const xmlChar *)prefix);
124
124
  if (ns) {
125
125
  return ns;
126
126
  }
127
- return xmlNewNs(root, BAD_CAST href, BAD_CAST prefix);
127
+ return xmlNewNs(root, (const xmlChar *)href, (const xmlChar *)prefix);
128
128
  }
129
129
 
130
130
  static void
@@ -181,20 +181,20 @@ build_tree(
181
181
 
182
182
  case GUMBO_NODE_TEXT:
183
183
  case GUMBO_NODE_WHITESPACE:
184
- xml_child = xmlNewDocText(doc, BAD_CAST gumbo_child->v.text.text);
184
+ xml_child = xmlNewDocText(doc, (const xmlChar *)gumbo_child->v.text.text);
185
185
  set_line(xml_child, gumbo_child->v.text.start_pos.line);
186
186
  xmlAddChild(xml_node, xml_child);
187
187
  break;
188
188
 
189
189
  case GUMBO_NODE_CDATA:
190
- xml_child = xmlNewCDataBlock(doc, BAD_CAST gumbo_child->v.text.text,
190
+ xml_child = xmlNewCDataBlock(doc, (const xmlChar *)gumbo_child->v.text.text,
191
191
  (int) strlen(gumbo_child->v.text.text));
192
192
  set_line(xml_child, gumbo_child->v.text.start_pos.line);
193
193
  xmlAddChild(xml_node, xml_child);
194
194
  break;
195
195
 
196
196
  case GUMBO_NODE_COMMENT:
197
- xml_child = xmlNewDocComment(doc, BAD_CAST gumbo_child->v.text.text);
197
+ xml_child = xmlNewDocComment(doc, (const xmlChar *)gumbo_child->v.text.text);
198
198
  set_line(xml_child, gumbo_child->v.text.start_pos.line);
199
199
  xmlAddChild(xml_node, xml_child);
200
200
  break;
@@ -202,7 +202,7 @@ build_tree(
202
202
  case GUMBO_NODE_TEMPLATE:
203
203
  // XXX: Should create a template element and a new DocumentFragment
204
204
  case GUMBO_NODE_ELEMENT: {
205
- xml_child = xmlNewDocNode(doc, NULL, BAD_CAST gumbo_child->v.element.name, NULL);
205
+ xml_child = xmlNewDocNode(doc, NULL, (const xmlChar *)gumbo_child->v.element.name, NULL);
206
206
  set_line(xml_child, gumbo_child->v.element.start_pos.line);
207
207
  if (xml_root == NULL) {
208
208
  xml_root = xml_child;
@@ -244,7 +244,7 @@ build_tree(
244
244
  default:
245
245
  ns = NULL;
246
246
  }
247
- xmlNewNsProp(xml_child, ns, BAD_CAST attr->name, BAD_CAST attr->value);
247
+ xmlNewNsProp(xml_child, ns, (const xmlChar *)attr->name, (const xmlChar *)attr->value);
248
248
  }
249
249
 
250
250
  // Add children for this element.
@@ -303,7 +303,7 @@ typedef struct {
303
303
  static VALUE
304
304
  parse_cleanup(VALUE parse_args)
305
305
  {
306
- ParseArgs *args = (ParseArgs*)parse_args;
306
+ ParseArgs *args = (ParseArgs *)parse_args;
307
307
  gumbo_destroy_output(args->output);
308
308
  // Make sure garbage collection doesn't mark the objects as being live based
309
309
  // on references from the ParseArgs. This may be unnecessary.
@@ -342,7 +342,7 @@ parse(VALUE self, VALUE input, VALUE url, VALUE max_attributes, VALUE max_errors
342
342
  static VALUE
343
343
  parse_continue(VALUE parse_args)
344
344
  {
345
- ParseArgs *args = (ParseArgs*)parse_args;
345
+ ParseArgs *args = (ParseArgs *)parse_args;
346
346
  GumboOutput *output = args->output;
347
347
  xmlDocPtr doc;
348
348
  if (output->document->v.document.has_doctype) {
@@ -552,7 +552,7 @@ error:
552
552
  static VALUE
553
553
  fragment_continue(VALUE parse_args)
554
554
  {
555
- ParseArgs *args = (ParseArgs*)parse_args;
555
+ ParseArgs *args = (ParseArgs *)parse_args;
556
556
  GumboOutput *output = args->output;
557
557
  VALUE doc_fragment = args->url_or_frag;
558
558
  xmlDocPtr xml_doc = args->doc;
@@ -266,7 +266,7 @@ get_description(VALUE klass, VALUE tag_name)
266
266
  );
267
267
 
268
268
  if (NULL == description) { return Qnil; }
269
- return Data_Wrap_Struct(klass, 0, 0, (void *)(uintptr_t)description);
269
+ return Data_Wrap_Struct(klass, 0, 0, DISCARD_CONST_QUAL(void *, description));
270
270
  }
271
271
 
272
272
  void
@@ -110,7 +110,8 @@ void
110
110
  noko_init_html_sax_parser_context()
111
111
  {
112
112
  assert(cNokogiriXmlSaxParserContext);
113
- cNokogiriHtml4SaxParserContext = rb_define_class_under(mNokogiriHtml4Sax, "ParserContext", cNokogiriXmlSaxParserContext);
113
+ cNokogiriHtml4SaxParserContext = rb_define_class_under(mNokogiriHtml4Sax, "ParserContext",
114
+ cNokogiriXmlSaxParserContext);
114
115
 
115
116
  rb_define_singleton_method(cNokogiriHtml4SaxParserContext, "memory", parse_memory, 2);
116
117
  rb_define_singleton_method(cNokogiriHtml4SaxParserContext, "file", parse_file, 2);
@@ -220,7 +220,7 @@ Init_nokogiri()
220
220
  xmlInitParser();
221
221
  exsltRegisterAll();
222
222
 
223
- if (xsltExtModuleFunctionLookup((xmlChar*)"date-time", EXSLT_DATE_NAMESPACE)) {
223
+ if (xsltExtModuleFunctionLookup((const xmlChar *)"date-time", EXSLT_DATE_NAMESPACE)) {
224
224
  rb_const_set(mNokogiri, rb_intern("LIBXSLT_DATETIME_ENABLED"), Qtrue);
225
225
  } else {
226
226
  rb_const_set(mNokogiri, rb_intern("LIBXSLT_DATETIME_ENABLED"), Qfalse);
@@ -197,6 +197,9 @@ NOKOPUBFUN VALUE Nokogiri_wrap_xml_document(VALUE klass,
197
197
  #define NOKOGIRI_SAX_TUPLE_NEW(_ctxt, _self) nokogiri_sax_tuple_new(_ctxt, _self)
198
198
  #define NOKOGIRI_SAX_TUPLE_DESTROY(_tuple) free(_tuple)
199
199
 
200
+ #define DISCARD_CONST_QUAL(t, v) ((t)(uintptr_t)(v))
201
+ #define DISCARD_CONST_QUAL_XMLCHAR(v) DISCARD_CONST_QUAL(xmlChar *, v)
202
+
200
203
  void Nokogiri_structured_error_func_save(libxmlStructuredErrorHandlerState *handler_state);
201
204
  void Nokogiri_structured_error_func_save_and_set(libxmlStructuredErrorHandlerState *handler_state, void *user_data,
202
205
  xmlStructuredErrorFunc handler);
@@ -213,7 +213,7 @@ set_encoding(VALUE self, VALUE encoding)
213
213
  Data_Get_Struct(self, xmlDoc, doc);
214
214
 
215
215
  if (doc->encoding) {
216
- free((char *)(uintptr_t) doc->encoding); /* avoid gcc cast warning */
216
+ xmlFree(DISCARD_CONST_QUAL_XMLCHAR(doc->encoding));
217
217
  }
218
218
 
219
219
  doc->encoding = xmlStrdup((xmlChar *)StringValueCStr(encoding));
@@ -33,10 +33,10 @@ dealloc_namespace(xmlNsPtr ns)
33
33
  */
34
34
  NOKOGIRI_DEBUG_START(ns) ;
35
35
  if (ns->href) {
36
- xmlFree((xmlChar *)(uintptr_t)ns->href);
36
+ xmlFree(DISCARD_CONST_QUAL_XMLCHAR(ns->href));
37
37
  }
38
38
  if (ns->prefix) {
39
- xmlFree((xmlChar *)(uintptr_t)ns->prefix);
39
+ xmlFree(DISCARD_CONST_QUAL_XMLCHAR(ns->prefix));
40
40
  }
41
41
  xmlFree(ns);
42
42
  NOKOGIRI_DEBUG_END(ns) ;
@@ -304,7 +304,7 @@ ok:
304
304
  * issue #391, where new node's prefix may become the string "default"
305
305
  * see libxml2 tree.c xmlNewReconciliedNs which implements this behavior.
306
306
  */
307
- xmlFree((xmlChar *)reparentee->ns->prefix);
307
+ xmlFree(DISCARD_CONST_QUAL_XMLCHAR(reparentee->ns->prefix));
308
308
  reparentee->ns->prefix = NULL;
309
309
  }
310
310
  }
@@ -934,7 +934,7 @@ get(VALUE self, VALUE rattribute)
934
934
  Data_Get_Struct(self, xmlNode, node);
935
935
  attribute = xmlCharStrdup(StringValueCStr(rattribute));
936
936
 
937
- colon = (xmlChar *)(uintptr_t)xmlStrchr(attribute, (const xmlChar)':');
937
+ colon = DISCARD_CONST_QUAL_XMLCHAR(xmlStrchr(attribute, (const xmlChar)':'));
938
938
  if (colon) {
939
939
  /* split the attribute string into separate prefix and name by
940
940
  * null-terminating the prefix at the colon */
Binary file
Binary file
Binary file
Binary file
@@ -2,6 +2,7 @@
2
2
 
3
3
  # load the C or Java extension
4
4
  begin
5
+ # native precompiled gems package shared libraries in <gem_dir>/lib/nokogiri/<ruby_version>
5
6
  ::RUBY_VERSION =~ /(\d+\.\d+)/
6
7
  require_relative "#{Regexp.last_match(1)}/nokogiri"
7
8
  rescue LoadError => e
@@ -22,5 +23,9 @@ rescue LoadError => e
22
23
  EOM
23
24
  raise e
24
25
  end
25
- require_relative "nokogiri"
26
+
27
+ # use "require" instead of "require_relative" because non-native gems will place C extension files
28
+ # in Gem::BasicSpecification#extension_dir after compilation (during normal installation), which
29
+ # is in $LOAD_PATH but not necessarily relative to this file (see #2300)
30
+ require "nokogiri/nokogiri"
26
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Nokogiri
3
3
  # The version of Nokogiri you are using
4
- VERSION = "1.12.0"
4
+ VERSION = "1.12.3"
5
5
  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.12.0
4
+ version: 1.12.3
5
5
  platform: arm64-darwin
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: 2021-08-02 00:00:00.000000000 Z
23
+ date: 2021-08-10 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: racc