Skip to content

Commit

Permalink
Make it compatible with JRuby 9000
Browse files Browse the repository at this point in the history
  • Loading branch information
jirutka committed Jan 2, 2015
1 parent 8908c5d commit 748d54a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ rvm:
- 2.2.0
- 2.1.0
- 2.0.0
- jruby-head
addons:
code_climate:
repo_token:
Expand Down
2 changes: 1 addition & 1 deletion asciidoctor-doctest.gemspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# coding: utf-8
require_relative 'lib/asciidoctor/doctest/version'
require File.expand_path('lib/asciidoctor/doctest/version', __dir__)

Gem::Specification.new do |s|
s.name = 'asciidoctor-doctest'
Expand Down
3 changes: 3 additions & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
FileUtils.mkdir_p TEMP_DIR
# overwrite Aruba's default temp directory location
@dirs = [TEMP_DIR]

# Increase timeout for JRuby, that is very slooow...
@aruba_timeout_seconds = 50
end

After do
Expand Down
2 changes: 2 additions & 0 deletions lib/asciidoctor/doctest/asciidoc_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
require 'active_support/core_ext/object/blank'
require 'asciidoctor'
require 'asciidoctor/converter/template'
require 'asciidoctor/doctest/core_ext'
require 'delegate'

module Asciidoctor
module DocTest
Expand Down
15 changes: 15 additions & 0 deletions lib/asciidoctor/doctest/core_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,18 @@ def concat(obj, separator = nil)
end
end
end


# Workarounds for JRuby.
if RUBY_ENGINE == 'jruby'
require 'delegate'

# @private
class SimpleDelegator

# https://github.com/jruby/jruby/issues/2412
def warn(*msg)
Kernel.warn(*msg)
end
end
end

0 comments on commit 748d54a

Please sign in to comment.