tzinfo 1.2.5 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.yardopts +3 -0
  5. data/CHANGES.md +490 -377
  6. data/LICENSE +13 -13
  7. data/README.md +368 -113
  8. data/lib/tzinfo.rb +64 -29
  9. data/lib/tzinfo/country.rb +141 -129
  10. data/lib/tzinfo/country_timezone.rb +70 -112
  11. data/lib/tzinfo/data_source.rb +389 -144
  12. data/lib/tzinfo/data_sources.rb +8 -0
  13. data/lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb +56 -0
  14. data/lib/tzinfo/data_sources/country_info.rb +42 -0
  15. data/lib/tzinfo/data_sources/data_timezone_info.rb +91 -0
  16. data/lib/tzinfo/data_sources/linked_timezone_info.rb +33 -0
  17. data/lib/tzinfo/data_sources/ruby_data_source.rb +143 -0
  18. data/lib/tzinfo/data_sources/timezone_info.rb +47 -0
  19. data/lib/tzinfo/data_sources/transitions_data_timezone_info.rb +214 -0
  20. data/lib/tzinfo/data_sources/zoneinfo_data_source.rb +575 -0
  21. data/lib/tzinfo/data_sources/zoneinfo_reader.rb +286 -0
  22. data/lib/tzinfo/data_timezone.rb +33 -47
  23. data/lib/tzinfo/datetime_with_offset.rb +153 -0
  24. data/lib/tzinfo/format1.rb +10 -0
  25. data/lib/tzinfo/format1/country_definer.rb +17 -0
  26. data/lib/tzinfo/format1/country_index_definition.rb +64 -0
  27. data/lib/tzinfo/format1/timezone_definer.rb +64 -0
  28. data/lib/tzinfo/format1/timezone_definition.rb +39 -0
  29. data/lib/tzinfo/format1/timezone_index_definition.rb +77 -0
  30. data/lib/tzinfo/format2.rb +10 -0
  31. data/lib/tzinfo/format2/country_definer.rb +68 -0
  32. data/lib/tzinfo/format2/country_index_definer.rb +68 -0
  33. data/lib/tzinfo/format2/country_index_definition.rb +46 -0
  34. data/lib/tzinfo/format2/timezone_definer.rb +94 -0
  35. data/lib/tzinfo/format2/timezone_definition.rb +73 -0
  36. data/lib/tzinfo/format2/timezone_index_definer.rb +45 -0
  37. data/lib/tzinfo/format2/timezone_index_definition.rb +55 -0
  38. data/lib/tzinfo/info_timezone.rb +26 -21
  39. data/lib/tzinfo/linked_timezone.rb +33 -52
  40. data/lib/tzinfo/offset_timezone_period.rb +42 -0
  41. data/lib/tzinfo/string_deduper.rb +118 -0
  42. data/lib/tzinfo/time_with_offset.rb +128 -0
  43. data/lib/tzinfo/timestamp.rb +548 -0
  44. data/lib/tzinfo/timestamp_with_offset.rb +85 -0
  45. data/lib/tzinfo/timezone.rb +989 -498
  46. data/lib/tzinfo/timezone_offset.rb +84 -74
  47. data/lib/tzinfo/timezone_period.rb +151 -217
  48. data/lib/tzinfo/timezone_proxy.rb +70 -79
  49. data/lib/tzinfo/timezone_transition.rb +77 -109
  50. data/lib/tzinfo/transitions_timezone_period.rb +63 -0
  51. data/lib/tzinfo/untaint_ext.rb +18 -0
  52. data/lib/tzinfo/version.rb +7 -0
  53. data/lib/tzinfo/with_offset.rb +61 -0
  54. metadata +63 -121
  55. metadata.gz.sig +0 -0
  56. data/Rakefile +0 -107
  57. data/lib/tzinfo/country_index_definition.rb +0 -31
  58. data/lib/tzinfo/country_info.rb +0 -42
  59. data/lib/tzinfo/data_timezone_info.rb +0 -55
  60. data/lib/tzinfo/linked_timezone_info.rb +0 -26
  61. data/lib/tzinfo/offset_rationals.rb +0 -77
  62. data/lib/tzinfo/ruby_core_support.rb +0 -146
  63. data/lib/tzinfo/ruby_country_info.rb +0 -74
  64. data/lib/tzinfo/ruby_data_source.rb +0 -136
  65. data/lib/tzinfo/time_or_datetime.rb +0 -340
  66. data/lib/tzinfo/timezone_definition.rb +0 -36
  67. data/lib/tzinfo/timezone_index_definition.rb +0 -54
  68. data/lib/tzinfo/timezone_info.rb +0 -30
  69. data/lib/tzinfo/timezone_transition_definition.rb +0 -104
  70. data/lib/tzinfo/transition_data_timezone_info.rb +0 -274
  71. data/lib/tzinfo/zoneinfo_country_info.rb +0 -37
  72. data/lib/tzinfo/zoneinfo_data_source.rb +0 -488
  73. data/lib/tzinfo/zoneinfo_timezone_info.rb +0 -296
  74. data/test/tc_country.rb +0 -234
  75. data/test/tc_country_index_definition.rb +0 -69
  76. data/test/tc_country_info.rb +0 -16
  77. data/test/tc_country_timezone.rb +0 -173
  78. data/test/tc_data_source.rb +0 -218
  79. data/test/tc_data_timezone.rb +0 -99
  80. data/test/tc_data_timezone_info.rb +0 -18
  81. data/test/tc_info_timezone.rb +0 -34
  82. data/test/tc_linked_timezone.rb +0 -155
  83. data/test/tc_linked_timezone_info.rb +0 -23
  84. data/test/tc_offset_rationals.rb +0 -23
  85. data/test/tc_ruby_core_support.rb +0 -168
  86. data/test/tc_ruby_country_info.rb +0 -110
  87. data/test/tc_ruby_data_source.rb +0 -143
  88. data/test/tc_time_or_datetime.rb +0 -654
  89. data/test/tc_timezone.rb +0 -1350
  90. data/test/tc_timezone_definition.rb +0 -113
  91. data/test/tc_timezone_index_definition.rb +0 -73
  92. data/test/tc_timezone_info.rb +0 -11
  93. data/test/tc_timezone_london.rb +0 -143
  94. data/test/tc_timezone_melbourne.rb +0 -142
  95. data/test/tc_timezone_new_york.rb +0 -142
  96. data/test/tc_timezone_offset.rb +0 -126
  97. data/test/tc_timezone_period.rb +0 -555
  98. data/test/tc_timezone_proxy.rb +0 -136
  99. data/test/tc_timezone_transition.rb +0 -366
  100. data/test/tc_timezone_transition_definition.rb +0 -295
  101. data/test/tc_timezone_utc.rb +0 -27
  102. data/test/tc_transition_data_timezone_info.rb +0 -423
  103. data/test/tc_zoneinfo_country_info.rb +0 -78
  104. data/test/tc_zoneinfo_data_source.rb +0 -1195
  105. data/test/tc_zoneinfo_timezone_info.rb +0 -1232
  106. data/test/test_utils.rb +0 -163
  107. data/test/ts_all.rb +0 -7
  108. data/test/ts_all_ruby.rb +0 -5
  109. data/test/ts_all_zoneinfo.rb +0 -7
  110. data/test/tzinfo-data/tzinfo/data.rb +0 -8
  111. data/test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb +0 -89
  112. data/test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb +0 -315
  113. data/test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb +0 -218
  114. data/test/tzinfo-data/tzinfo/data/definitions/EST.rb +0 -19
  115. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb +0 -21
  116. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb +0 -21
  117. data/test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb +0 -21
  118. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb +0 -261
  119. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb +0 -186
  120. data/test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb +0 -321
  121. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb +0 -265
  122. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb +0 -220
  123. data/test/tzinfo-data/tzinfo/data/definitions/UTC.rb +0 -16
  124. data/test/tzinfo-data/tzinfo/data/indexes/countries.rb +0 -927
  125. data/test/tzinfo-data/tzinfo/data/indexes/timezones.rb +0 -596
  126. data/test/tzinfo-data/tzinfo/data/version.rb +0 -14
  127. data/test/zoneinfo/America/Argentina/Buenos_Aires +0 -0
  128. data/test/zoneinfo/America/New_York +0 -0
  129. data/test/zoneinfo/Australia/Melbourne +0 -0
  130. data/test/zoneinfo/EST +0 -0
  131. data/test/zoneinfo/Etc/UTC +0 -0
  132. data/test/zoneinfo/Europe/Amsterdam +0 -0
  133. data/test/zoneinfo/Europe/Andorra +0 -0
  134. data/test/zoneinfo/Europe/London +0 -0
  135. data/test/zoneinfo/Europe/Paris +0 -0
  136. data/test/zoneinfo/Europe/Prague +0 -0
  137. data/test/zoneinfo/Factory +0 -0
  138. data/test/zoneinfo/iso3166.tab +0 -275
  139. data/test/zoneinfo/leapseconds +0 -61
  140. data/test/zoneinfo/posix/Europe/London +0 -0
  141. data/test/zoneinfo/posixrules +0 -0
  142. data/test/zoneinfo/right/Europe/London +0 -0
  143. data/test/zoneinfo/zone.tab +0 -439
  144. data/test/zoneinfo/zone1970.tab +0 -369
  145. data/tzinfo.gemspec +0 -21
