nokogiri 1.12.5-x86_64-darwin → 1.13.0-x86_64-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.

Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/README.md +9 -7
  4. data/bin/nokogiri +63 -50
  5. data/dependencies.yml +5 -6
  6. data/ext/nokogiri/extconf.rb +47 -35
  7. data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +1 -0
  8. data/ext/nokogiri/include/libxslt/xsltconfig.h +1 -1
  9. data/ext/nokogiri/xml_document.c +35 -35
  10. data/ext/nokogiri/xml_document_fragment.c +0 -2
  11. data/ext/nokogiri/xml_dtd.c +2 -2
  12. data/ext/nokogiri/xml_encoding_handler.c +25 -11
  13. data/ext/nokogiri/xml_node.c +638 -333
  14. data/ext/nokogiri/xml_reader.c +37 -11
  15. data/ext/nokogiri/xml_xpath_context.c +72 -49
  16. data/lib/nokogiri/2.6/nokogiri.bundle +0 -0
  17. data/lib/nokogiri/2.7/nokogiri.bundle +0 -0
  18. data/lib/nokogiri/3.0/nokogiri.bundle +0 -0
  19. data/lib/nokogiri/{2.5 → 3.1}/nokogiri.bundle +0 -0
  20. data/lib/nokogiri/class_resolver.rb +67 -0
  21. data/lib/nokogiri/css/node.rb +9 -8
  22. data/lib/nokogiri/css/parser.rb +11 -3
  23. data/lib/nokogiri/css/parser.y +10 -2
  24. data/lib/nokogiri/css/parser_extras.rb +20 -20
  25. data/lib/nokogiri/css/syntax_error.rb +1 -0
  26. data/lib/nokogiri/css/tokenizer.rb +2 -1
  27. data/lib/nokogiri/css/tokenizer.rex +2 -1
  28. data/lib/nokogiri/css/xpath_visitor.rb +174 -75
  29. data/lib/nokogiri/css.rb +38 -6
  30. data/lib/nokogiri/decorators/slop.rb +8 -7
  31. data/lib/nokogiri/extension.rb +1 -1
  32. data/lib/nokogiri/gumbo.rb +1 -0
  33. data/lib/nokogiri/html.rb +16 -10
  34. data/lib/nokogiri/html4/builder.rb +1 -0
  35. data/lib/nokogiri/html4/document.rb +84 -75
  36. data/lib/nokogiri/html4/document_fragment.rb +11 -7
  37. data/lib/nokogiri/html4/element_description.rb +1 -0
  38. data/lib/nokogiri/html4/element_description_defaults.rb +426 -520
  39. data/lib/nokogiri/html4/entity_lookup.rb +2 -1
  40. data/lib/nokogiri/html4/sax/parser.rb +2 -1
  41. data/lib/nokogiri/html4/sax/parser_context.rb +1 -0
  42. data/lib/nokogiri/html4/sax/push_parser.rb +7 -7
  43. data/lib/nokogiri/html4.rb +11 -5
  44. data/lib/nokogiri/html5/document.rb +24 -10
  45. data/lib/nokogiri/html5/document_fragment.rb +5 -2
  46. data/lib/nokogiri/html5/node.rb +6 -3
  47. data/lib/nokogiri/html5.rb +68 -64
  48. data/lib/nokogiri/jruby/dependencies.rb +10 -9
  49. data/lib/nokogiri/syntax_error.rb +1 -0
  50. data/lib/nokogiri/version/constant.rb +2 -1
  51. data/lib/nokogiri/version/info.rb +19 -13
  52. data/lib/nokogiri/version.rb +1 -0
  53. data/lib/nokogiri/xml/attr.rb +5 -3
  54. data/lib/nokogiri/xml/attribute_decl.rb +2 -1
  55. data/lib/nokogiri/xml/builder.rb +32 -32
  56. data/lib/nokogiri/xml/cdata.rb +2 -1
  57. data/lib/nokogiri/xml/character_data.rb +1 -0
  58. data/lib/nokogiri/xml/document.rb +139 -103
  59. data/lib/nokogiri/xml/document_fragment.rb +41 -38
  60. data/lib/nokogiri/xml/dtd.rb +3 -2
  61. data/lib/nokogiri/xml/element_content.rb +1 -0
  62. data/lib/nokogiri/xml/element_decl.rb +2 -1
  63. data/lib/nokogiri/xml/entity_decl.rb +3 -2
  64. data/lib/nokogiri/xml/entity_reference.rb +1 -0
  65. data/lib/nokogiri/xml/namespace.rb +2 -0
  66. data/lib/nokogiri/xml/node/save_options.rb +6 -3
  67. data/lib/nokogiri/xml/node.rb +512 -348
  68. data/lib/nokogiri/xml/node_set.rb +46 -54
  69. data/lib/nokogiri/xml/notation.rb +12 -0
  70. data/lib/nokogiri/xml/parse_options.rb +11 -7
  71. data/lib/nokogiri/xml/pp/character_data.rb +8 -6
  72. data/lib/nokogiri/xml/pp/node.rb +24 -26
  73. data/lib/nokogiri/xml/pp.rb +1 -0
  74. data/lib/nokogiri/xml/processing_instruction.rb +2 -1
  75. data/lib/nokogiri/xml/reader.rb +17 -19
  76. data/lib/nokogiri/xml/relax_ng.rb +1 -0
  77. data/lib/nokogiri/xml/sax/document.rb +20 -19
  78. data/lib/nokogiri/xml/sax/parser.rb +36 -34
  79. data/lib/nokogiri/xml/sax/parser_context.rb +7 -3
  80. data/lib/nokogiri/xml/sax/push_parser.rb +5 -5
  81. data/lib/nokogiri/xml/sax.rb +1 -0
  82. data/lib/nokogiri/xml/schema.rb +7 -6
  83. data/lib/nokogiri/xml/searchable.rb +42 -22
  84. data/lib/nokogiri/xml/syntax_error.rb +4 -4
  85. data/lib/nokogiri/xml/text.rb +1 -0
  86. data/lib/nokogiri/xml/xpath/syntax_error.rb +2 -1
  87. data/lib/nokogiri/xml/xpath.rb +12 -0
  88. data/lib/nokogiri/xml/xpath_context.rb +2 -3
  89. data/lib/nokogiri/xml.rb +3 -3
  90. data/lib/nokogiri/xslt/stylesheet.rb +1 -0
  91. data/lib/nokogiri/xslt.rb +3 -2
  92. data/lib/nokogiri.rb +19 -16
  93. data/lib/xsd/xmlparser/nokogiri.rb +25 -24
  94. metadata +124 -52
