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



33
34
35
# File 'lib/nanoc/extra/jruby_nokogiri_warner.rb', line 33

def initialize
  @warned = false
end

Class Method Details

+ (Object) check_and_warn



29
30
31
# File 'lib/nanoc/extra/jruby_nokogiri_warner.rb', line 29

def self.check_and_warn
  instance.check_and_warn
end

Instance Method Details

- (Object) check_and_warn



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

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

  $stderr.puts TEXT
  @warned = true
end