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 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. 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 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: 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 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