From d3ab684f4621edaeacb2304237ef482ffc5fe2d7 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sun, 7 Mar 2021 12:25:23 -0500 Subject: [PATCH 1/6] format: lib/nokogiri/extension.rb --- lib/nokogiri/extension.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nokogiri/extension.rb b/lib/nokogiri/extension.rb index ec3df14a7a..b7de485bb5 100644 --- a/lib/nokogiri/extension.rb +++ b/lib/nokogiri/extension.rb @@ -2,11 +2,11 @@ # load the C or Java extension begin - RUBY_VERSION =~ /(\d+\.\d+)/ - require "nokogiri/#{$1}/nokogiri" + ::RUBY_VERSION =~ /(\d+\.\d+)/ + require "nokogiri/#{Regexp.last_match(1)}/nokogiri" rescue LoadError => e if e.message =~ /GLIBC/ - warn <<~EOM + warn(<<~EOM) ERROR: It looks like you're trying to use Nokogiri as a precompiled native gem on a system with glibc < 2.17: From f39b954de0b65b123cb681a91d9cca3362135d58 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sun, 7 Mar 2021 15:42:19 -0500 Subject: [PATCH 2/6] format: rubocopfmt version/info.rb --- lib/nokogiri/version/info.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nokogiri/version/info.rb b/lib/nokogiri/version/info.rb index 3aba750b26..2cb8c23bbf 100644 --- a/lib/nokogiri/version/info.rb +++ b/lib/nokogiri/version/info.rb @@ -82,8 +82,8 @@ def to_hash unless jruby? cppflags = ["-I#{header_directory.shellescape}"] if libxml2_using_packaged? - cppflags << "-I#{File.join(header_directory, "include").shellescape}" - cppflags << "-I#{File.join(header_directory, "include/libxml2").shellescape}" + cppflags << "-I#{File.join(header_directory, 'include').shellescape}" + cppflags << "-I#{File.join(header_directory, 'include/libxml2').shellescape}" end nokogiri["cppflags"] = cppflags end From dea46d8b2d49776952e8a19964f8376a40c2e402 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 4 Mar 2021 16:12:23 -0500 Subject: [PATCH 3/6] doc: update docs link printed during dependency compilation --- ext/nokogiri/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index 385de29e26..e5bef4f305 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -470,7 +470,7 @@ def process_recipe(name, version, static_p, cross_p) instead, then abort this installation process and install nokogiri as instructed at: - https://nokogiri.org/tutorials/installing_nokogiri.html#install-with-system-libraries + https://nokogiri.org/tutorials/installing_nokogiri.html#installing-using-standard-system-libraries EOM From 3cc2167617b61ac938497a28f9be89af06d17fc7 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sat, 6 Mar 2021 12:59:24 -0500 Subject: [PATCH 4/6] doc: update CHANGELOG's 1.11.x headers to be consistent --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c32b04db8..77358751b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,14 +20,14 @@ Nokogiri follows [Semantic Versioning](https://semver.org/), please see the [REA * [JRuby] Update the algorithm used to calculate `Node#line` to be wrong less-often. The underlying parser, Xerces, does not track line numbers, and so we've always used a hacky solution for this method. [[#1223](https://github.com/sparklemotion/nokogiri/issues/1223)] -## v1.11.1 / 2021-01-06 +## 1.11.1 / 2021-01-06 ### Fixed * [CRuby] If `libxml-ruby` is loaded before `nokogiri`, the SAX and Push parsers no longer call `libxml-ruby`'s handlers. Instead, they defensively override the libxml2 global handler before parsing. [[#2168](https://github.com/sparklemotion/nokogiri/issues/2168)] -## v1.11.0 / 2021-01-03 +## 1.11.0 / 2021-01-03 ### Notes From fb10fe5171e85781b3dd721ce97860b370cd19f9 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sat, 6 Mar 2021 13:00:05 -0500 Subject: [PATCH 5/6] doc: pull in helpful language from the README to CONTRIBUTING --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e3d7cb394b..d5c1a3ea46 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,6 +47,8 @@ Nokogiri supports both CRuby and JRuby, and has native code specific to each (th - Whenever possible, implement shared behavior as shared Ruby code (i.e., write as little native code as reasonable). - Whenever possible, write tests that are not platform-specific (which includes skipping). +Notably, despite all parsers being standards-compliant, there are behavioral inconsistencies between the parsers used in the CRuby and JRuby implementations, and Nokogiri does not and should not attempt to remove these inconsistencies. Instead, we surface these differences in the test suite when they are important/semantic; or we intentionally write tests to depend only on the important/semantic bits (omitting whitespace from regex matchers on results, for example). + Nokogiri is widely used in the Ruby ecosystem, and so extra care should be taken to avoid introducing breaking changes. Please read our [Semantic Versioning Policy](https://nokogiri.org/index.html#semantic-versioning-policy) to understand what we consider to be a breaking change. From a0c372c6a949696211693a9b88698fc848ea7c67 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 4 Mar 2021 16:13:56 -0500 Subject: [PATCH 6/6] dev: add "test:lldb" rake task --- rakelib/test.rake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rakelib/test.rake b/rakelib/test.rake index dfbe186a18..b9a64a9743 100644 --- a/rakelib/test.rake +++ b/rakelib/test.rake @@ -64,6 +64,13 @@ class GdbTestTask < ValgrindTestTask end end +class LldbTestTask < ValgrindTestTask + def ruby(*args, **options, &block) + command = "lldb #{RUBY} -- #{args.join(' ')}" + sh(command, **options, &block) + end +end + def nokogiri_test_task_configuration(t) t.libs << "test" t.test_files = FileList["test/**/test_*.rb"] @@ -82,4 +89,8 @@ namespace "test" do GdbTestTask.new("gdb") do |t| nokogiri_test_task_configuration(t) end + + LldbTestTask.new("lldb") do |t| + nokogiri_test_task_configuration(t) + end end