Class: Nanoc::Extra::JRubyNokogiriWarner

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/nanoc/extra/jruby_nokogiri_warner.rb

Constant Summary

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

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (JRubyNokogiriWarner) initialize

Returns a new instance of JRubyNokogiriWarner



31
32
33
# File 'lib/nanoc/extra/jruby_nokogiri_warner.rb', line 31

def initialize
  @warned = false
end

Class Method Details

+ (Object) check_and_warn



27
28
29
# File 'lib/nanoc/extra/jruby_nokogiri_warner.rb', line 27

def self.check_and_warn
  instance.check_and_warn
end

Instance Method Details

- (Object) check_and_warn



35
36
37
38
39
40
41
42
# File 'lib/nanoc/extra/jruby_nokogiri_warner.rb', line 35

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

  $stderr.puts TEXT
  @warned = true
end