@@ -0,0 +1,7 @@
1
+ # encoding: UTF-8
2
+ # frozen_string_literal: true
3
+
4
+ module TZInfo
5
+ # The TZInfo version number.
6
+ VERSION = '2.0.1'
7
+ end
@@ -0,0 +1,61 @@
1
+ # encoding: UTF-8
2
+ # frozen_string_literal: true
3
+
4
+ module TZInfo
5
+ # The {WithOffset} module is included in {TimeWithOffset},
6
+ # {DateTimeWithOffset} and {TimestampWithOffset}. It provides an override for
7
+ # the {strftime} method that handles expanding the `%Z` directive according to
8
+ # the {TimezoneOffset#abbreviation abbreviation} of the {TimezoneOffset}
9
+ # associated with a local time.
10
+ module WithOffset
11
+ # Overrides the `Time`, `DateTime` or {Timestamp} version of `strftime`,
12
+ # replacing `%Z` with the {TimezoneOffset#abbreviation abbreviation} of the
13
+ # associated {TimezoneOffset}. If there is no associated offset, `%Z` is
14
+ # expanded by the base class instead.
15
+ #
16
+ # All the format directives handled by the base class are supported.
17
+ #
18
+ # @param format [String] the format string.
19
+ # @return [String] the formatted time.
20
+ # @raise [ArgumentError] if `format` is `nil`.
21
+ def strftime(format)
22
+ raise ArgumentError, 'format must be specified' unless format
23
+
24
+ if_timezone_offset do |o|
25
+ abbreviation = nil
26
+
27
+ format = format.gsub(/%(%*)Z/) do
28
+ if $1.length.odd?
29
+ # Return %%Z so the real strftime treats it as a literal %Z too.
30
+ "#$1%Z"
31
+ else
32
+ "#$1#{abbreviation ||= o.abbreviation.gsub(/%/, '%%')}"
33
+ end
34
+ end
35
+ end
36
+
37
+ super
38
+ end
39
+
40
+ protected
41
+
42
+ # Performs a calculation if there is an associated {TimezoneOffset}.
43
+ #
44
+ # @param result [Object] a result value that can be manipulated by the block
45
+ # if there is an associated {TimezoneOffset}.
46
+ # @yield [period, result] if there is an associated {TimezoneOffset}, the
47
+ # block is yielded to in order to calculate the method result.
48
+ # @yieldparam period [TimezoneOffset] the associated {TimezoneOffset}.
49
+ # @yieldparam result [Object] the `result` parameter.
50
+ # @yieldreturn [Object] the result of the calculation performed if there is
51
+ # an associated {TimezoneOffset}.
52
+ # @return [Object] the result of the block if there is an associated
53
+ # {TimezoneOffset}, otherwise the `result` parameter.
54
+ #
55
+ # @private
56
+ def if_timezone_offset(result = nil) #:nodoc:
57
+ to = timezone_offset
58
+ to ? yield(to, result) : result
59
+ end
60
+ end
61
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tzinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Ross
@@ -10,44 +10,43 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRIwEAYDVQQDDAlwaGls
14
- LnJvc3MxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
15
- bTAeFw0xNzEwMjMxOTQ2MDJaFw0xODEwMjMxOTQ2MDJaMEAxEjAQBgNVBAMMCXBo
16
- aWwucm9zczEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
17
- Y29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkZzB+qfhmyY+XRvU
18
- u310LMTGsTkR4/8JFCMF0YeQX6ZKmLr1fKzF3At1+DlI+v0t/G2FS6Dic0V3l8MK
19
- JczyFh72NANOaQhAo0GHh8WkaeCf2DLL5K6YJeLpvkvp39oxzn00A4zosnzxM50f
20
- Xrjx2HmurcJQurzafeCDj67QccaNE+5H+mcIVAJlsA1h1f5QFZ3SqQ4mf8St40pE
21
- 6YR4ev/Eq6Hb8aUoUq30otxbeHAEHh8cdVhTNFq7sPWb0psQRF2D/+o0MLgHt8PY
22
- EUm49szlLsnjVXAMCHU7wH9CmDR/5Lzcrgqh3DgyI8ay6DnlSQ213eYZH/Nkn1Yz
23
- TcNLCQIDAQABo3kwdzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU
24
- D5nzO9/MG4B6ygch/Pv6PF9Q5x8wHgYDVR0RBBcwFYETcGhpbC5yb3NzQGdtYWls
25
- LmNvbTAeBgNVHRIEFzAVgRNwaGlsLnJvc3NAZ21haWwuY29tMA0GCSqGSIb3DQEB
26
- BQUAA4IBAQAHbabsU8fIQudX8XYwqZJYO76Y4LbHnMqZZz9nmRBWJlFE3E5jaF8Y
27
- p9v1LkOLlo04z9bdnIS0/RfSqvHkNYcdpYXHnmr5/GYItKt8LWpFDA5cLaeWv5cU
28
- FQB6a0HlkirTSTbevJNssymV/E206AFAoPK9vzjROn+/2MG4VlvYf/zr2nSQG76M
29
- BMVs6uF68qxYpWjHisX2oy6R1k4G32jopKfLpdh1WCnN2/U5jqND/b25SRZ2ZRxy
30
- YbX/8MDD3wwHu+knVnVsGNVuu/leNr+hJGgTUGXgcsu6nqYc4QVD+Amj1rI8D6at
31
- IYlrSPqJ7q3pK9kchFKrrktRA6yVf+fR
13
+ MIIDPDCCAiSgAwIBAgIBATANBgkqhkiG9w0BAQsFADAkMSIwIAYDVQQDDBlwaGls
14
+ LnJvc3MvREM9Z21haWwvREM9Y29tMB4XDTE5MTIyNDE0NTU0N1oXDTM5MTIyNDE0
15
+ NTU0N1owJDEiMCAGA1UEAwwZcGhpbC5yb3NzL0RDPWdtYWlsL0RDPWNvbTCCASIw
16
+ DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJGcwfqn4ZsmPl0b1Lt9dCzExrE5
17
+ EeP/CRQjBdGHkF+mSpi69XysxdwLdfg5SPr9LfxthUug4nNFd5fDCiXM8hYe9jQD
18
+ TmkIQKNBh4fFpGngn9gyy+SumCXi6b5L6d/aMc59NAOM6LJ88TOdH1648dh5rq3C
19
+ ULq82n3gg4+u0HHGjRPuR/pnCFQCZbANYdX+UBWd0qkOJn/EreNKROmEeHr/xKuh
20
+ 2/GlKFKt9KLcW3hwBB4fHHVYUzRau7D1m9KbEERdg//qNDC4B7fD2BFJuPbM5S7J
21
+ 41VwDAh1O8B/Qpg0f+S83K4Kodw4MiPGsug55UkNtd3mGR/zZJ9WM03DSwkCAwEA
22
+ AaN5MHcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFA+Z8zvfzBuA
23
+ esoHIfz7+jxfUOcfMB4GA1UdEQQXMBWBE3BoaWwucm9zc0BnbWFpbC5jb20wHgYD
24
+ VR0SBBcwFYETcGhpbC5yb3NzQGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEA
25
+ J80xgZ3gGdQVA8N+8NJANU5HLuZIU9jOaAlziU9ImoTgPiOHKGZC4as1TwT4kBt1
26
+ Qcnu7YSANYRrxP5tpOHsWPF/MQYgerAFCZS5+PzOTudwZ+7OsMW4/EMHy6aCVHEd
27
+ c7HzQRC4mSrDRpWxzyBnZ5nX5OAmIkKA8NgeKybT/4Ku6iFPPUQwlyxQaO+Wlxdo
28
+ FqHwpjRyoiVSpe4RUTNK3d3qesWPYi7Lxn6k6ZZeEdvG6ya33AXktE3jmmF+jPR1
29
+ J3Zn/kSTjTekiaspyGbczC3PUaeJNxr+yCvR4sk71Xmk/GaKKGOHedJ1uj/LAXrA
30
+ MR0mpl7b8zCg0PFC1J73uw==
32
31
  -----END CERTIFICATE-----
