summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2014-03-05 17:21:13 -0700
committerDan Allen <dan.j.allen@gmail.com>2014-03-05 17:21:13 -0700
commit320a88bd397250bd38ec648fec56cb2634b45173 (patch)
tree85ff607e8e931248e2bb1e7f2e0725e1d80b2f1b
parent6ee108eee7cfe025f6a33961c05ad9dd12a42feb (diff)
fix Opal compatibility error loading converter APIs
-rw-r--r--lib/asciidoctor/converter/base.rb2
-rw-r--r--lib/asciidoctor/converter/factory.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/asciidoctor/converter/base.rb b/lib/asciidoctor/converter/base.rb
index 87109334..7dad8f96 100644
--- a/lib/asciidoctor/converter/base.rb
+++ b/lib/asciidoctor/converter/base.rb
@@ -1,4 +1,6 @@
module Asciidoctor
+ module Converter; end if RUBY_ENGINE_OPAL
+
# An abstract base class for defining converters that can be used to convert
# {AbstractNode} objects in a parsed AsciiDoc document to a backend format
# such as HTML or DocBook.
diff --git a/lib/asciidoctor/converter/factory.rb b/lib/asciidoctor/converter/factory.rb
index 89491cbf..369f021c 100644
--- a/lib/asciidoctor/converter/factory.rb
+++ b/lib/asciidoctor/converter/factory.rb
@@ -44,7 +44,7 @@ module Asciidoctor
def default initialize_singleton = true
return @__default__ || new unless initialize_singleton
@__default__ ||= begin
- require 'thread_safe' unless defined? ::ThreadSafe
+ require 'thread_safe'.to_s unless defined? ::ThreadSafe
new ::ThreadSafe::Cache.new
rescue ::LoadError
warn 'asciidoctor: WARNING: gem \'thread_safe\' is not installed. This gem recommended when registering custom converters.'