diff --git a/.travis.yml b/.travis.yml index 33eba8be..beef6067 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ rvm: - 2.7.0 - ruby-head - jruby-1.7.27 + - jruby-9.0.5.0 - jruby-9.1.17.0 - jruby-9.2.9.0 - jruby-head diff --git a/appveyor.yml b/appveyor.yml index 9bff7e00..c49e2f09 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -56,6 +56,9 @@ environment: - RUBY_ENGINE: jruby JRUBY_VERSION: 1.7.27 + - RUBY_ENGINE: jruby + JRUBY_VERSION: 9.0.5.0 + - RUBY_ENGINE: jruby JRUBY_VERSION: 9.1.17.0 diff --git a/lib/tzinfo/data_sources/ruby_data_source.rb b/lib/tzinfo/data_sources/ruby_data_source.rb index bc608e84..d2dbb269 100644 --- a/lib/tzinfo/data_sources/ruby_data_source.rb +++ b/lib/tzinfo/data_sources/ruby_data_source.rb @@ -2,7 +2,9 @@ # frozen_string_literal: true module TZInfo - using UntaintExt if TZInfo.const_defined?(:UntaintExt) + # Use send as a workaround for erroneous 'wrong number of arguments' errors + # with JRuby 9.0.5.0 when calling methods with Java implementations. See #114. + send(:using, UntaintExt) if TZInfo.const_defined?(:UntaintExt) module DataSources # A {TZInfoDataNotFound} exception is raised if the tzinfo-data gem could diff --git a/lib/tzinfo/data_sources/zoneinfo_data_source.rb b/lib/tzinfo/data_sources/zoneinfo_data_source.rb index ea58d203..f14a4838 100644 --- a/lib/tzinfo/data_sources/zoneinfo_data_source.rb +++ b/lib/tzinfo/data_sources/zoneinfo_data_source.rb @@ -2,7 +2,9 @@ # frozen_string_literal: true module TZInfo - using UntaintExt if TZInfo.const_defined?(:UntaintExt) + # Use send as a workaround for erroneous 'wrong number of arguments' errors + # with JRuby 9.0.5.0 when calling methods with Java implementations. See #114. + send(:using, UntaintExt) if TZInfo.const_defined?(:UntaintExt) module DataSources # An {InvalidZoneinfoDirectory} exception is raised if {ZoneinfoDataSource} diff --git a/lib/tzinfo/data_sources/zoneinfo_reader.rb b/lib/tzinfo/data_sources/zoneinfo_reader.rb index b74d162a..c1e78207 100644 --- a/lib/tzinfo/data_sources/zoneinfo_reader.rb +++ b/lib/tzinfo/data_sources/zoneinfo_reader.rb @@ -2,7 +2,9 @@ # frozen_string_literal: true module TZInfo - using UntaintExt if TZInfo.const_defined?(:UntaintExt) + # Use send as a workaround for erroneous 'wrong number of arguments' errors + # with JRuby 9.0.5.0 when calling methods with Java implementations. See #114. + send(:using, UntaintExt) if TZInfo.const_defined?(:UntaintExt) module DataSources # An {InvalidZoneinfoFile} exception is raised if an attempt is made to load diff --git a/test/data_sources/tc_ruby_data_source.rb b/test/data_sources/tc_ruby_data_source.rb index 21259a48..f9adcd37 100644 --- a/test/data_sources/tc_ruby_data_source.rb +++ b/test/data_sources/tc_ruby_data_source.rb @@ -3,7 +3,9 @@ require_relative '../test_utils' -using TestUtils::TaintExt if TestUtils.const_defined?(:TaintExt) +# Use send as a workaround for erroneous 'wrong number of arguments' errors with +# JRuby 9.0.5.0 when calling methods with Java implementations. See #114. +send(:using, TestUtils::TaintExt) if TestUtils.const_defined?(:TaintExt) include TZInfo diff --git a/test/data_sources/tc_zoneinfo_data_source.rb b/test/data_sources/tc_zoneinfo_data_source.rb index 9da3ede9..b5f4dfad 100644 --- a/test/data_sources/tc_zoneinfo_data_source.rb +++ b/test/data_sources/tc_zoneinfo_data_source.rb @@ -8,8 +8,10 @@ include TZInfo -using TestUtils::TaintExt if TestUtils.const_defined?(:TaintExt) -using UntaintExt if TZInfo.const_defined?(:UntaintExt) +# Use send as a workaround for erroneous 'wrong number of arguments' errors with +# JRuby 9.0.5.0 when calling methods with Java implementations. See #114. +send(:using, TestUtils::TaintExt) if TestUtils.const_defined?(:TaintExt) +send(:using, UntaintExt) if TZInfo.const_defined?(:UntaintExt) module DataSources class TCZoneinfoDataSource < Minitest::Test @@ -543,6 +545,8 @@ def test_load_timezone_info_directory test_encodings('UTF-8', 'UTF-16').each do |encoding| define_method("test_load_timezone_info_file_is_directory_with_#{encoding.to_method}_encoded_identifier") do + skip('JRuby 9.0.5.0 hangs when attempting to read a directory') if RUBY_ENGINE == 'jruby' && JRUBY_VERSION.start_with?('9.0.') + Dir.mktmpdir('tzinfo_test') do |dir| FileUtils.touch(File.join(dir, 'zone.tab')) FileUtils.touch(File.join(dir, 'iso3166.tab')) diff --git a/test/data_sources/tc_zoneinfo_reader.rb b/test/data_sources/tc_zoneinfo_reader.rb index 1c7e10d1..6693988a 100644 --- a/test/data_sources/tc_zoneinfo_reader.rb +++ b/test/data_sources/tc_zoneinfo_reader.rb @@ -6,7 +6,9 @@ include TZInfo -using UntaintExt if TZInfo.const_defined?(:UntaintExt) +# Use send as a workaround for erroneous 'wrong number of arguments' errors with +# JRuby 9.0.5.0 when calling methods with Java implementations. See #114. +send(:using, UntaintExt) if TZInfo.const_defined?(:UntaintExt) module DataSources class TCZoneinfoReader < Minitest::Test diff --git a/test/tc_country.rb b/test/tc_country.rb index 61a1b5eb..b0326200 100644 --- a/test/tc_country.rb +++ b/test/tc_country.rb @@ -5,7 +5,9 @@ include TZInfo -using TestUtils::TaintExt if TestUtils.const_defined?(:TaintExt) +# Use send as a workaround for erroneous 'wrong number of arguments' errors with +# JRuby 9.0.5.0 when calling methods with Java implementations. See #114. +send(:using, TestUtils::TaintExt) if TestUtils.const_defined?(:TaintExt) class TCCountry < Minitest::Test def setup diff --git a/test/tc_timezone.rb b/test/tc_timezone.rb index a6a2d7d1..5f198f09 100644 --- a/test/tc_timezone.rb +++ b/test/tc_timezone.rb @@ -5,7 +5,9 @@ include TZInfo -using TestUtils::TaintExt if TestUtils.const_defined?(:TaintExt) +# Use send as a workaround for erroneous 'wrong number of arguments' errors with +# JRuby 9.0.5.0 when calling methods with Java implementations. See #114. +send(:using, TestUtils::TaintExt) if TestUtils.const_defined?(:TaintExt) class TCTimezone < Minitest::Test class << self