33
- date: 2018-02-04 00:00:00.000000000 Z
32
+ date: 2019-12-24 00:00:00.000000000 Z
34
33
  dependencies:
35
34
  - !ruby/object:Gem::Dependency
36
- name: thread_safe
35
+ name: concurrent-ruby
37
36
  requirement: !ruby/object:Gem::Requirement
38
37
  requirements:
39
38
  - - "~>"
40
39
  - !ruby/object:Gem::Version
41
- version: '0.1'
40
+ version: '1.0'
42
41
  type: :runtime
43
42
  prerelease: false
44
43
  version_requirements: !ruby/object:Gem::Requirement
45
44
  requirements:
46
45
  - - "~>"
47
46
  - !ruby/object:Gem::Version
48
- version: '0.1'
49
- description: TZInfo provides daylight savings aware transformations between times
50
- in different time zones.
47
+ version: '1.0'
48
+ description: TZInfo provides access to time zone data and allows times to be converted
49
+ using time zone rules.
51
50
  email: phil.ross@gmail.com
52
51
  executables: []
53
52
  extensions: []
@@ -60,109 +59,53 @@ files:
60
59
  - CHANGES.md
61
60
  - LICENSE
62
61
  - README.md
63
- - Rakefile
64
62
  - lib/tzinfo.rb
