diff --git a/.travis.yml b/.travis.yml index 826ec7b6..f9647103 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ language: ruby dist: trusty sudo: false before_install: - - if [[ $TRAVIS_RUBY_VERSION =~ ^((1|2\.[012]|jruby-1)\.|ree$) ]]; then gem install rubygems-update --version '~> 2.7' --no-document && update_rubygems; else gem update --system; fi + - if [[ $TRAVIS_RUBY_VERSION =~ ^((1|2\.[012]|jruby-(1|9\.0))\.|ree$) ]]; then gem install rubygems-update --version '~> 2.7' --no-document && update_rubygems; else gem update --system; fi - gem --version - - if [[ $TRAVIS_RUBY_VERSION =~ ^((1|2\.[012]|jruby-1)\.|ree$) ]]; then gem install bundler --version '~> 1.17'; else gem install bundler; fi + - if [[ $TRAVIS_RUBY_VERSION =~ ^((1|2\.[012]|jruby-(1|9\.0))\.|ree$) ]]; then gem install bundler --version '~> 1.17'; else gem install bundler; fi - bundle --version before_script: - bundle update @@ -27,6 +27,7 @@ rvm: - ruby-head - jruby-18mode - 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 a5baef03..13a40626 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -57,6 +57,11 @@ environment: - RUBY_ENGINE: jruby JRUBY_VERSION: 1.7.27 + JRUBY_BUNDLER_VERSION: "~> 1.17" + + - RUBY_ENGINE: jruby + JRUBY_VERSION: 9.0.5.0 + JRUBY_BUNDLER_VERSION: "~> 1.17" - RUBY_ENGINE: jruby JRUBY_VERSION: 9.1.17.0 @@ -69,8 +74,8 @@ install: - if %RUBY_ENGINE%==jruby appveyor DownloadFile https://repo1.maven.org/maven2/org/jruby/jruby-dist/%JRUBY_VERSION%/jruby-dist-%JRUBY_VERSION%-bin.zip -FileName vendor\jruby-dist-%JRUBY_VERSION%-bin.zip - if %RUBY_ENGINE%==jruby 7z x vendor\jruby-dist-%JRUBY_VERSION%-bin.zip -ovendor -y - if %RUBY_ENGINE%==jruby set PATH=C:\projects\tzinfo\vendor\jruby-%JRUBY_VERSION%\bin;%PATH% - - if %RUBY_ENGINE%==jruby if "%JRUBY_VERSION:~0,2%"=="1." gem install bundler --version "~> 1.17" - - if %RUBY_ENGINE%==jruby if not "%JRUBY_VERSION:~0,2%"=="1." gem install bundler + - if %RUBY_ENGINE%==jruby if defined JRUBY_BUNDLER_VERSION gem install bundler --version "%JRUBY_BUNDLER_VERSION%" + - if %RUBY_ENGINE%==jruby if not defined JRUBY_BUNDLER_VERSION gem install bundler - if v%RUBY_VERSION%==v193 appveyor DownloadFile https://github.com/philr/rubyinstaller/releases/download/1.9.3-p551-openssl-tls-1.1-1.2/ruby-1.9.3-p551-i386-mingw32.7z -FileName vendor\ruby-1.9.3-p551-i386-mingw32.7z - if v%RUBY_VERSION%==v193 7z e vendor\ruby-1.9.3-p551-i386-mingw32.7z -ovendor ruby-1.9.3-p551-i386-mingw32\bin\libeay32.dll ruby-1.9.3-p551-i386-mingw32\bin\ssleay32.dll ruby-1.9.3-p551-i386-mingw32\lib\ruby\1.9.1\i386-mingw32\openssl.so ruby-1.9.3-p551-i386-mingw32\lib\ruby\1.9.1\rubygems\ssl_certs\ca-bundle.pem - if v%RUBY_VERSION%==v193 copy /Y vendor\*eay32.dll C:\Ruby193\bin diff --git a/lib/tzinfo/ruby_data_source.rb b/lib/tzinfo/ruby_data_source.rb index 0452c7d1..b5a67524 100644 --- a/lib/tzinfo/ruby_data_source.rb +++ b/lib/tzinfo/ruby_data_source.rb @@ -1,5 +1,7 @@ module TZInfo - using RubyCoreSupport::UntaintExt if RubyCoreSupport.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, RubyCoreSupport::UntaintExt) if RubyCoreSupport.const_defined?(:UntaintExt) # A DataSource that loads data from the set of Ruby modules included in the # TZInfo::Data library (tzinfo-data gem). diff --git a/lib/tzinfo/zoneinfo_timezone_info.rb b/lib/tzinfo/zoneinfo_timezone_info.rb index 668ded55..4688ca61 100644 --- a/lib/tzinfo/zoneinfo_timezone_info.rb +++ b/lib/tzinfo/zoneinfo_timezone_info.rb @@ -1,5 +1,7 @@ module TZInfo - using RubyCoreSupport::UntaintExt if RubyCoreSupport.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, RubyCoreSupport::UntaintExt) if RubyCoreSupport.const_defined?(:UntaintExt) # An InvalidZoneinfoFile exception is raised if an attempt is made to load an # invalid zoneinfo file. diff --git a/test/tc_country.rb b/test/tc_country.rb index 211cb3fb..faa3bb52 100644 --- a/test/tc_country.rb +++ b/test/tc_country.rb @@ -2,7 +2,9 @@ include TZInfo -using TaintExt if Module.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, TaintExt) if Module.const_defined?(:TaintExt) class TCCountry < Minitest::Test def setup diff --git a/test/tc_ruby_data_source.rb b/test/tc_ruby_data_source.rb index 67e90e81..790dd8eb 100644 --- a/test/tc_ruby_data_source.rb +++ b/test/tc_ruby_data_source.rb @@ -2,7 +2,9 @@ include TZInfo -using TaintExt if Module.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, TaintExt) if Module.const_defined?(:TaintExt) class TCRubyDataSource < Minitest::Test def setup diff --git a/test/tc_timezone.rb b/test/tc_timezone.rb index 82cef9c7..0dc06111 100644 --- a/test/tc_timezone.rb +++ b/test/tc_timezone.rb @@ -2,7 +2,9 @@ include TZInfo -using TaintExt if Module.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, TaintExt) if Module.const_defined?(:TaintExt) class TCTimezone < Minitest::Test diff --git a/test/tc_zoneinfo_timezone_info.rb b/test/tc_zoneinfo_timezone_info.rb index 32c7f504..8bf4e841 100644 --- a/test/tc_zoneinfo_timezone_info.rb +++ b/test/tc_zoneinfo_timezone_info.rb @@ -5,7 +5,9 @@ include TZInfo -using RubyCoreSupport::UntaintExt if RubyCoreSupport.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, RubyCoreSupport::UntaintExt) if RubyCoreSupport.const_defined?(:UntaintExt) class TCZoneinfoTimezoneInfo < Minitest::Test diff --git a/test/test_utils.rb b/test/test_utils.rb index a8cec197..bf669886 100644 --- a/test/test_utils.rb +++ b/test/test_utils.rb @@ -116,6 +116,10 @@ def assert_array_same_items(expected, actual, msg = nil) end def assert_sub_process_returns(expected_lines, code, extra_load_path = [], required = ['tzinfo']) + if RUBY_ENGINE == 'jruby' && JRUBY_VERSION.start_with?('9.0.') && RbConfig::CONFIG['host_os'] =~ /mswin/ + skip('JRuby 9.0 on Windows cannot handle writing to the IO instance returned by popen') + end + ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT'])