@@ -3,70 +3,82 @@
3
3
  VALUE cNokogiriEncodingHandler;
4
4
 
5
5
 
6
+ static void
7
+ _xml_encoding_handler_dealloc(xmlCharEncodingHandlerPtr c_handler)
8
+ {
9
+ /* make sure iconv handlers are cleaned up and freed */
10
+ xmlCharEncCloseFunc(c_handler);
11
+ }
12
+
13
+
6
14
  /*
7
15
  * call-seq: Nokogiri::EncodingHandler.[](name)
8
16
  *
9
17
  * Get the encoding handler for +name+
10
18
  */
11
19
  static VALUE
12
- get(VALUE klass, VALUE key)
20
+ rb_xml_encoding_handler_s_get(VALUE klass, VALUE key)
13
21
  {
14
22
  xmlCharEncodingHandlerPtr handler;
15
23
 
16
24
  handler = xmlFindCharEncodingHandler(StringValueCStr(key));
17
25
  if (handler) {
18
- return Data_Wrap_Struct(klass, NULL, NULL, handler);
26
+ return Data_Wrap_Struct(klass, NULL, _xml_encoding_handler_dealloc, handler);
19
27
  }
20
28
 
21
29
  return Qnil;
22
30
  }
23
31
 
32
+
24
33
  /*
25
34
  * call-seq: Nokogiri::EncodingHandler.delete(name)
26
35
  *
27
36
  * Delete the encoding alias named +name+
28
37
  */