65
63
  - lib/tzinfo/country.rb
66
- - lib/tzinfo/country_index_definition.rb
67
- - lib/tzinfo/country_info.rb
68
64
  - lib/tzinfo/country_timezone.rb
69
65
  - lib/tzinfo/data_source.rb
66
+ - lib/tzinfo/data_sources.rb
67
+ - lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb
68
+ - lib/tzinfo/data_sources/country_info.rb
69
+ - lib/tzinfo/data_sources/data_timezone_info.rb
70
+ - lib/tzinfo/data_sources/linked_timezone_info.rb
71
+ - lib/tzinfo/data_sources/ruby_data_source.rb
72
+ - lib/tzinfo/data_sources/timezone_info.rb
73
+ - lib/tzinfo/data_sources/transitions_data_timezone_info.rb
74
+ - lib/tzinfo/data_sources/zoneinfo_data_source.rb
75
+ - lib/tzinfo/data_sources/zoneinfo_reader.rb
70
76
  - lib/tzinfo/data_timezone.rb
71
- - lib/tzinfo/data_timezone_info.rb
77
+ - lib/tzinfo/datetime_with_offset.rb
78
+ - lib/tzinfo/format1.rb
79
+ - lib/tzinfo/format1/country_definer.rb
80
+ - lib/tzinfo/format1/country_index_definition.rb
81
+ - lib/tzinfo/format1/timezone_definer.rb
82
+ - lib/tzinfo/format1/timezone_definition.rb
83
+ - lib/tzinfo/format1/timezone_index_definition.rb
84
+ - lib/tzinfo/format2.rb
85
+ - lib/tzinfo/format2/country_definer.rb
86
+ - lib/tzinfo/format2/country_index_definer.rb
87
+ - lib/tzinfo/format2/country_index_definition.rb
88
+ - lib/tzinfo/format2/timezone_definer.rb
89
+ - lib/tzinfo/format2/timezone_definition.rb
90
+ - lib/tzinfo/format2/timezone_index_definer.rb
91
+ - lib/tzinfo/format2/timezone_index_definition.rb
72
92
  - lib/tzinfo/info_timezone.rb
