nokogiri 1.10.10 → 1.11.0.rc1

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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -17
  3. data/ext/nokogiri/extconf.rb +44 -35
  4. data/ext/nokogiri/nokogiri.c +12 -6
  5. data/ext/nokogiri/nokogiri.h +1 -0
  6. data/ext/nokogiri/xml_document.c +10 -1
  7. data/ext/nokogiri/xml_node.c +20 -0
  8. data/ext/nokogiri/xml_schema.c +0 -29
  9. data/ext/nokogiri/xslt_stylesheet.c +0 -4
  10. data/lib/nokogiri.rb +2 -19
  11. data/lib/nokogiri/css.rb +1 -0
  12. data/lib/nokogiri/css/node.rb +1 -0
  13. data/lib/nokogiri/css/parser.rb +1 -0
  14. data/lib/nokogiri/css/parser_extras.rb +1 -0
  15. data/lib/nokogiri/css/syntax_error.rb +1 -0
  16. data/lib/nokogiri/css/tokenizer.rb +1 -0
  17. data/lib/nokogiri/css/xpath_visitor.rb +3 -1
  18. data/lib/nokogiri/decorators/slop.rb +1 -0
  19. data/lib/nokogiri/html.rb +1 -0
  20. data/lib/nokogiri/html/builder.rb +1 -0
  21. data/lib/nokogiri/html/document.rb +1 -0
  22. data/lib/nokogiri/html/document_fragment.rb +1 -0
  23. data/lib/nokogiri/html/element_description.rb +1 -0
  24. data/lib/nokogiri/html/element_description_defaults.rb +1 -0
  25. data/lib/nokogiri/html/entity_lookup.rb +1 -0
  26. data/lib/nokogiri/html/sax/parser.rb +1 -0
  27. data/lib/nokogiri/html/sax/parser_context.rb +1 -0
  28. data/lib/nokogiri/html/sax/push_parser.rb +1 -0
  29. data/lib/nokogiri/jruby/dependencies.rb +20 -0
  30. data/lib/nokogiri/syntax_error.rb +1 -0
  31. data/lib/nokogiri/version.rb +85 -45
  32. data/lib/nokogiri/xml.rb +1 -0
  33. data/lib/nokogiri/xml/attr.rb +1 -0
  34. data/lib/nokogiri/xml/attribute_decl.rb +1 -0
  35. data/lib/nokogiri/xml/builder.rb +1 -0
  36. data/lib/nokogiri/xml/cdata.rb +1 -0
  37. data/lib/nokogiri/xml/character_data.rb +1 -0
  38. data/lib/nokogiri/xml/document.rb +3 -8
  39. data/lib/nokogiri/xml/document_fragment.rb +1 -0
  40. data/lib/nokogiri/xml/dtd.rb +1 -0
  41. data/lib/nokogiri/xml/element_content.rb +1 -0
  42. data/lib/nokogiri/xml/element_decl.rb +1 -0
  43. data/lib/nokogiri/xml/entity_decl.rb +1 -0
  44. data/lib/nokogiri/xml/entity_reference.rb +1 -0
  45. data/lib/nokogiri/xml/namespace.rb +1 -0
  46. data/lib/nokogiri/xml/node.rb +26 -12
  47. data/lib/nokogiri/xml/node/save_options.rb +1 -0
  48. data/lib/nokogiri/xml/node_set.rb +1 -0
  49. data/lib/nokogiri/xml/notation.rb +1 -0
  50. data/lib/nokogiri/xml/parse_options.rb +4 -3
  51. data/lib/nokogiri/xml/pp.rb +1 -0
  52. data/lib/nokogiri/xml/pp/character_data.rb +1 -0
  53. data/lib/nokogiri/xml/pp/node.rb +1 -0
  54. data/lib/nokogiri/xml/processing_instruction.rb +1 -0
  55. data/lib/nokogiri/xml/reader.rb +7 -3
  56. data/lib/nokogiri/xml/relax_ng.rb +1 -0
  57. data/lib/nokogiri/xml/sax.rb +1 -0
  58. data/lib/nokogiri/xml/sax/document.rb +1 -0
  59. data/lib/nokogiri/xml/sax/parser.rb +1 -0
  60. data/lib/nokogiri/xml/sax/parser_context.rb +1 -0
  61. data/lib/nokogiri/xml/sax/push_parser.rb +1 -0
  62. data/lib/nokogiri/xml/schema.rb +1 -0
  63. data/lib/nokogiri/xml/searchable.rb +1 -0
  64. data/lib/nokogiri/xml/syntax_error.rb +1 -0
  65. data/lib/nokogiri/xml/text.rb +1 -0
  66. data/lib/nokogiri/xml/xpath.rb +1 -0
  67. data/lib/nokogiri/xml/xpath/syntax_error.rb +1 -0
  68. data/lib/nokogiri/xml/xpath_context.rb +1 -0
  69. data/lib/nokogiri/xslt.rb +1 -0
  70. data/lib/nokogiri/xslt/stylesheet.rb +1 -0
  71. data/lib/xsd/xmlparser/nokogiri.rb +1 -0
  72. metadata +27 -27
  73. data/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch +0 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ea976ad079c6e265a2275365b6572541c675b6815a8cc08b6cdd18e08f86764