29
38
  static VALUE
30
- delete (VALUE klass, VALUE name)
39
+ rb_xml_encoding_handler_s_delete(VALUE klass, VALUE name)
31
40
  {
32
41
  if (xmlDelEncodingAlias(StringValueCStr(name))) { return Qnil; }
33
42
 
34
43
  return Qtrue;
35
44
  }
36
45
 
46
+
37
47
  /*
38
48
  * call-seq: Nokogiri::EncodingHandler.alias(from, to)
39
49
  *
40
50
  * Alias encoding handler with name +from+ to name +to+
41
51
  */
42
52
  static VALUE
43
- alias(VALUE klass, VALUE from, VALUE to)
53
+ rb_xml_encoding_handler_s_alias(VALUE klass, VALUE from, VALUE to)
44
54
  {
45
55
  xmlAddEncodingAlias(StringValueCStr(from), StringValueCStr(to));
46
56
 
47
57
  return to;
48
58
  }
49
59
 
60
+
50
61
  /*
51
62
  * call-seq: Nokogiri::EncodingHandler.clear_aliases!
52
63
  *
53
64
  * Remove all encoding aliases.
54
65
  */
55
66
  static VALUE
56
- clear_aliases(VALUE klass)
67
+ rb_xml_encoding_handler_s_clear_aliases(VALUE klass)
57
68
  {
58
69
  xmlCleanupEncodingAliases();
59
70
 
60
71
  return klass;
61
72
  }
62
73
 
74
+
63
75
  /*
64
76
  * call-seq: name
65
77
  *
66
78
  * Get the name of this EncodingHandler
67
79
  */
68
80
  static VALUE
69
- name(VALUE self)
81
+ rb_xml_encoding_handler_name(VALUE self)
70
82
  {
71
83
  xmlCharEncodingHandlerPtr handler;
72
84
 
@@ -75,6 +87,7 @@ name(VALUE self)
75
87
  return NOKOGIRI_STR_NEW2(handler->name);
76
88
  }
77
89
 
90
+
78
91
  void
79
92
  noko_init_xml_encoding_handler()
80
93
  {
@@ -82,9 +95,10 @@ noko_init_xml_encoding_handler()
82
95
 
83
96
  rb_undef_alloc_func(cNokogiriEncodingHandler);
84
97
 
85
- rb_define_singleton_method(cNokogiriEncodingHandler, "[]", get, 1);
86
- rb_define_singleton_method(cNokogiriEncodingHandler, "delete", delete, 1);
87
- rb_define_singleton_method(cNokogiriEncodingHandler, "alias", alias, 2);
88
- rb_define_singleton_method(cNokogiriEncodingHandler, "clear_aliases!", clear_aliases, 0);
89
- rb_define_method(cNokogiriEncodingHandler, "name", name, 0);
98
+ rb_define_singleton_method(cNokogiriEncodingHandler, "[]", rb_xml_encoding_handler_s_get, 1);
99
+ rb_define_singleton_method(cNokogiriEncodingHandler, "delete", rb_xml_encoding_handler_s_delete, 1);
100
+ rb_define_singleton_method(cNokogiriEncodingHandler, "alias", rb_xml_encoding_handler_s_alias, 2);
101
+ rb_define_singleton_method(cNokogiriEncodingHandler, "clear_aliases!", rb_xml_encoding_handler_s_clear_aliases, 0);
102
+
103
+ rb_define_method(cNokogiriEncodingHandler, "name", rb_xml_encoding_handler_name, 0);
90
104
  }