Skip to content

Commit

Permalink
Merge pull request #2587 from sparklemotion/flavorjones-dep-neko-html…
Browse files Browse the repository at this point in the history
…unit-2.63.0

dep: neko-htmlunit update to 2.63.0
  • Loading branch information
flavorjones committed Jul 10, 2022
2 parents d95858f + 13a4128 commit 3f8b5a2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
Binary file not shown.
6 changes: 3 additions & 3 deletions lib/nokogiri/jruby/nokogiri_jars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@
require 'jar_dependencies'
rescue LoadError
require 'xalan/xalan/2.7.2/xalan-2.7.2.jar'
require 'net/sourceforge/htmlunit/neko-htmlunit/2.63.0/neko-htmlunit-2.63.0.jar'
require 'nu/validator/jing/20200702VNU/jing-20200702VNU.jar'
require 'xerces/xercesImpl/2.12.2/xercesImpl-2.12.2.jar'
require 'org/nokogiri/nekodtd/0.1.11.noko1/nekodtd-0.1.11.noko1.jar'
require 'net/sf/saxon/Saxon-HE/9.6.0-4/Saxon-HE-9.6.0-4.jar'
require 'xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar'
require 'xalan/serializer/2.7.2/serializer-2.7.2.jar'
require 'net/sourceforge/htmlunit/neko-htmlunit/2.61.0/neko-htmlunit-2.61.0.jar'
require 'isorelax/isorelax/20030108/isorelax-20030108.jar'
end

if defined? Jars
require_jar 'xalan', 'xalan', '2.7.2'
require_jar 'net.sourceforge.htmlunit', 'neko-htmlunit', '2.63.0'
require_jar 'nu.validator', 'jing', '20200702VNU'
require_jar 'xerces', 'xercesImpl', '2.12.2'
require_jar 'org.nokogiri', 'nekodtd', '0.1.11.noko1'
require_jar 'net.sf.saxon', 'Saxon-HE', '9.6.0-4'
require_jar 'xml-apis', 'xml-apis', '1.4.01'
require_jar 'xalan', 'serializer', '2.7.2'
require_jar 'net.sourceforge.htmlunit', 'neko-htmlunit', '2.61.0'
require_jar 'isorelax', 'isorelax', '20030108'
end

# generated by the :vendor_jars rake task
module Nokogiri
JAR_DEPENDENCIES = {"isorelax:isorelax"=>"20030108", "net.sf.saxon:Saxon-HE"=>"9.6.0-4", "net.sourceforge.htmlunit:neko-htmlunit"=>"2.61.0", "nu.validator:jing"=>"20200702VNU", "org.nokogiri:nekodtd"=>"0.1.11.noko1", "xalan:serializer"=>"2.7.2", "xalan:xalan"=>"2.7.2", "xerces:xercesImpl"=>"2.12.2", "xml-apis:xml-apis"=>"1.4.01"}.freeze
JAR_DEPENDENCIES = {"isorelax:isorelax"=>"20030108", "net.sf.saxon:Saxon-HE"=>"9.6.0-4", "net.sourceforge.htmlunit:neko-htmlunit"=>"2.63.0", "nu.validator:jing"=>"20200702VNU", "org.nokogiri:nekodtd"=>"0.1.11.noko1", "xalan:serializer"=>"2.7.2", "xalan:xalan"=>"2.7.2", "xerces:xercesImpl"=>"2.12.2", "xml-apis:xml-apis"=>"1.4.01"}.freeze
XERCES_VERSION = JAR_DEPENDENCIES["xerces:xercesImpl"]
NEKO_VERSION = JAR_DEPENDENCIES["net.sourceforge.htmlunit:neko-htmlunit"]
end
4 changes: 2 additions & 2 deletions nokogiri.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ Gem::Specification.new do |spec|
"lib/nokogiri/jruby/dependencies.rb",
"lib/nokogiri/jruby/isorelax/isorelax/20030108/isorelax-20030108.jar",
"lib/nokogiri/jruby/net/sf/saxon/Saxon-HE/9.6.0-4/Saxon-HE-9.6.0-4.jar",
"lib/nokogiri/jruby/net/sourceforge/htmlunit/neko-htmlunit/2.61.0/neko-htmlunit-2.61.0.jar",
"lib/nokogiri/jruby/net/sourceforge/htmlunit/neko-htmlunit/2.63.0/neko-htmlunit-2.63.0.jar",
"lib/nokogiri/jruby/nokogiri_jars.rb",
"lib/nokogiri/jruby/nu/validator/jing/20200702VNU/jing-20200702VNU.jar",
"lib/nokogiri/jruby/org/nokogiri/nekodtd/0.1.11.noko1/nekodtd-0.1.11.noko1.jar",
Expand Down Expand Up @@ -325,7 +325,7 @@ Gem::Specification.new do |spec|
spec.require_paths << "lib/nokogiri/jruby" # where we install the jars, see the :vendor_jars rake task
spec.requirements << "jar isorelax, isorelax, 20030108" # https://search.maven.org/artifact/isorelax/isorelax
spec.requirements << "jar org.nokogiri, nekodtd, 0.1.11.noko1"
spec.requirements << "jar net.sourceforge.htmlunit, neko-htmlunit, 2.61.0"
spec.requirements << "jar net.sourceforge.htmlunit, neko-htmlunit, 2.63.0"
spec.requirements << "jar nu.validator, jing, 20200702VNU" # https://search.maven.org/artifact/nu.validator/jing
spec.requirements << "jar xalan, serializer, 2.7.2" # https://search.maven.org/artifact/xalan/serializer
spec.requirements << "jar xalan, xalan, 2.7.2" # https://search.maven.org/artifact/xalan/xalan
Expand Down
19 changes: 4 additions & 15 deletions test/xml/test_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ class TestNode < Nokogiri::TestCase
describe Nokogiri::XML::Node do
let(:xml) { Nokogiri::XML(File.read(XML_FILE), XML_FILE) }