4
- data.tar.gz: 33d11553009bb7563d6594802e0de35f5c950d7df07b828c54b6411f573d4a99
3
+ metadata.gz: a539f5ce4cf20408c97d0ef0eee4d0e480238353d5ff7395a238f6840e02d643
4
+ data.tar.gz: bd65eabb6b6039f05fc0c23deced15312c9ad2f08a6cfc1410bf85547400663c
5
5
  SHA512:
6
- metadata.gz: c8b1e1b238c4a0f4354bb7358a31dbf2288cc654313267e65bbbacb996abf28eb7d40122fae3a27f0ae9a589531c6717a0f7be4660412b757a95b15e12661b30
7
- data.tar.gz: 87769ba4a458792224e910db95258ae447714a0b732e69832d7ab643d798827e27faeafe29936067b4d07affb144dd88f6ab09de47e296c9f67b0bc4093176a8
6
+ metadata.gz: 4f84caee429c713403ecad29afe7610469208bef7051df8eaf01777fe13d2da5116fb0eb51ed91143ce8fd762045922ec917704fdeee0bb3ffcaed459881f566
7
+ data.tar.gz: 4c490990fdd707ee868d85431bc0d6c16b14db23831417c017bff346e3f7787b4e2f30d8112f8a6962e6f341d57cff8616c0c5e50bfe09c79e7b08b5ed89ac86
data/README.md CHANGED
@@ -26,7 +26,7 @@ or CSS3 selectors.
26
26
  [![Test Coverage](https://api.codeclimate.com/v1/badges/59c67b0e8976027a45ad/test_coverage)](https://codeclimate.com/github/sparklemotion/nokogiri/test_coverage)
27
27
 
28
28
  [![Gem Version](https://badge.fury.io/rb/nokogiri.svg)](https://rubygems.org/gems/nokogiri)
29
- [![SemVer compatibility](https://api.dependabot.com/badges/compatibility_score?dependency-name=nokogiri&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=nokogiri&package-manager=bundler&version-scheme=semver)
29
+ [![SemVer compatibility](https://api.dependabot.com/badges/compatibility_score?dependency-name=nokogiri&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score/?dependency-name=nokogiri&package-manager=bundler)
30
30
  [![Tidelift dependencies](https://tidelift.com/badges/github/sparklemotion/nokogiri)](https://tidelift.com/subscription/pkg/rubygems-nokogiri?utm_source=rubygems-nokogiri&utm_medium=referral&utm_campaign=readme)
31
31
 
32
32
 
@@ -129,27 +129,23 @@ end
129
129
 
130
130
  ## Requirements
131
131
 
132
- * Ruby 2.3.0 or higher, including any development packages necessary
133
- to compile native extensions.
132
+ Ruby 2.4.0 or higher, including any development packages necessary to compile native extensions.
134
133
 
135
- * In Nokogiri 1.6.0 and later libxml2 and libxslt are bundled with the
136
- gem, but if you want to use the system versions:
134
+ In Nokogiri 1.6.0 and later libxml2 and libxslt are bundled with the gem, but if you want to use the system versions:
137
135
 
138
- * First, check out [the long list](http://www.xmlsoft.org/news.html)
139
- of fixes and changes between releases before deciding to use any
140
- version older than is bundled with Nokogiri.
136
+ * First, check out [the long list](http://www.xmlsoft.org/news.html)
137
+ of fixes and changes between releases before deciding to use any
138
+ version older than is bundled with Nokogiri.
141
139
 
142
- * At install time, set the environment variable
143
- `NOKOGIRI_USE_SYSTEM_LIBRARIES` or else use the
144
- `--use-system-libraries` argument. (See
145
- https://nokogiri.org/tutorials/installing_nokogiri.html#install-with-system-libraries
146
- for specifics.)
140
+ * At install time, set the environment variable
141
+ `NOKOGIRI_USE_SYSTEM_LIBRARIES` or else use the
142
+ `--use-system-libraries` argument. (See
143
+ https://nokogiri.org/tutorials/installing_nokogiri.html#install-with-system-libraries
144
+ for specifics.)
147
145
 
148
- * libxml2 >=2.6.21 with iconv support
149
- (libxml2-dev/-devel is also required)
146
+ * libxml2 >=2.6.21 with iconv support (libxml2-dev/-devel is also required)
150
147
 
151
- * libxslt, built with and supported by the given libxml2
152
- (libxslt-dev/-devel is also required)
148
+ * libxslt, built with and supported by the given libxml2 (libxslt-dev/-devel is also required)
153
149
 
154
150
 
155
151
  ## Encoding
@@ -191,6 +187,12 @@ explicitly setting the encoding to EUC-JP on the parser:
191
187
  We've adopted the Contributor Covenant code of conduct, which you can read in full in [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).
192
188
 
193
189
 
190
+ ## Semantic Versioning
191
+
192
+ [![SemVer compatibility](https://api.dependabot.com/badges/compatibility_score?dependency-name=nokogiri&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score/?dependency-name=nokogiri&package-manager=bundler)
193
+
194
+ Nokogiri follows [Semantic Versioning](https://semver.org/). See [`CHANGELOG.md`](CHANGELOG.md) for more details.
195
+
194
196
  ## License
195
197
 
196
198
  This project is licensed under the terms of the MIT license.
@@ -486,50 +486,60 @@ else
486
486
  url: "http://zlib.net/fossils/#{recipe.name}-#{recipe.version}.tar.gz",
487
487
  sha256: dependencies["zlib"]["sha256"]
488
488
  }]
489
- class << recipe
490
- attr_accessor :cross_build_p
491
-
492
- def configure
493
- Dir.chdir work_path do
494
- mk = File.read 'win32/Makefile.gcc'
495
- File.open 'win32/Makefile.gcc', 'wb' do |f|
496
- f.puts "BINARY_PATH = #{path}/bin"
497
- f.puts "LIBRARY_PATH = #{path}/lib"
498
- f.puts "INCLUDE_PATH = #{path}/include"
499
- mk.sub!(/^PREFIX\s*=\s*$/, "PREFIX = #{host}-") if cross_build_p
500
- f.puts mk
489
+ if windows?
490
+ class << recipe
491
+ attr_accessor :cross_build_p
492
+
493
+ def configure
494
+ Dir.chdir work_path do
495
+ mk = File.read 'win32/Makefile.gcc'
496
+ File.open 'win32/Makefile.gcc', 'wb' do |f|
497
+ f.puts "BINARY_PATH = #{path}/bin"
498
+ f.puts "LIBRARY_PATH = #{path}/lib"
499
+ f.puts "INCLUDE_PATH = #{path}/include"
500
+ mk.sub!(/^PREFIX\s*=\s*$/, "PREFIX = #{host}-") if cross_build_p
501
+ f.puts mk
502
+ end
501
503
  end
502
504
  end
503
- end
504
505
 
505
- def configured?
506
- Dir.chdir work_path do
507
- !! (File.read('win32/Makefile.gcc') =~ /^BINARY_PATH/)
506
+ def configured?
507
+ Dir.chdir work_path do
508
+ !! (File.read('win32/Makefile.gcc') =~ /^BINARY_PATH/)
509
+ end
508
510
  end
509
- end
510
511
 
511
- def compile
512
- execute "compile", "make -f win32/Makefile.gcc"
513
- end
512
+ def compile
513
+ execute "compile", "make -f win32/Makefile.gcc"
514
+ end
514
515
 
515
- def install
516
- execute "install", "make -f win32/Makefile.gcc install"
516
+ def install
517
+ execute "install", "make -f win32/Makefile.gcc install"
518
+ end
519
+ end
520
+ recipe.cross_build_p = cross_build_p
521
+ else
522
+ class << recipe
523
+ def configure
524
+ execute "configure", ["env", "CHOST=#{host}", "CFLAGS=-fPIC #{ENV['CFLAGS']}", "./configure", "--static", configure_prefix]
525
+ end
517
526
  end
518
527
  end
519
- recipe.cross_build_p = cross_build_p
520
528
  end
521
529
 
522
- libiconv_recipe = process_recipe("libiconv", dependencies["libiconv"]["version"], static_p, cross_build_p) do |recipe|
523
- recipe.files = [{
524
- url: "http://ftp.gnu.org/pub/gnu/libiconv/#{recipe.name}-#{recipe.version}.tar.gz",
525
- sha256: dependencies["libiconv"]["sha256"]
526
- }]
527
- recipe.configure_options += [
528
- "CPPFLAGS=-Wall",
529
- "CFLAGS=-O2 -g",
530
- "CXXFLAGS=-O2 -g",
531
- "LDFLAGS="
532
- ]
530
+ unless nix?
531
+ libiconv_recipe = process_recipe("libiconv", dependencies["libiconv"]["version"], static_p, cross_build_p) do |recipe|
532
+ recipe.files = [{
533
+ url: "http://ftp.gnu.org/pub/gnu/libiconv/#{recipe.name}-#{recipe.version}.tar.gz",
534
+ sha256: dependencies["libiconv"]["sha256"]
535
+ }]
536
+ recipe.configure_options += [
537
+ "CPPFLAGS=-Wall",
538
+ "CFLAGS=-O2 -g",
539
+ "CXXFLAGS=-O2 -g",
540
+ "LDFLAGS="
541
+ ]
542
+ end
533
543
  end
534
544
  else
535
545
  if darwin? && !have_header('iconv.h')
@@ -617,7 +627,6 @@ EOM
617
627
  end
618
628
 
619
629
  # Defining a macro that expands to a C string; double quotes are significant.
620
- $CPPFLAGS << ' ' << "-DNOKOGIRI_#{recipe.name.upcase}_PATH=\"#{recipe.path}\"".inspect
621
630
  $CPPFLAGS << ' ' << "-DNOKOGIRI_#{recipe.name.upcase}_PATCHES=\"#{recipe.patch_files.map { |path| File.basename(path) }.join(' ')}\"".inspect
622
631
 
623
632
  case libname
@@ -76,24 +76,30 @@ void Init_nokogiri()
76
76
  mNokogiriHtmlSax = rb_define_module_under(mNokogiriHtml, "SAX");
77
77
 
78
78
  rb_const_set( mNokogiri,
79
- rb_intern("LIBXML_VERSION"),
79
+ rb_intern("LIBXML_COMPILED_VERSION"),
80
80
  NOKOGIRI_STR_NEW2(LIBXML_DOTTED_VERSION)
81
81
  );
82
82
  rb_const_set( mNokogiri,
83
- rb_intern("LIBXML_PARSER_VERSION"),
83
+ rb_intern("LIBXML_LOADED_VERSION"),
84
84
  NOKOGIRI_STR_NEW2(xmlParserVersion)
85
85
  );
86
86
 
87
+
88
+ rb_const_set( mNokogiri,
89
+ rb_intern("LIBXSLT_COMPILED_VERSION"),
90
+ NOKOGIRI_STR_NEW2(LIBXSLT_DOTTED_VERSION)
91
+ );
92
+ rb_const_set( mNokogiri,
93
+ rb_intern("LIBXSLT_LOADED_VERSION"),
94
+ NOKOGIRI_STR_NEW2(xsltEngineVersion)
95
+ );
96
+
87
97
  #ifdef NOKOGIRI_USE_PACKAGED_LIBRARIES
88
98
  rb_const_set(mNokogiri, rb_intern("NOKOGIRI_USE_PACKAGED_LIBRARIES"), Qtrue);
89
- rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATH"), NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXML2_PATH));
90
- rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXSLT_PATH"), NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXSLT_PATH));
91
99
  rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATCHES"), rb_str_split(NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXML2_PATCHES), " "));
92
100
  rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXSLT_PATCHES"), rb_str_split(NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXSLT_PATCHES), " "));
93
101
  #else
94
102
  rb_const_set(mNokogiri, rb_intern("NOKOGIRI_USE_PACKAGED_LIBRARIES"), Qfalse);
95
- rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATH"), Qnil);
96
- rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXSLT_PATH"), Qnil);
97
103
  rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATCHES"), Qnil);
98
104
  rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXSLT_PATCHES"), Qnil);
99
105
  #endif
@@ -29,6 +29,7 @@ int vasprintf (char **strp, const char *fmt, va_list ap);
29
29
  #include <libxml/relaxng.h>
30
30
  #include <libxml/xinclude.h>
31
31
  #include <libxslt/extensions.h>
32
+ #include <libxslt/xsltconfig.h>
32
33
  #include <libxml/c14n.h>
33
34
  #include <ruby.h>
34
35
  #include <ruby/st.h>
@@ -38,6 +38,15 @@ static void remove_private(xmlNodePtr node)
38
38
  node->_private = NULL;
39
39
  }
40
40
 
41
+ static void mark(xmlDocPtr doc)
42
+ {
43
+ nokogiriTuplePtr tuple = (nokogiriTuplePtr)doc->_private;
44
+ if(tuple) {
45
+ rb_gc_mark(tuple->doc);
46
+ rb_gc_mark(tuple->node_cache);
47
+ }
48
+ }
49
+
41
50
  static void dealloc(xmlDocPtr doc)
42
51
  {
43
52
  st_table *node_hash;
@@ -588,7 +597,7 @@ VALUE Nokogiri_wrap_xml_document(VALUE klass, xmlDocPtr doc)
588
597
 
589
598
  VALUE rb_doc = Data_Wrap_Struct(
590
599
  klass ? klass : cNokogiriXmlDocument,
591
- 0,
600
+ mark,
592
601
  dealloc,
593
602
  doc
594
603
  );
@@ -1332,6 +1332,25 @@ static VALUE line(VALUE self)
1332
1332
  return INT2NUM(xmlGetLineNo(node));
1333
1333
  }
1334
1334
 
1335
+ /*
1336
+ * call-seq:
1337
+ * line=(num)
1338
+ *
1339
+ * Sets the line for this Node. num must be less than 65535.
1340
+ */
1341
+ static VALUE set_line(VALUE self, VALUE num)
1342
+ {
1343
+ xmlNodePtr node;
1344
+ Data_Get_Struct(self, xmlNode, node);
1345
+
1346
+ int value = NUM2INT(num);
1347
+ if (value < 65535) {
1348
+ node->line = value;
1349
+ }
1350
+
1351
+ return num;
1352
+ }
1353
+
1335
1354
  /*
1336
1355
  * call-seq:
1337
1356
  * add_namespace_definition(prefix, href)
@@ -1728,6 +1747,7 @@ void init_xml_node()
1728
1747
  rb_define_method(klass, "create_external_subset", create_external_subset, 3);
1729
1748
  rb_define_method(klass, "pointer_id", pointer_id, 0);
1730
1749
  rb_define_method(klass, "line", line, 0);
1750
+ rb_define_method(klass, "line=", set_line, 1);
1731
1751
  rb_define_method(klass, "content", get_native_content, 0);
1732
1752
  rb_define_method(klass, "native_content=", set_native_content, 1);
1733
1753
  rb_define_method(klass, "lang", get_lang, 0);
@@ -133,31 +133,6 @@ static VALUE read_memory(VALUE klass, VALUE content)
133
133
  return rb_schema;
134
134
  }
135
135
 
136
- /* Schema creation will remove and deallocate "blank" nodes.
137
- * If those blank nodes have been exposed to Ruby, they could get freed
138
- * out from under the VALUE pointer. This function checks to see if any of
139
- * those nodes have been exposed to Ruby, and if so we should raise an exception.
140
- */
141
- static int has_blank_nodes_p(VALUE cache)
142
- {
143
- long i;
144
-
145
- if (NIL_P(cache)) {
146
- return 0;
147
- }
148
-
149
- for (i = 0; i < RARRAY_LEN(cache); i++) {
150
- xmlNodePtr node;
151
- VALUE element = rb_ary_entry(cache, i);
152
- Data_Get_Struct(element, xmlNode, node);
153
- if (xmlIsBlankNode(node)) {
154
- return 1;
155
- }
156
- }
157
-
158
- return 0;
159
- }
160
-
161
136
  /*
162
137
  * call-seq:
163
138
  * from_document(doc)
@@ -177,10 +152,6 @@ static VALUE from_document(VALUE klass, VALUE document)
177
152
  /* In case someone passes us a node. ugh. */
178
153
  doc = doc->doc;
179
154
 
180
- if (has_blank_nodes_p(DOC_NODE_CACHE(doc))) {
181
- rb_raise(rb_eArgError, "Creating a schema from a document that has blank nodes exposed to Ruby is dangerous");
182
- }
183
-
184
155
  ctx = xmlSchemaNewDocParserCtxt(doc);
185
156
 
186
157
  errors = rb_ary_new();
@@ -109,10 +109,6 @@ static VALUE serialize(VALUE self, VALUE xmlobj)
109
109
  return rval ;
110
110
  }
111
111
 
112
- static void swallow_superfluous_xml_errors(void * userdata, xmlErrorPtr error, ...)
113
- {
114
- }
115
-
116
112
  /*
117
113
  * call-seq:
118
114
  * transform(document, params = [])
@@ -1,28 +1,11 @@
1
1
  # -*- coding: utf-8 -*-
2
+ # frozen_string_literal: true
2
3
  # Modify the PATH on windows so that the external DLLs will get loaded.
3
4
 
4
5
  require 'rbconfig'
5
6
 
6
7
  if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
7
- # The line below caused a problem on non-GAE rack environment.
8
- # unless defined?(JRuby::Rack::VERSION) || defined?(AppEngine::ApiProxy)
9
- #
10
- # However, simply cutting defined?(JRuby::Rack::VERSION) off resulted in
11
- # an unable-to-load-nokogiri problem. Thus, now, Nokogiri checks the presense
12
- # of appengine-rack.jar in $LOAD_PATH. If Nokogiri is on GAE, Nokogiri
13
- # should skip loading xml jars. This is because those are in WEB-INF/lib and
14
- # already set in the classpath.
15
- unless $LOAD_PATH.to_s.include?("appengine-rack")
16
- require 'stringio'
17
- require 'isorelax.jar'
18
- require 'jing.jar'
19
- require 'nekohtml.jar'
20
- require 'nekodtd.jar'
21
- require 'xercesImpl.jar'
22
- require 'serializer.jar'
23
- require 'xalan.jar'
24
- require 'xml-apis.jar'
25
- end
8
+ require 'nokogiri/jruby/dependencies'
26
9
  end
27
10
 
28
11
  begin
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'nokogiri/css/node'
2
3
  require 'nokogiri/css/xpath_visitor'
3
4
  x = $-w
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module CSS
3
4
  class Node
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # DO NOT MODIFY!!!!
3
4
  # This file is automatically generated by Racc 1.4.14
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'thread'
2
3
 
3
4
  module Nokogiri
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'nokogiri/syntax_error'
2
3
  module Nokogiri
3
4
  module CSS
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #--
2
3
  # DO NOT MODIFY!!!!
3
4
  # This file is automatically generated by rex 1.0.7
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module CSS
3
4
  class XPathVisitor # :nodoc:
@@ -51,7 +52,8 @@ module Nokogiri
51
52
  when /^comment\(/
52
53
  "comment()"
53
54
  when /^has\(/
54
- ".//#{node.value[1].accept(self)}"
55
+ is_direct = node.value[1].value[0].nil? # e.g. "has(> a)", "has(~ a)", "has(+ a)"
56
+ ".#{"//" if !is_direct}#{node.value[1].accept(self)}"
55
57
  else
56
58
  args = ['.'] + node.value[1..-1]
57
59
  "#{node.value.first}#{args.join(', ')})"
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module Decorators
3
4
  ###
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'nokogiri/html/entity_lookup'
2
3
  require 'nokogiri/html/document'
3
4
  require 'nokogiri/html/document_fragment'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module HTML
3
4
  ###
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module HTML
3
4
  class Document < Nokogiri::XML::Document
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Nokogiri
2
3
  module HTML
3
4
  class DocumentFragment < Nokogiri::XML::DocumentFragment