Sha256: 2f36675a1c6eafccaa9447665058462d6f7175cc4b554982de7c7d7afb386059

Contents?: true

Size: 1.15 KB

Versions: 11

Compression:

Stored size: 1.15 KB

Contents

require 'singleton'

module Nanoc::Extra
  # @api private
  class JRubyNokogiriWarner
    include Singleton

    TEXT = <<EOS
--------------------------------------------------------------------------------
Note:

The behavior of Pure Java Nokogiri differs from the Nokogiri used on the
standard Ruby interpreter (MRI) due to differences in underlying libraries.

These sometimes problematic behavioral differences can cause Nanoc filters not
to function properly, if at all. If you need reliable (X)HTML and XML handling
functionality, consider not using Nokogiri on JRuby for the time being.

These issues are being worked on both from the Nokogiri and the Nanoc side. Keep
your Nokogiri and Nanoc versions up to date!

For details, see https://github.com/nanoc/nanoc/pull/422.
--------------------------------------------------------------------------------
EOS

    def self.check_and_warn
      instance.check_and_warn
    end

    def initialize
      @warned = false
    end

    def check_and_warn
      return unless defined?(RUBY_ENGINE)
      return if RUBY_ENGINE != 'jruby'
      return if @warned

      $stderr.puts TEXT
      @warned = true
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nanoc-4.1.1 lib/nanoc/extra/jruby_nokogiri_warner.rb
nanoc-4.1.0 lib/nanoc/extra/jruby_nokogiri_warner.rb
nanoc-4.1.0rc2 lib/nanoc/extra/jruby_nokogiri_warner.rb
nanoc-4.1.0rc1 lib/nanoc/extra/jruby_nokogiri_warner.rb
nanoc-4.1.0b1 lib/nanoc/extra/jruby_nokogiri_warner.rb
nanoc-4.1.0a1 lib/nanoc/extra/jruby_nokogiri_warner.rb
nanoc-4.0.2 lib/nanoc/extra/jruby_nokogiri_warner.rb
nanoc-4.0.1 lib/nanoc/extra/jruby_nokogiri_warner.rb
nanoc-4.0.0 lib/nanoc/extra/jruby_nokogiri_warner.rb
nanoc-4.0.0rc3 lib/nanoc/extra/jruby_nokogiri_warner.rb
nanoc-4.0.0rc2 lib/nanoc/extra/jruby_nokogiri_warner.rb