ruby-changes:53860
From: nobu <ko1@a...>
Date: Wed, 28 Nov 2018 23:18:48 +0900 (JST)
Subject: [ruby-changes:53860] nobu:r66079 (trunk): Try with TZInfo and Timezone gems
nobu 2018-11-28 23:08:34 +0900 (Wed, 28 Nov 2018) New Revision: 66079 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66079 Log: Try with TZInfo and Timezone gems Modified files: trunk/.travis.yml trunk/appveyor.yml trunk/test/ruby/test_time_tz.rb Index: test/ruby/test_time_tz.rb =================================================================== --- test/ruby/test_time_tz.rb (revision 66078) +++ test/ruby/test_time_tz.rb (revision 66079) @@ -603,3 +603,41 @@ class TestTimeTZ::DummyTZ < Test::Unit:: https://github.com/ruby/ruby/blob/trunk/test/ruby/test_time_tz.rb#L603 TestTimeTZ::TZ.new(tzname, abbr, utc_offset) end end + +begin + require "tzinfo" +rescue LoadError +else + class TestTimeTZ::GemTZInfo < Test::Unit::TestCase + include TestTimeTZ::WithTZ + + class TIME_CLASS < ::Time + def self.find_timezone(tzname) + TZInfo::Timezone.get(tzname) + end + end + + def tz + @tz ||= TZInfo::Timezone.get(tzname) + end + end +end + +begin + require "timezone" +rescue LoadError +else + class TestTimeTZ::GemTimezone < Test::Unit::TestCase + include TestTimeTZ::WithTZ + + class TIME_CLASS < ::Time + def self.find_timezone(name) + Timezone[name] + end + end + + def tz + @tz ||= Timezone[tzname] + end + end +end Index: .travis.yml =================================================================== --- .travis.yml (revision 66078) +++ .travis.yml (revision 66079) @@ -76,6 +76,8 @@ env: https://github.com/ruby/ruby/blob/trunk/.travis.yml#L76 # JOBS and SETARCH are overridden when necessary; see below. - JOBS=-j$((1+${NPROC})) - SETARCH= + - RUBY_PREFIX=/tmp/ruby-prefix + - GEMS_FOR_TEST='timezone tzinfo' .org.ruby-lang.ci.matrix-definitions: @@ -343,7 +345,7 @@ before_script: https://github.com/ruby/ruby/blob/trunk/.travis.yml#L345 [ ! -f config.cache ] || [ "$CC" = "`sed -n s/^ac_cv_prog_CC=//p config.cache`" ] || (set -x; exec rm config.cache) - - $SETARCH ../configure -C --disable-install-doc --prefix=/tmp/ruby-prefix $CONFIG_FLAG + - $SETARCH ../configure -C --disable-install-doc --prefix=$RUBY_PREFIX $CONFIG_FLAG - cp -pr config.cache config.status .ext/include ../config_1st - $SETARCH make reconfig - cp -pr config.cache config.status .ext/include ../config_2nd @@ -354,6 +356,7 @@ before_script: https://github.com/ruby/ruby/blob/trunk/.travis.yml#L356 - chmod u-w .. - $SETARCH make -s $JOBS && make install - ccache --show-stats + - [ -z "${GEMS_FOR_TEST}" ] || $RUBY_PREFIX/bin/gem install --no-document $GEMS_FOR_TEST script: - $SETARCH make -s test TESTOPTS="${TESTOPTS=$JOBS -q --tty=no}" Index: appveyor.yml =================================================================== --- appveyor.yml (revision 66078) +++ appveyor.yml (revision 66079) @@ -16,6 +16,7 @@ environment: https://github.com/ruby/ruby/blob/trunk/appveyor.yml#L16 - build: vs vs: 140 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + GEMS_FOR_TEST: "timezone tzinfo" notifications: - provider: Webhook url: @@ -89,6 +90,7 @@ for: https://github.com/ruby/ruby/blob/trunk/appveyor.yml#L90 - nmake -l - nmake install-nodoc - \usr\bin\ruby -v -e "p :locale => Encoding.find('locale'), :filesystem => Encoding.find('filesystem')" + - if not "%GEMS_FOR_TEST%" == "" \usr\bin\gem install --no-document %GEMS_FOR_TEST% test_script: - set /a JOBS=%NUMBER_OF_PROCESSORS% - nmake -l "TESTOPTS=-v -q" btest @@ -134,6 +136,7 @@ for: https://github.com/ruby/ruby/blob/trunk/appveyor.yml#L136 - mingw32-make -j%JOBS% up - mingw32-make -j%JOBS% - mingw32-make DESTDIR=../install install-nodoc + - if not "%GEMS_FOR_TEST%" == "" ..\install\bin\gem install --no-document %GEMS_FOR_TEST% test_script: - mingw32-make test - mingw32-make test-all TESTOPTS="--retry --job-status=normal --show-skip --subprocess-timeout-scale=1.5 --excludes=../ruby/test/excludes/_appveyor -j %JOBS% --exclude win32ole --exclude test_open-uri" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/