commit 4b77767cf917112cb1408555ebbe588c333946b8 Author: tigro Date: Thu Sep 21 21:06:58 2023 +0300 import rubygem-tzinfo-2.0.5-3.el9 diff --git a/.rubygem-tzinfo.metadata b/.rubygem-tzinfo.metadata new file mode 100644 index 0000000..e69de29 diff --git a/SOURCES/rubygem-tzinfo-2.0.5-fix-include-issues-ruby32.patch b/SOURCES/rubygem-tzinfo-2.0.5-fix-include-issues-ruby32.patch new file mode 100644 index 0000000..dd06fd3 --- /dev/null +++ b/SOURCES/rubygem-tzinfo-2.0.5-fix-include-issues-ruby32.patch @@ -0,0 +1,1031 @@ +From f76bc7fc824a831a159f080ea2fdeade47dc1e38 Mon Sep 17 00:00:00 2001 +From: Phil Ross +Date: Fri, 23 Sep 2022 19:50:25 +0100 +Subject: [PATCH] Fix include issues with tests on Ruby 3.2. + +Ruby 3.2 changes how includes are handled (see +https://redmine.ruby-lang.org/issues/18832). This breaks the +DataSources, Format1 and Format2 test cases (references to constants in +the respective modules are not found). + +Add includes for TZInfo::DataSources, TZInfo::Format1 and +TZInfo::Format2 into test classes. + +Move the TZInfo include too to stop the pollution of Object (top-level +scope). +--- + .../tc_constant_offset_data_timezone_info.rb | 5 +++-- + test/data_sources/tc_country_info.rb | 5 +++-- + test/data_sources/tc_data_timezone_info.rb | 5 +++-- + test/data_sources/tc_linked_timezone_info.rb | 5 +++-- + test/data_sources/tc_posix_time_zone_parser.rb | 7 +++++-- + test/data_sources/tc_ruby_data_source.rb | 5 +++-- + test/data_sources/tc_timezone_info.rb | 5 +++-- + test/data_sources/tc_transitions_data_timezone_info.rb | 5 +++-- + test/data_sources/tc_zoneinfo_data_source.rb | 7 ++++--- + test/data_sources/tc_zoneinfo_reader.rb | 7 ++++--- + test/format1/tc_country_definer.rb | 5 +++-- + test/format1/tc_country_index_definition.rb | 4 ++-- + test/format1/tc_timezone_definer.rb | 5 +++-- + test/format1/tc_timezone_definition.rb | 5 +++-- + test/format1/tc_timezone_index_definition.rb | 5 +++-- + test/format2/tc_country_definer.rb | 5 +++-- + test/format2/tc_country_index_definer.rb | 5 +++-- + test/format2/tc_country_index_definition.rb | 4 ++-- + test/format2/tc_timezone_definer.rb | 5 +++-- + test/format2/tc_timezone_definition.rb | 5 +++-- + test/format2/tc_timezone_index_definer.rb | 5 +++-- + test/format2/tc_timezone_index_definition.rb | 5 +++-- + test/tc_annual_rules.rb | 5 ++--- + test/tc_country.rb | 4 ++-- + test/tc_country_timezone.rb | 4 ++-- + test/tc_data_source.rb | 10 ++++++++-- + test/tc_data_timezone.rb | 3 +-- + test/tc_datetime_with_offset.rb | 4 ++-- + test/tc_info_timezone.rb | 4 ++-- + test/tc_linked_timezone.rb | 3 +-- + test/tc_offset_timezone_period.rb | 3 +-- + test/tc_ruby_time_timezone.rb | 4 ++-- + test/tc_string_deduper.rb | 4 ++-- + test/tc_time_with_offset.rb | 4 ++-- + test/tc_timestamp.rb | 4 ++-- + test/tc_timestamp_with_offset.rb | 4 ++-- + test/tc_timezone.rb | 6 ++++-- + test/tc_timezone_london.rb | 4 ++-- + test/tc_timezone_melbourne.rb | 4 ++-- + test/tc_timezone_new_york.rb | 4 ++-- + test/tc_timezone_offset.rb | 3 +-- + test/tc_timezone_period.rb | 4 ++-- + test/tc_timezone_proxy.rb | 4 ++-- + test/tc_timezone_transition.rb | 3 +-- + test/tc_timezone_utc.rb | 4 ++-- + test/tc_transition_rule.rb | 8 ++++++-- + test/tc_transitions_timezone_period.rb | 3 +-- + test/tc_tzinfo.rb | 2 ++ + test/tc_with_offset.rb | 6 +++--- + test/test_utils.rb | 6 +++--- + test/ts_all.rb | 2 +- + 51 files changed, 133 insertions(+), 104 deletions(-) + +diff --git a/test/data_sources/tc_constant_offset_data_timezone_info.rb b/test/data_sources/tc_constant_offset_data_timezone_info.rb +index 1401559a..03204909 100644 +--- a/test/data_sources/tc_constant_offset_data_timezone_info.rb ++++ b/test/data_sources/tc_constant_offset_data_timezone_info.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module DataSources + class TCConstantOffsetDataTimezoneInfo < Minitest::Test ++ include TZInfo ++ include TZInfo::DataSources ++ + def test_initialize + offset = TimezoneOffset.new(-17900, 0, 'TESTLMT') + identifier = 'Test/Zone'.dup +diff --git a/test/data_sources/tc_country_info.rb b/test/data_sources/tc_country_info.rb +index aab8f90a..bd4da08a 100644 +--- a/test/data_sources/tc_country_info.rb ++++ b/test/data_sources/tc_country_info.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module DataSources + class TCCountryInfo < Minitest::Test ++ include TZInfo ++ include TZInfo::DataSources ++ + def test_initialize_nil_code + error = assert_raises(ArgumentError) { CountryInfo.new(nil, 'Zzz', []) } + assert_match(/\bcode\b/, error.message) +diff --git a/test/data_sources/tc_data_timezone_info.rb b/test/data_sources/tc_data_timezone_info.rb +index b5822db8..72f0fbef 100644 +--- a/test/data_sources/tc_data_timezone_info.rb ++++ b/test/data_sources/tc_data_timezone_info.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module DataSources + class TCDataTimezoneInfo < Minitest::Test ++ include TZInfo ++ include TZInfo::DataSources ++ + def test_initialize_nil_identifier + error = assert_raises(ArgumentError) { DataTimezoneInfo.new(nil) } + assert_match(/\bidentifier\b/, error.message) +diff --git a/test/data_sources/tc_linked_timezone_info.rb b/test/data_sources/tc_linked_timezone_info.rb +index 36b8fec4..5a7e8c76 100644 +--- a/test/data_sources/tc_linked_timezone_info.rb ++++ b/test/data_sources/tc_linked_timezone_info.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module DataSources + class TCLinkedTimezoneInfo < Minitest::Test ++ include TZInfo ++ include TZInfo::DataSources ++ + def test_initialize_nil_identifier + error = assert_raises(ArgumentError) { LinkedTimezoneInfo.new(nil, 'Test/Linked') } + assert_match(/\bidentifier\b/, error.message) +diff --git a/test/data_sources/tc_posix_time_zone_parser.rb b/test/data_sources/tc_posix_time_zone_parser.rb +index d6c8c352..73dbb747 100644 +--- a/test/data_sources/tc_posix_time_zone_parser.rb ++++ b/test/data_sources/tc_posix_time_zone_parser.rb +@@ -3,18 +3,21 @@ + + require_relative '../test_utils' + +-include TZInfo +- + # 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) + + module DataSources + class TCPosixTimeZoneParser < Minitest::Test ++ include TZInfo ++ include TZInfo::DataSources ++ + HOUR = 3600 + MINUTE = 60 + + class << self ++ include TZInfo::DataSources ++ + private + + def append_time_to_rule(day_rule, time) +diff --git a/test/data_sources/tc_ruby_data_source.rb b/test/data_sources/tc_ruby_data_source.rb +index 8baab05e..1447bc76 100644 +--- a/test/data_sources/tc_ruby_data_source.rb ++++ b/test/data_sources/tc_ruby_data_source.rb +@@ -7,10 +7,11 @@ + # JRuby 9.0.5.0 when calling methods with Java implementations. See #114. + send(:using, TestUtils::TaintExt) if TestUtils.const_defined?(:TaintExt) + +-include TZInfo +- + module DataSources + class TCRubyDataSource < Minitest::Test ++ include TZInfo ++ include TZInfo::DataSources ++ + def setup + @data_source = RubyDataSource.new + end +diff --git a/test/data_sources/tc_timezone_info.rb b/test/data_sources/tc_timezone_info.rb +index 00cda364..e643e9e8 100644 +--- a/test/data_sources/tc_timezone_info.rb ++++ b/test/data_sources/tc_timezone_info.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module DataSources + class TCTimezoneInfo < Minitest::Test ++ include TZInfo ++ include TZInfo::DataSources ++ + def test_initialize_nil_identifier + error = assert_raises(ArgumentError) { TimezoneInfo.new(nil) } + assert_match(/\bidentifier\b/, error.message) +diff --git a/test/data_sources/tc_transitions_data_timezone_info.rb b/test/data_sources/tc_transitions_data_timezone_info.rb +index 830c1222..35e67a97 100644 +--- a/test/data_sources/tc_transitions_data_timezone_info.rb ++++ b/test/data_sources/tc_transitions_data_timezone_info.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module DataSources + class TCTransitionsDataTimezoneInfo < Minitest::Test ++ include TZInfo ++ include TZInfo::DataSources ++ + def test_initialize_transitions + o1 = TimezoneOffset.new(-17900, 0, 'TESTLMT') + o2 = TimezoneOffset.new(-18000, 3600, 'TESTD') +diff --git a/test/data_sources/tc_zoneinfo_data_source.rb b/test/data_sources/tc_zoneinfo_data_source.rb +index 064eed8e..5327d3bb 100644 +--- a/test/data_sources/tc_zoneinfo_data_source.rb ++++ b/test/data_sources/tc_zoneinfo_data_source.rb +@@ -6,15 +6,16 @@ + require 'pathname' + require 'tmpdir' + +-include TZInfo +- + # 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) ++send(:using, TZInfo.const_get(:UntaintExt)) if TZInfo.const_defined?(:UntaintExt) + + module DataSources + class TCZoneinfoDataSource < Minitest::Test ++ include TZInfo ++ include TZInfo::DataSources ++ + ZONEINFO_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..', 'zoneinfo')).untaint + + def setup +diff --git a/test/data_sources/tc_zoneinfo_reader.rb b/test/data_sources/tc_zoneinfo_reader.rb +index 3de88978..4a52228f 100644 +--- a/test/data_sources/tc_zoneinfo_reader.rb ++++ b/test/data_sources/tc_zoneinfo_reader.rb +@@ -4,14 +4,15 @@ + require_relative '../test_utils' + require 'tempfile' + +-include TZInfo +- + # 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) ++send(:using, TZInfo.const_get(:UntaintExt)) if TZInfo.const_defined?(:UntaintExt) + + module DataSources + class TCZoneinfoReader < Minitest::Test ++ include TZInfo ++ include TZInfo::DataSources ++ + class FakePosixTimeZoneParser + def initialize(&block) + @on_parse = block +diff --git a/test/format1/tc_country_definer.rb b/test/format1/tc_country_definer.rb +index 64a5ce8e..02b09f97 100644 +--- a/test/format1/tc_country_definer.rb ++++ b/test/format1/tc_country_definer.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format1 + class TCCountryDefiner < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format1) ++ + def setup + @identifier_deduper = StringDeduper.new + @description_deduper = StringDeduper.new +diff --git a/test/format1/tc_country_index_definition.rb b/test/format1/tc_country_index_definition.rb +index c86044ae..4406ff35 100644 +--- a/test/format1/tc_country_index_definition.rb ++++ b/test/format1/tc_country_index_definition.rb +@@ -3,10 +3,10 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format1 + class TCCountryIndexDefinition < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format1) + + def test_none + m = Module.new +diff --git a/test/format1/tc_timezone_definer.rb b/test/format1/tc_timezone_definer.rb +index 575f1b2e..80fa5df1 100644 +--- a/test/format1/tc_timezone_definer.rb ++++ b/test/format1/tc_timezone_definer.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format1 + class TCTimezoneDefiner < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format1) ++ + def setup + @string_deduper = StringDeduper.new + @definer = TimezoneDefiner.new(@string_deduper) +diff --git a/test/format1/tc_timezone_definition.rb b/test/format1/tc_timezone_definition.rb +index 1c279a4c..1e42d457 100644 +--- a/test/format1/tc_timezone_definition.rb ++++ b/test/format1/tc_timezone_definition.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format1 + class TCTimezoneDefinition < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format1) ++ + def test_timezone_definer_class + m = Module.new + m.send(:include, TimezoneDefinition) +diff --git a/test/format1/tc_timezone_index_definition.rb b/test/format1/tc_timezone_index_definition.rb +index 9ac59b66..fc39a169 100644 +--- a/test/format1/tc_timezone_index_definition.rb ++++ b/test/format1/tc_timezone_index_definition.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format1 + class TCTimezoneIndexDefinition < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format1) ++ + def test_mixed + m = Module.new + m.send(:include, TimezoneIndexDefinition) +diff --git a/test/format2/tc_country_definer.rb b/test/format2/tc_country_definer.rb +index d0f1a7ad..29d24abf 100644 +--- a/test/format2/tc_country_definer.rb ++++ b/test/format2/tc_country_definer.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format2 + class TCCountryDefiner < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format2) ++ + def setup + @identifier_deduper = StringDeduper.new + @description_deduper = StringDeduper.new +diff --git a/test/format2/tc_country_index_definer.rb b/test/format2/tc_country_index_definer.rb +index c8a799fb..d88cb943 100644 +--- a/test/format2/tc_country_index_definer.rb ++++ b/test/format2/tc_country_index_definer.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format2 + class TCCountryIndexDefiner < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format2) ++ + def setup + @identifier_deduper = StringDeduper.new + @description_deduper = StringDeduper.new +diff --git a/test/format2/tc_country_index_definition.rb b/test/format2/tc_country_index_definition.rb +index 5fa3042d..1f4dba51 100644 +--- a/test/format2/tc_country_index_definition.rb ++++ b/test/format2/tc_country_index_definition.rb +@@ -3,10 +3,10 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format2 + class TCCountryIndexDefinition < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format2) + + def test_not_defined + m = Module.new +diff --git a/test/format2/tc_timezone_definer.rb b/test/format2/tc_timezone_definer.rb +index 5bdbf768..f2e60297 100644 +--- a/test/format2/tc_timezone_definer.rb ++++ b/test/format2/tc_timezone_definer.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format2 + class TCTimezoneDefiner < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format2) ++ + def setup + @string_deduper = StringDeduper.new + @definer = TimezoneDefiner.new(@string_deduper) +diff --git a/test/format2/tc_timezone_definition.rb b/test/format2/tc_timezone_definition.rb +index 4ce8fdd6..4c212fb8 100644 +--- a/test/format2/tc_timezone_definition.rb ++++ b/test/format2/tc_timezone_definition.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format2 + class TCTimezoneDefinition < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format2) ++ + def test_timezone_definer_class + m = Module.new + m.send(:include, TimezoneDefinition) +diff --git a/test/format2/tc_timezone_index_definer.rb b/test/format2/tc_timezone_index_definer.rb +index dec121c6..42542c7e 100644 +--- a/test/format2/tc_timezone_index_definer.rb ++++ b/test/format2/tc_timezone_index_definer.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format2 + class TCTimezoneIndexDefiner < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format2) ++ + def setup + @string_deduper = StringDeduper.new + @definer = TimezoneIndexDefiner.new(@string_deduper) +diff --git a/test/format2/tc_timezone_index_definition.rb b/test/format2/tc_timezone_index_definition.rb +index 62f4dd48..e61b798e 100644 +--- a/test/format2/tc_timezone_index_definition.rb ++++ b/test/format2/tc_timezone_index_definition.rb +@@ -3,10 +3,11 @@ + + require_relative '../test_utils' + +-include TZInfo +- + module Format2 + class TCTimezoneIndexDefinition < Minitest::Test ++ include TZInfo ++ include TZInfo.const_get(:Format2) ++ + def test_mixed + m = Module.new + m.send(:include, TimezoneIndexDefinition) +diff --git a/test/tc_annual_rules.rb b/test/tc_annual_rules.rb +index 25af4bc1..8905b6a0 100644 +--- a/test/tc_annual_rules.rb ++++ b/test/tc_annual_rules.rb +@@ -3,9 +3,8 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCAnnualRules < Minitest::Test ++ include TZInfo + + def test_initialize + std_offset = TimezoneOffset.new(0, 0, 'GMT') +@@ -92,7 +91,7 @@ def initialize(month, day) + end + + def at(offset, year) +- TimestampWithOffset.for(Time.new(year, @month, @day, 0, 0, 0, offset.observed_utc_offset)).set_timezone_offset(offset) ++ TZInfo::TimestampWithOffset.for(Time.new(year, @month, @day, 0, 0, 0, offset.observed_utc_offset)).set_timezone_offset(offset) + end + end + end +diff --git a/test/tc_country.rb b/test/tc_country.rb +index b0326200..02883f9e 100644 +--- a/test/tc_country.rb ++++ b/test/tc_country.rb +@@ -3,13 +3,13 @@ + + require_relative 'test_utils' + +-include TZInfo +- + # 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 ++ include TZInfo ++ + def setup + @orig_data_source = DataSource.get + end +diff --git a/test/tc_country_timezone.rb b/test/tc_country_timezone.rb +index e175f2ed..343abbfe 100644 +--- a/test/tc_country_timezone.rb ++++ b/test/tc_country_timezone.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCCountryTimezone < Minitest::Test ++ include TZInfo ++ + def test_identifier + ct = CountryTimezone.new('Europe/London', Rational(2059, 40), Rational(-5, 16)) + assert_equal('Europe/London', ct.identifier) +diff --git a/test/tc_data_source.rb b/test/tc_data_source.rb +index 1bdbe8a9..af977b18 100644 +--- a/test/tc_data_source.rb ++++ b/test/tc_data_source.rb +@@ -4,9 +4,9 @@ + require_relative 'test_utils' + require 'tmpdir' + +-include TZInfo +- + class TCDataSource < Minitest::Test ++ include TZInfo ++ + class InitDataSource < DataSource + end + +@@ -23,6 +23,8 @@ def initialize + end + + class GetTimezoneInfoTestDataSource < TestDataSource ++ include TZInfo ++ + protected + + def load_timezone_info(identifier) +@@ -33,6 +35,8 @@ def load_timezone_info(identifier) + end + + class GetCountryInfoTestDataSource < TestDataSource ++ include TZInfo ++ + protected + + def load_country_info(code) +@@ -88,6 +92,8 @@ def call_lookup_country_info(hash, code, encoding = Encoding::UTF_8) + end + + class EagerLoadTestDataSource < GetTimezoneIdentifiersTestDataSource ++ include TZInfo ++ + attr_reader :country_codes_called + attr_reader :loaded_timezones + attr_reader :loaded_countries +diff --git a/test/tc_data_timezone.rb b/test/tc_data_timezone.rb +index 2dffa279..4cdb52a5 100644 +--- a/test/tc_data_timezone.rb ++++ b/test/tc_data_timezone.rb +@@ -3,9 +3,8 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCDataTimezone < Minitest::Test ++ include TZInfo + + class TestTimezoneInfo < DataSources::TimezoneInfo + attr_reader :timestamp +diff --git a/test/tc_datetime_with_offset.rb b/test/tc_datetime_with_offset.rb +index 6b0e8f5f..2164b82a 100644 +--- a/test/tc_datetime_with_offset.rb ++++ b/test/tc_datetime_with_offset.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCDateTimeWithOffset < Minitest::Test ++ include TZInfo ++ + def datetime_with_offset(year, month, day, hour, minute, second, tz_offset) + DateTimeWithOffset.new(year, month, day, hour, minute, second, tz_offset.observed_utc_offset.to_r / 86400).set_timezone_offset(tz_offset) + end +diff --git a/test/tc_info_timezone.rb b/test/tc_info_timezone.rb +index 8673fee3..1a988a1b 100644 +--- a/test/tc_info_timezone.rb ++++ b/test/tc_info_timezone.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCInfoTimezone < Minitest::Test ++ include TZInfo ++ + def test_identifier + tz = InfoTimezone.new(DataSources::TimezoneInfo.new('Test/Identifier')) + assert_equal('Test/Identifier', tz.identifier) +diff --git a/test/tc_linked_timezone.rb b/test/tc_linked_timezone.rb +index 1b590cf8..72e2c1f6 100644 +--- a/test/tc_linked_timezone.rb ++++ b/test/tc_linked_timezone.rb +@@ -3,9 +3,8 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCLinkedTimezone < Minitest::Test ++ include TZInfo + + class TestTimezone < Timezone + attr_reader :period_for_result +diff --git a/test/tc_offset_timezone_period.rb b/test/tc_offset_timezone_period.rb +index 776d9a3d..cd9a1936 100644 +--- a/test/tc_offset_timezone_period.rb ++++ b/test/tc_offset_timezone_period.rb +@@ -3,9 +3,8 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCOffsetTimezonePeriod < Minitest::Test ++ include TZInfo + + def test_initialize + o = TimezoneOffset.new(-7200, 3600, 'SPECIAL') +diff --git a/test/tc_ruby_time_timezone.rb b/test/tc_ruby_time_timezone.rb +index e38911ed..cfc8012a 100644 +--- a/test/tc_ruby_time_timezone.rb ++++ b/test/tc_ruby_time_timezone.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCRubyTimeTimezone < Minitest::Test ++ include TZInfo ++ + def test_new_time_with_time_zone_paris + check_can_create_time_with_time_zone + +diff --git a/test/tc_string_deduper.rb b/test/tc_string_deduper.rb +index 4217569a..74cbdf11 100644 +--- a/test/tc_string_deduper.rb ++++ b/test/tc_string_deduper.rb +@@ -4,9 +4,9 @@ + require_relative 'test_utils' + require 'concurrent' + +-include TZInfo +- + class TCStringDeduper < Minitest::Test ++ include TZInfo ++ + def test_string_deduper_dedupe + dedupe_tests(StringDeduper.new) + end +diff --git a/test/tc_time_with_offset.rb b/test/tc_time_with_offset.rb +index 2d4be53a..3f133523 100644 +--- a/test/tc_time_with_offset.rb ++++ b/test/tc_time_with_offset.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTimeWithOffset < Minitest::Test ++ include TZInfo ++ + def time_with_offset(year, month, day, hour, minute, second, tz_offset) + TimeWithOffset.new(year, month, day, hour, minute, second, tz_offset.observed_utc_offset).set_timezone_offset(tz_offset) + end +diff --git a/test/tc_timestamp.rb b/test/tc_timestamp.rb +index 6132f5bf..26d19cfc 100644 +--- a/test/tc_timestamp.rb ++++ b/test/tc_timestamp.rb +@@ -4,9 +4,9 @@ + require_relative 'test_utils' + require 'date' + +-include TZInfo +- + class TCTimestamp < Minitest::Test ++ include TZInfo ++ + class TestTimestampSubclass < Timestamp + end + +diff --git a/test/tc_timestamp_with_offset.rb b/test/tc_timestamp_with_offset.rb +index 1029fddf..0b7a41fd 100644 +--- a/test/tc_timestamp_with_offset.rb ++++ b/test/tc_timestamp_with_offset.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTimestampWithOffset < Minitest::Test ++ include TZInfo ++ + def new_timestamp(year, month, day, hour, minute, second, offset, klass = Timestamp) + time = Time.new(year, month, day, hour, minute, second, offset == :utc ? 0 : offset) + klass.new(time.to_i, time.subsec, offset) +diff --git a/test/tc_timezone.rb b/test/tc_timezone.rb +index 5f198f09..0dc3300b 100644 +--- a/test/tc_timezone.rb ++++ b/test/tc_timezone.rb +@@ -3,14 +3,16 @@ + + require_relative 'test_utils' + +-include TZInfo +- + # 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 ++ include TZInfo ++ + class << self ++ include TZInfo ++ + private + + def time_with_unspecified_offset_test(method) +diff --git a/test/tc_timezone_london.rb b/test/tc_timezone_london.rb +index fdbe2c43..b57c7e00 100644 +--- a/test/tc_timezone_london.rb ++++ b/test/tc_timezone_london.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTimezoneLondon < Minitest::Test ++ include TZInfo ++ + def test_2004 + #Europe/London Sun Mar 28 00:59:59 2004 UTC = Sun Mar 28 00:59:59 2004 GMT isdst=0 gmtoff=0 + #Europe/London Sun Mar 28 01:00:00 2004 UTC = Sun Mar 28 02:00:00 2004 BST isdst=1 gmtoff=3600 +diff --git a/test/tc_timezone_melbourne.rb b/test/tc_timezone_melbourne.rb +index 6912c2c0..0fd7bf82 100644 +--- a/test/tc_timezone_melbourne.rb ++++ b/test/tc_timezone_melbourne.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTimezoneMelbourne < Minitest::Test ++ include TZInfo ++ + def test_2004 + #Australia/Melbourne Sat Mar 27 15:59:59 2004 UTC = Sun Mar 28 02:59:59 2004 AEDT isdst=1 gmtoff=39600 + #Australia/Melbourne Sat Mar 27 16:00:00 2004 UTC = Sun Mar 28 02:00:00 2004 AEST isdst=0 gmtoff=36000 +diff --git a/test/tc_timezone_new_york.rb b/test/tc_timezone_new_york.rb +index 27b4d630..b067b16d 100644 +--- a/test/tc_timezone_new_york.rb ++++ b/test/tc_timezone_new_york.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTimezoneNewYork < Minitest::Test ++ include TZInfo ++ + def test_2004 + #America/New_York Sun Apr 4 06:59:59 2004 UTC = Sun Apr 4 01:59:59 2004 EST isdst=0 gmtoff=-18000 + #America/New_York Sun Apr 4 07:00:00 2004 UTC = Sun Apr 4 03:00:00 2004 EDT isdst=1 gmtoff=-14400 +diff --git a/test/tc_timezone_offset.rb b/test/tc_timezone_offset.rb +index 3c0740db..0cc1119c 100644 +--- a/test/tc_timezone_offset.rb ++++ b/test/tc_timezone_offset.rb +@@ -3,9 +3,8 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTimezoneOffset < Minitest::Test ++ include TZInfo + + [:base_utc_offset, :utc_offset].each do |method| + define_method("test_#{method}") do +diff --git a/test/tc_timezone_period.rb b/test/tc_timezone_period.rb +index 80e29ddc..ec949714 100644 +--- a/test/tc_timezone_period.rb ++++ b/test/tc_timezone_period.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTimezonePeriod < Minitest::Test ++ include TZInfo ++ + class TestTimezonePeriod < TimezonePeriod + attr_reader :start_transition + attr_reader :end_transition +diff --git a/test/tc_timezone_proxy.rb b/test/tc_timezone_proxy.rb +index 8b2788af..58526019 100644 +--- a/test/tc_timezone_proxy.rb ++++ b/test/tc_timezone_proxy.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTimezoneProxy < Minitest::Test ++ include TZInfo ++ + def assert_raises_invalid_timezone_identifier(identifier) + error = assert_raises(InvalidTimezoneIdentifier) { yield } + assert_match(Regexp.new('\b' + Regexp.escape(identifier) + '\b'), error.message) +diff --git a/test/tc_timezone_transition.rb b/test/tc_timezone_transition.rb +index 518c3b5f..7a991336 100644 +--- a/test/tc_timezone_transition.rb ++++ b/test/tc_timezone_transition.rb +@@ -4,9 +4,8 @@ + require_relative 'test_utils' + require 'date' + +-include TZInfo +- + class TCTimezoneTransition < Minitest::Test ++ include TZInfo + + def test_offset + t = TimezoneTransition.new(TimezoneOffset.new(3600, 3600, 'TDT'), +diff --git a/test/tc_timezone_utc.rb b/test/tc_timezone_utc.rb +index 11500bbf..bf1a5abd 100644 +--- a/test/tc_timezone_utc.rb ++++ b/test/tc_timezone_utc.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTimezoneUTC < Minitest::Test ++ include TZInfo ++ + def test_2004 + tz = Timezone.get('UTC') + +diff --git a/test/tc_transition_rule.rb b/test/tc_transition_rule.rb +index 838455f7..79f8738c 100644 +--- a/test/tc_transition_rule.rb ++++ b/test/tc_transition_rule.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTransitionRule < Minitest::Test ++ include TZInfo ++ + [-1, 0, 1].each do |transition_at| + define_method "test_transition_at_#{transition_at}" do + rule = TestTransitionRule.new(transition_at) +@@ -110,6 +110,7 @@ def test_invalid_transition_at + end + + class TCAbsoluteDayOfYearTransitionRule < Minitest::Test ++ include TZInfo + include BaseTransitionRuleTestHelper + + [-1, 366, '0'].each do |value| +@@ -214,6 +215,7 @@ def create_with_transition_at(transition_at) + end + + class TCJulianDayOfYearTransitionRule < Minitest::Test ++ include TZInfo + include BaseTransitionRuleTestHelper + + [0, 366, '1'].each do |value| +@@ -357,6 +359,7 @@ def test_is_not_always_last_day_of_year + end + + class TCDayOfMonthTransitionRule < Minitest::Test ++ include TZInfo + include BaseTransitionRuleTestHelper + include DayOfWeekTransitionRuleTestHelper + +@@ -463,6 +466,7 @@ def create_with_month_and_day_of_week(month, day_of_week) + end + + class TCLastDayOfMonthTransitionRule < Minitest::Test ++ include TZInfo + include BaseTransitionRuleTestHelper + include DayOfWeekTransitionRuleTestHelper + +diff --git a/test/tc_transitions_timezone_period.rb b/test/tc_transitions_timezone_period.rb +index 8bb0ca08..55a27025 100644 +--- a/test/tc_transitions_timezone_period.rb ++++ b/test/tc_transitions_timezone_period.rb +@@ -3,9 +3,8 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCTransitionsTimezonePeriod < Minitest::Test ++ include TZInfo + + def test_initialize_start_end + std = TimezoneOffset.new(-7200, 0, 'TEST') +diff --git a/test/tc_tzinfo.rb b/test/tc_tzinfo.rb +index c24e226b..67e336c3 100644 +--- a/test/tc_tzinfo.rb ++++ b/test/tc_tzinfo.rb +@@ -4,6 +4,8 @@ + require_relative 'test_utils' + + class TCTZInfo < Minitest::Test ++ include TZInfo ++ + def test_eager_load + test_data_source = Minitest::Mock.new + test_data_source.expect(:kind_of?, true, [DataSource]) +diff --git a/test/tc_with_offset.rb b/test/tc_with_offset.rb +index ed52f833..b5dfc72f 100644 +--- a/test/tc_with_offset.rb ++++ b/test/tc_with_offset.rb +@@ -3,9 +3,9 @@ + + require_relative 'test_utils' + +-include TZInfo +- + class TCWithOffset < Minitest::Test ++ include TZInfo ++ + class TestBaseClass + attr_reader :format + attr_accessor :strftime_result +@@ -17,7 +17,7 @@ def strftime(format) + end + + class TestClass < TestBaseClass +- include WithOffset ++ include TZInfo::WithOffset + + attr_accessor :timezone_offset + +diff --git a/test/test_utils.rb b/test/test_utils.rb +index 4dca87b5..ec83bf30 100644 +--- a/test/test_utils.rb ++++ b/test/test_utils.rb +@@ -210,11 +210,11 @@ def type + end + + def time(year, month, day, hour, minute, second, sub_second = 0, utc_offset = nil) +- Timestamp.create(year, month, day, hour, minute, second, sub_second, utc_offset) ++ TZInfo::Timestamp.create(year, month, day, hour, minute, second, sub_second, utc_offset) + end + + def time_with_offset(offset, year, month, day, hour, minute, second, sub_second = 0) +- TimestampWithOffset.create(year, month, day, hour, minute, second, sub_second, offset.observed_utc_offset).set_timezone_offset(offset) ++ TZInfo::TimestampWithOffset.create(year, month, day, hour, minute, second, sub_second, offset.observed_utc_offset).set_timezone_offset(offset) + end + end + +@@ -499,7 +499,7 @@ def assert_equal_with_offset(expected, actual) + # equal. + def assert_equal_with_offset_and_timezone_offset(expected, actual) + assert_equal_with_offset(expected, actual) +- assert_kind_of(TimezoneOffset, actual.timezone_offset) ++ assert_kind_of(TZInfo::TimezoneOffset, actual.timezone_offset) + assert_equal(expected.timezone_offset, actual.timezone_offset) + end + +diff --git a/test/ts_all.rb b/test/ts_all.rb +index 93fab598..0dfb3347 100644 +--- a/test/ts_all.rb ++++ b/test/ts_all.rb +@@ -7,4 +7,4 @@ + + Dir[File.join(File.expand_path(File.dirname(__FILE__)), '**', 'tc_*.rb')].each {|t| require t} + +-puts "Using #{DataSource.get}" ++puts "Using #{TZInfo::DataSource.get}" diff --git a/SOURCES/tzinfo-2.0.5-tests.txz b/SOURCES/tzinfo-2.0.5-tests.txz new file mode 100644 index 0000000..234811f Binary files /dev/null and b/SOURCES/tzinfo-2.0.5-tests.txz differ diff --git a/SOURCES/tzinfo-2.0.5.gem b/SOURCES/tzinfo-2.0.5.gem new file mode 100644 index 0000000..1b28f07 Binary files /dev/null and b/SOURCES/tzinfo-2.0.5.gem differ diff --git a/SPECS/rubygem-tzinfo.spec b/SPECS/rubygem-tzinfo.spec new file mode 100644 index 0000000..e700cfd --- /dev/null +++ b/SPECS/rubygem-tzinfo.spec @@ -0,0 +1,221 @@ +# Generated from tzinfo-0.3.26.gem by gem2rpm -*- rpm-spec -*- +%global gem_name tzinfo + +Name: rubygem-%{gem_name} +Version: 2.0.5 +Release: 3%{?dist} +Summary: Daylight savings aware timezone library +License: MIT +URL: https://tzinfo.github.io +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# Gem file does not contain a test suite, you can create it like so: +# git clone https://github.com/tzinfo/tzinfo.git --no-checkout +# cd tzinfo && git archive -v -o tzinfo-2.0.5-tests.txz v2.0.5 test/ +Source1: %{gem_name}-%{version}-tests.txz +# https://github.com/tzinfo/tzinfo/commit/f76bc7fc824a831a159f080ea2fdeade47dc1e38 +# Ruby 3.2 changes how includes are handled +Patch0: %{name}-2.0.5-fix-include-issues-ruby32.patch + +BuildRequires: ruby(release) +BuildRequires: rubygems-devel +BuildRequires: ruby +BuildRequires: rubygem(minitest) +BuildRequires: rubygem(concurrent-ruby) +BuildArch: noarch + +%description +TZInfo provides access to time zone data and allows times to be converted +using time zone rules. + + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{name}. + +%prep +%setup -q -n %{gem_name}-%{version} -b1 +( +cd %{_builddir}/test +%patch0 -p2 +) + +%build +gem build ../%{gem_name}-%{version}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +%check +pushd .%{gem_instdir} +ln -s %{_builddir}/test . + +# We don't want to use bundler +sed -i "/raise 'Tests must be run with bundler/ s/^/#/" \ + test/test_utils.rb + +export RUBYOPT="-Ilib" + +ruby test/ts_all_ruby_format1.rb +ruby test/ts_all_ruby_format2.rb +ruby test/ts_all_zoneinfo.rb + +# Test with system tzdata. +sed -i '/zoneinfo_path/ s|= .*|= "%{_datadir}/zoneinfo"|' test/ts_all_zoneinfo.rb + +# There might be test failures. Ignore them until there is upstream feedback. +# https://github.com/tzinfo/tzinfo/issues/141 +ruby test/ts_all_zoneinfo.rb || : +popd + +%files +%dir %{gem_instdir} +%exclude %{gem_instdir}/.yardopts +%license %{gem_instdir}/LICENSE +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/CHANGES.md +%doc %{gem_instdir}/README.md + +%changelog +* Thu Sep 21 2023 Arkady L. Shane - 2.0.5-3 +- Rebuilt for MSVSphere 9.2 + +* Fri Jan 20 2023 Fedora Release Engineering - 2.0.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Nov 22 2022 Mamoru TASAKA - 2.0.5-2 +- Fix include issue on test with ruby32 + +* Tue Sep 06 2022 Vít Ondruch - 2.0.5-1 +- Update to TZInfo 2.0.5. + Resolves: rhbz#2108737 + +* Sat Jul 23 2022 Fedora Release Engineering - 2.0.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Jan 21 2022 Fedora Release Engineering - 2.0.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 2.0.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 2.0.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Thu Dec 31 2020 Pavel Valena - 2.0.4-1 +- Update to tzinfo 2.0.4. + Resolves: rhbz#1908521 + +* Fri Nov 13 00:58:17 CET 2020 Pavel Valena - 2.0.3-1 +- Update to tzinfo 2.0.3. + Resolves: rhbz#1895701 + +* Fri Oct 30 21:10:27 CET 2020 Pavel Valena - 2.0.2-1 +- Update to tzinfo 2.0.2. + Resolves: rhbz#1820389 + +* Wed Jul 29 2020 Fedora Release Engineering - 2.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Feb 03 2020 Pavel Valena - 2.0.1-1 +- Update to tzinfo 2.0.1. + +* Thu Jan 30 2020 Fedora Release Engineering - 1.2.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 1.2.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 1.2.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 1.2.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon May 28 2018 Vít Ondruch - 1.2.5-1 +- Update to TZInfo 1.2.5. + +* Fri Feb 09 2018 Fedora Release Engineering - 1.2.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.2.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.2.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1.2.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jun 19 2015 Fedora Release Engineering - 1.2.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Aug 25 2014 Josef Stribny - 1.2.2-1 +- Update to 1.2.2 + +* Sun Jun 08 2014 Fedora Release Engineering - 1.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Apr 17 2014 Josef Stribny - 1.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.1 +- Patch tzinfo to use Minitest 5 + +* Thu Apr 10 2014 Josef Stribny - 1.1.0-1 +- Update to tzinfo 1.1.0 + +* Sun Aug 04 2013 Fedora Release Engineering - 0.3.37-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jul 24 2013 Josef Stribny - 0.3.37-1 +- Update to tzinfo 0.3.37. + +* Mon Feb 25 2013 Vít Ondruch - 0.3.35-1 +- Update to tzinfo 0.3.35. + +* Mon Feb 25 2013 Vít Ondruch - 0.3.34-3 +- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0 + +* Thu Feb 14 2013 Fedora Release Engineering - 0.3.34-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Oct 29 2012 Vít Ondruch - 0.3.34-1 +- Update to tzinfo 0.3.34. + +* Sat Jul 21 2012 Fedora Release Engineering - 0.3.30-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jan 19 2012 Vít Ondruch - 0.3.30-3 +- Rebuilt for Ruby 1.9.3. + +* Sat Jan 14 2012 Fedora Release Engineering - 0.3.30-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Oct 06 2011 Vít Ondruch - 0.3.30-1 +- Update to tzinfo 0.3.30. + +* Sun Apr 10 2011 - 0.3.26-1 +- Updated mail to latest upstream release (v.0.3.26 2011-04-01) + +* Wed Feb 09 2011 Fedora Release Engineering - 0.3.24-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jan 25 2011 - 0.3.24-2 +- Fix Comment 3 #668098. https://bugzilla.redhat.com/show_bug.cgi?id=668098#c3 + +* Tue Jan 18 2011 - 0.3.24-1 +- Updated mail to latest upstream release + +* Sat Jan 08 2011 - 0.3.23-1 +- Initial package +