def pending_if_neko_htmlunit_is_not_patched_with_21286e4(&block)
# see https://github.com/sparklemotion/nekohtml/commit/21286e4de6c05d40c2ebdda11805082fde36188b
pending_if("nekohtml 21286e4 should be applied to neko-htmlunit", Nokogiri::VERSION_INFO["other_libraries"]["net.sourceforge.htmlunit:neko-htmlunit"], &block)
end

def test_first_element_child
node = xml.root.first_element_child
assert_equal("employee", node.name)
Expand Down Expand Up @@ -100,9 +95,7 @@ def test_node_context_parsing_of_malformed_html_fragment
context_node = doc.at_css("div")
nodeset = context_node.parse("<div </div>")

pending_if_neko_htmlunit_is_not_patched_with_21286e4 do
assert_equal(1, doc.errors.length)
end
assert_equal(1, doc.errors.length)
assert_equal(1, nodeset.length)
assert_equal("<div></div>", nodeset.to_s)
assert_instance_of(Nokogiri::HTML4::Document, nodeset.document)
Expand All @@ -114,9 +107,7 @@ def test_node_context_parsing_of_malformed_html_fragment_with_recover_is_correct
context_node = doc.at_css("div")
nodeset = context_node.parse("<div </div>", &:recover)

pending_if_neko_htmlunit_is_not_patched_with_21286e4 do
assert_equal(1, doc.errors.length)
end
assert_equal(1, doc.errors.length)
assert_equal(1, nodeset.length)
assert_equal("<div></div>", nodeset.to_s)
assert_instance_of(Nokogiri::HTML4::Document, nodeset.document)
Expand All @@ -126,10 +117,8 @@ def test_node_context_parsing_of_malformed_html_fragment_with_recover_is_correct
def test_node_context_parsing_of_malformed_html_fragment_without_recover_is_not_corrected
doc = HTML4.parse("<html><body><div></div></body></html>")
context_node = doc.at_css("div")
pending_if_neko_htmlunit_is_not_patched_with_21286e4 do
assert_raises(Nokogiri::XML::SyntaxError) do
context_node.parse("<div </div>", &:strict)
end
assert_raises(Nokogiri::XML::SyntaxError) do
context_node.parse("<div </div>", &:strict)
end
end

Expand Down

0 comments on commit 3f8b5a2

Please sign in to comment.