73
93
  - lib/tzinfo/linked_timezone.rb
74
- - lib/tzinfo/linked_timezone_info.rb
75
- - lib/tzinfo/offset_rationals.rb
76
- - lib/tzinfo/ruby_core_support.rb
77
- - lib/tzinfo/ruby_country_info.rb
78
- - lib/tzinfo/ruby_data_source.rb
79
- - lib/tzinfo/time_or_datetime.rb
94
+ - lib/tzinfo/offset_timezone_period.rb
95
+ - lib/tzinfo/string_deduper.rb
96
+ - lib/tzinfo/time_with_offset.rb
97
+ - lib/tzinfo/timestamp.rb
98
+ - lib/tzinfo/timestamp_with_offset.rb
80
99
  - lib/tzinfo/timezone.rb
81
- - lib/tzinfo/timezone_definition.rb
82
- - lib/tzinfo/timezone_index_definition.rb
83
- - lib/tzinfo/timezone_info.rb
84
100
  - lib/tzinfo/timezone_offset.rb
85
101
  - lib/tzinfo/timezone_period.rb
86
102
  - lib/tzinfo/timezone_proxy.rb
87
103
  - lib/tzinfo/timezone_transition.rb
88
- - lib/tzinfo/timezone_transition_definition.rb
89
- - lib/tzinfo/transition_data_timezone_info.rb
90
- - lib/tzinfo/zoneinfo_country_info.rb
91
- - lib/tzinfo/zoneinfo_data_source.rb
92
- - lib/tzinfo/zoneinfo_timezone_info.rb
93
- - test/tc_country.rb
94
- - test/tc_country_index_definition.rb
95
- - test/tc_country_info.rb
96
- - test/tc_country_timezone.rb
97
- - test/tc_data_source.rb
98
- - test/tc_data_timezone.rb
99
- - test/tc_data_timezone_info.rb
100
- - test/tc_info_timezone.rb
101
- - test/tc_linked_timezone.rb
102
- - test/tc_linked_timezone_info.rb
103
- - test/tc_offset_rationals.rb
104
- - test/tc_ruby_core_support.rb
105
- - test/tc_ruby_country_info.rb
106
- - test/tc_ruby_data_source.rb
107
- - test/tc_time_or_datetime.rb
108
- - test/tc_timezone.rb
109
- - test/tc_timezone_definition.rb
110
- - test/tc_timezone_index_definition.rb
111
- - test/tc_timezone_info.rb
112
- - test/tc_timezone_london.rb
113
- - test/tc_timezone_melbourne.rb
114
- - test/tc_timezone_new_york.rb
115
- - test/tc_timezone_offset.rb
116
- - test/tc_timezone_period.rb
117
- - test/tc_timezone_proxy.rb
118
- - test/tc_timezone_transition.rb
119
- - test/tc_timezone_transition_definition.rb
120
- - test/tc_timezone_utc.rb
121
- - test/tc_transition_data_timezone_info.rb
122
- - test/tc_zoneinfo_country_info.rb
123
- - test/tc_zoneinfo_data_source.rb
124
- - test/tc_zoneinfo_timezone_info.rb
125
- - test/test_utils.rb
126
- - test/ts_all.rb
127
- - test/ts_all_ruby.rb
128
- - test/ts_all_zoneinfo.rb
129
- - test/tzinfo-data/tzinfo/data.rb
130
- - test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb
131
- - test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb
132
- - test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb
133
- - test/tzinfo-data/tzinfo/data/definitions/EST.rb
134
- - test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb
135
- - test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb
136
- - test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb
137
- - test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb
138
- - test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb
139
- - test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb
140
- - test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb
141
- - test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb
142
- - test/tzinfo-data/tzinfo/data/definitions/UTC.rb
143
- - test/tzinfo-data/tzinfo/data/indexes/countries.rb
144
- - test/tzinfo-data/tzinfo/data/indexes/timezones.rb
145
- - test/tzinfo-data/tzinfo/data/version.rb
146
- - test/zoneinfo/America/Argentina/Buenos_Aires
147
- - test/zoneinfo/America/New_York
148
- - test/zoneinfo/Australia/Melbourne
149
- - test/zoneinfo/EST
150
- - test/zoneinfo/Etc/UTC
151
- - test/zoneinfo/Europe/Amsterdam
152
- - test/zoneinfo/Europe/Andorra
153
- - test/zoneinfo/Europe/London
154
- - test/zoneinfo/Europe/Paris
155
- - test/zoneinfo/Europe/Prague
156
- - test/zoneinfo/Factory
157
- - test/zoneinfo/iso3166.tab
158
- - test/zoneinfo/leapseconds
159
- - test/zoneinfo/posix/Europe/London
160
- - test/zoneinfo/posixrules
161
- - test/zoneinfo/right/Europe/London
162
- - test/zoneinfo/zone.tab
163
- - test/zoneinfo/zone1970.tab
164
- - tzinfo.gemspec
165
- homepage: http://tzinfo.github.io
104
+ - lib/tzinfo/transitions_timezone_period.rb
105
+ - lib/tzinfo/untaint_ext.rb
106
+ - lib/tzinfo/version.rb
107
+ - lib/tzinfo/with_offset.rb
108
+ homepage: https://tzinfo.github.io
166
109
  licenses:
167
110
  - MIT
168
111
  metadata: {}
@@ -178,16 +121,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
121
  requirements:
179
122
  - - ">="
180
123
  - !ruby/object:Gem::Version
181
- version: 1.8.7
124
+ version: 1.9.3
182
125
  required_rubygems_version: !ruby/object:Gem::Requirement
183
126
  requirements:
184
127
  - - ">="
185
128
  - !ruby/object:Gem::Version
186
129
  version: '0'
187
130
  requirements: []
188
- rubyforge_project:
189
- rubygems_version: 2.7.4
131
+ rubygems_version: 3.1.2
190
132
  signing_key:
191
133
  specification_version: 4
192
- summary: Daylight savings aware timezone library
134
+ summary: Time Zone Library
193
135
  test_files: []
metadata.gz.sig CHANGED
Binary file
data/Rakefile DELETED
@@ -1,107 +0,0 @@
1
- require 'rubygems'
2
- require 'rubygems/package_task'
3
- require 'fileutils'
4
- require 'rake/testtask'
5
-
6
- # Ignore errors loading rdoc/task (the rdoc tasks will be excluded if
7
- # rdoc is unavailable).
8
- begin
9
- require 'rdoc/task'
10
- rescue LoadError, RuntimeError
11
- end
12
-
13
- BASE_DIR = File.expand_path(File.dirname(__FILE__))
14
-
15
- task :default => [:test]
16
-
17
- spec = eval(File.read('tzinfo.gemspec'))
18
-
19
- class TZInfoPackageTask < Gem::PackageTask
20
- alias_method :orig_sh, :sh
21
- private :orig_sh
22
-
23
- def sh(*cmd, &block)
24
- if cmd[0] == '__tar_with_owner__' && cmd[1] =~ /\A-?[zjcvf]+\z/
25
- opts = cmd[1]
26
- cmd = ['tar', 'c', '--owner', '0', '--group', '0', "#{opts.start_with?('-') ? '' : '-'}#{opts.gsub('c', '')}"] + cmd.drop(2)
27
- elsif cmd.first =~ /\A__tar_with_owner__ -?([zjcvf]+)(.*)\z/
28
- opts = $1
29
- args = $2
30
- cmd[0] = "tar c --owner 0 --group 0 -#{opts.gsub('c', '')}#{args}"
31
- end
32
-
33
- orig_sh(*cmd, &block)
34
- end
35
- end
36
-
37
- def add_signing_key(spec)
38
- # Attempt to find the private key and add options to sign the gem if found.
39
- private_key_path = File.expand_path(File.join(BASE_DIR, '..', 'key', 'gem-private_key.pem'))
40
-
41
- if File.exist?(private_key_path)
42
- spec = spec.clone
43
- spec.signing_key = private_key_path
44
- spec.cert_chain = [File.join(BASE_DIR, 'gem-public_cert.pem')]
45
- else
46
- puts 'WARNING: Private key not found. Not signing gem file.'
47
- end
48
-
49
- spec
50
- end
51
-
52
- package_task = TZInfoPackageTask.new(add_signing_key(spec)) do |pkg|
53
- pkg.need_zip = true
54
- pkg.need_tar_gz = true
55
- pkg.tar_command = '__tar_with_owner__'
56
- end
57
-
58
- # Skip the rdoc task if RDoc::Task is unavailable
59
- if defined?(RDoc) && defined?(RDoc::Task)
60
- RDoc::Task.new do |rdoc|
61
- rdoc.rdoc_dir = 'doc'
62
- rdoc.options.concat spec.rdoc_options
63
- rdoc.rdoc_files.include(spec.extra_rdoc_files)
64
- rdoc.rdoc_files.include('lib')
65
- end
66
- end
67
-
68
- Rake::Task[package_task.package_dir_path].enhance do
69
- recurse_chmod(package_task.package_dir_path)
70
- end
71
-
72
- Rake::Task[:package].enhance do
73
- FileUtils.rm_rf(package_task.package_dir_path)
74
- end
75
-
76
- def recurse_chmod(dir)
77
- File.chmod(0755, dir)
78
-
79
- Dir.entries(dir).each do |entry|
80
- if entry != '.' && entry != '..'
81
- path = File.join(dir, entry)
82
- if File.directory?(path)
83
- recurse_chmod(path)
84
- else
85
- File.chmod(0644, path)
86
- end
87
- end
88
- end
89
- end
90
-
91
- desc 'Run tests using RubyDataSource, then ZoneinfoDataSource'
92
- task :test => [:test_ruby, :test_zoneinfo] do
93
- end
94
-
95
- def setup_tests(test_task, type)
96
- test_task.libs = [File.join(BASE_DIR, 'lib')]
97
- test_task.pattern = File.join(BASE_DIR, 'test', "ts_all_#{type}.rb")
98
- test_task.warning = true
99
- end
100
-
101
- Rake::TestTask.new(:test_ruby) do |t|
102
- setup_tests(t, :ruby)
103
- end
104
-
105
- Rake::TestTask.new(:test_zoneinfo) do |t|
106
- setup_tests(t, :zoneinfo)
107
- end
@@ -1,31 +0,0 @@
1
- module TZInfo
2
- # The country index file includes CountryIndexDefinition which provides
3
- # a country method used to define each country in the index.
4
- #
5
- # @private
6
- module CountryIndexDefinition #:nodoc:
7
- def self.append_features(base)
8
- super
9
- base.extend(ClassMethods)
10
- base.instance_eval { @countries = {} }
11
- end
12
-
13
- # Class methods for inclusion.
14
- #
15
- # @private
16
- module ClassMethods #:nodoc:
17
- # Defines a country with an ISO 3166 country code, name and block. The
18
- # block will be evaluated to obtain all the timezones for the country.
19
- # Calls Country.country_defined with the definition of each country.
20
- def country(code, name, &block)
21
- @countries[code] = RubyCountryInfo.new(code, name, &block)
22
- end
23
-
24
- # Returns a frozen hash of all the countries that have been defined in
25
- # the index.
26
- def countries
27
- @countries.freeze
28
- end
29
- end
30
- end
31
- end