tzinfo 1.2.5 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.yardopts +3 -0
  4. data/CHANGES.md +607 -377
  5. data/LICENSE +13 -13
  6. data/README.md +368 -113
  7. data/lib/tzinfo/annual_rules.rb +71 -0
  8. data/lib/tzinfo/country.rb +141 -129
  9. data/lib/tzinfo/country_timezone.rb +70 -112
  10. data/lib/tzinfo/data_source.rb +400 -144
  11. data/lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb +56 -0
  12. data/lib/tzinfo/data_sources/country_info.rb +42 -0
  13. data/lib/tzinfo/data_sources/data_timezone_info.rb +91 -0
  14. data/lib/tzinfo/data_sources/linked_timezone_info.rb +33 -0
  15. data/lib/tzinfo/data_sources/posix_time_zone_parser.rb +181 -0
  16. data/lib/tzinfo/data_sources/ruby_data_source.rb +145 -0
  17. data/lib/tzinfo/data_sources/timezone_info.rb +47 -0
  18. data/lib/tzinfo/data_sources/transitions_data_timezone_info.rb +214 -0
  19. data/lib/tzinfo/data_sources/zoneinfo_data_source.rb +596 -0
  20. data/lib/tzinfo/data_sources/zoneinfo_reader.rb +486 -0
  21. data/lib/tzinfo/data_sources.rb +8 -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/country_definer.rb +17 -0
  25. data/lib/tzinfo/format1/country_index_definition.rb +64 -0
  26. data/lib/tzinfo/format1/timezone_definer.rb +64 -0
  27. data/lib/tzinfo/format1/timezone_definition.rb +39 -0
  28. data/lib/tzinfo/format1/timezone_index_definition.rb +77 -0
  29. data/lib/tzinfo/format1.rb +10 -0
  30. data/lib/tzinfo/format2/country_definer.rb +68 -0
  31. data/lib/tzinfo/format2/country_index_definer.rb +68 -0
  32. data/lib/tzinfo/format2/country_index_definition.rb +46 -0
  33. data/lib/tzinfo/format2/timezone_definer.rb +94 -0
  34. data/lib/tzinfo/format2/timezone_definition.rb +73 -0
  35. data/lib/tzinfo/format2/timezone_index_definer.rb +45 -0
  36. data/lib/tzinfo/format2/timezone_index_definition.rb +55 -0
  37. data/lib/tzinfo/format2.rb +10 -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 +154 -0
  43. data/lib/tzinfo/timestamp.rb +552 -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/transition_rule.rb +455 -0
  51. data/lib/tzinfo/transitions_timezone_period.rb +63 -0
  52. data/lib/tzinfo/untaint_ext.rb +18 -0
  53. data/lib/tzinfo/version.rb +7 -0
  54. data/lib/tzinfo/with_offset.rb +61 -0
  55. data/lib/tzinfo.rb +74 -29
  56. data.tar.gz.sig +0 -0
  57. metadata +72 -122
  58. metadata.gz.sig +0 -0
  59. data/Rakefile +0 -107
  60. data/lib/tzinfo/country_index_definition.rb +0 -31
  61. data/lib/tzinfo/country_info.rb +0 -42
  62. data/lib/tzinfo/data_timezone_info.rb +0 -55
  63. data/lib/tzinfo/linked_timezone_info.rb +0 -26
  64. data/lib/tzinfo/offset_rationals.rb +0 -77
  65. data/lib/tzinfo/ruby_core_support.rb +0 -146
  66. data/lib/tzinfo/ruby_country_info.rb +0 -74
  67. data/lib/tzinfo/ruby_data_source.rb +0 -136
  68. data/lib/tzinfo/time_or_datetime.rb +0 -340
  69. data/lib/tzinfo/timezone_definition.rb +0 -36
  70. data/lib/tzinfo/timezone_index_definition.rb +0 -54
  71. data/lib/tzinfo/timezone_info.rb +0 -30
  72. data/lib/tzinfo/timezone_transition_definition.rb +0 -104
  73. data/lib/tzinfo/transition_data_timezone_info.rb +0 -274
  74. data/lib/tzinfo/zoneinfo_country_info.rb +0 -37
  75. data/lib/tzinfo/zoneinfo_data_source.rb +0 -488
  76. data/lib/tzinfo/zoneinfo_timezone_info.rb +0 -296
  77. data/test/tc_country.rb +0 -234
  78. data/test/tc_country_index_definition.rb +0 -69
  79. data/test/tc_country_info.rb +0 -16
  80. data/test/tc_country_timezone.rb +0 -173
  81. data/test/tc_data_source.rb +0 -218
  82. data/test/tc_data_timezone.rb +0 -99
  83. data/test/tc_data_timezone_info.rb +0 -18
  84. data/test/tc_info_timezone.rb +0 -34
  85. data/test/tc_linked_timezone.rb +0 -155
  86. data/test/tc_linked_timezone_info.rb +0 -23
  87. data/test/tc_offset_rationals.rb +0 -23
  88. data/test/tc_ruby_core_support.rb +0 -168
  89. data/test/tc_ruby_country_info.rb +0 -110
  90. data/test/tc_ruby_data_source.rb +0 -143
  91. data/test/tc_time_or_datetime.rb +0 -654
  92. data/test/tc_timezone.rb +0 -1350
  93. data/test/tc_timezone_definition.rb +0 -113
  94. data/test/tc_timezone_index_definition.rb +0 -73
  95. data/test/tc_timezone_info.rb +0 -11
  96. data/test/tc_timezone_london.rb +0 -143
  97. data/test/tc_timezone_melbourne.rb +0 -142
  98. data/test/tc_timezone_new_york.rb +0 -142
  99. data/test/tc_timezone_offset.rb +0 -126
  100. data/test/tc_timezone_period.rb +0 -555
  101. data/test/tc_timezone_proxy.rb +0 -136
  102. data/test/tc_timezone_transition.rb +0 -366
  103. data/test/tc_timezone_transition_definition.rb +0 -295
  104. data/test/tc_timezone_utc.rb +0 -27
  105. data/test/tc_transition_data_timezone_info.rb +0 -423
  106. data/test/tc_zoneinfo_country_info.rb +0 -78
  107. data/test/tc_zoneinfo_data_source.rb +0 -1195
  108. data/test/tc_zoneinfo_timezone_info.rb +0 -1232
  109. data/test/test_utils.rb +0 -163
  110. data/test/ts_all.rb +0 -7
  111. data/test/ts_all_ruby.rb +0 -5
  112. data/test/ts_all_zoneinfo.rb +0 -7
  113. data/test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb +0 -89
  114. data/test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb +0 -315
  115. data/test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb +0 -218
  116. data/test/tzinfo-data/tzinfo/data/definitions/EST.rb +0 -19
  117. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb +0 -21
  118. data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb +0 -21
  119. data/test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb +0 -21
  120. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb +0 -261
  121. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb +0 -186
  122. data/test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb +0 -321
  123. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb +0 -265
  124. data/test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb +0 -220
  125. data/test/tzinfo-data/tzinfo/data/definitions/UTC.rb +0 -16
  126. data/test/tzinfo-data/tzinfo/data/indexes/countries.rb +0 -927
  127. data/test/tzinfo-data/tzinfo/data/indexes/timezones.rb +0 -596
  128. data/test/tzinfo-data/tzinfo/data/version.rb +0 -14
  129. data/test/tzinfo-data/tzinfo/data.rb +0 -8
  130. data/test/zoneinfo/America/Argentina/Buenos_Aires +0 -0
  131. data/test/zoneinfo/America/New_York +0 -0
  132. data/test/zoneinfo/Australia/Melbourne +0 -0
  133. data/test/zoneinfo/EST +0 -0
  134. data/test/zoneinfo/Etc/UTC +0 -0
  135. data/test/zoneinfo/Europe/Amsterdam +0 -0
  136. data/test/zoneinfo/Europe/Andorra +0 -0
  137. data/test/zoneinfo/Europe/London +0 -0
  138. data/test/zoneinfo/Europe/Paris +0 -0
  139. data/test/zoneinfo/Europe/Prague +0 -0
  140. data/test/zoneinfo/Factory +0 -0
  141. data/test/zoneinfo/iso3166.tab +0 -275
  142. data/test/zoneinfo/leapseconds +0 -61
  143. data/test/zoneinfo/posix/Europe/London +0 -0
  144. data/test/zoneinfo/posixrules +0 -0
  145. data/test/zoneinfo/right/Europe/London +0 -0
  146. data/test/zoneinfo/zone.tab +0 -439
  147. data/test/zoneinfo/zone1970.tab +0 -369
  148. data/tzinfo.gemspec +0 -21
data/lib/tzinfo.rb CHANGED
@@ -1,40 +1,85 @@
1
- # Top level module for TZInfo.
1
+ # encoding: UTF-8
2
+ # frozen_string_literal: true
3
+
4
+ # The top level module for TZInfo.
2
5
  module TZInfo
6
+ class << self
7
+ # Instructs the current {DataSource} to load all timezone and country data
8
+ # into memory (initializing the {DataSource} first if not previously
9
+ # accessed or set).
10
+ #
11
+ # This may be desirable in production environments to improve copy-on-write
12
+ # performance and to avoid flushing the constant cache every time a new
13
+ # timezone or country is loaded from {DataSources::RubyDataSource}.
14
+ def eager_load!
15
+ DataSource.get.eager_load!
16
+ end
17
+ end
18
+ end
19
+
20
+ # Object#untaint is a deprecated no-op in Ruby >= 2.7 and will be removed in
21
+ # 3.2. Add a refinement to either silence the warning, or supply the method if
22
+ # needed.
23
+ if !Object.new.respond_to?(:untaint) || RUBY_VERSION =~ /\A(\d+)\.(\d+)(?:\.|\z)/ && ($1 == '2' && $2.to_i >= 7 || $1.to_i >= 3)
24
+ require_relative 'tzinfo/untaint_ext'
3
25
  end
4
26
 
5
- require 'tzinfo/ruby_core_support'
6
- require 'tzinfo/offset_rationals'
7
- require 'tzinfo/time_or_datetime'
27
+ require_relative 'tzinfo/version'
28
+
29
+ require_relative 'tzinfo/string_deduper'
30
+
31
+ require_relative 'tzinfo/timestamp'
32
+
33
+ require_relative 'tzinfo/with_offset'
34
+ require_relative 'tzinfo/datetime_with_offset'
35
+ require_relative 'tzinfo/time_with_offset'
36
+ require_relative 'tzinfo/timestamp_with_offset'
37
+
38
+ require_relative 'tzinfo/timezone_offset'
39
+ require_relative 'tzinfo/timezone_transition'
40
+ require_relative 'tzinfo/transition_rule'
41
+ require_relative 'tzinfo/annual_rules'
8
42
 
9
- require 'tzinfo/timezone_definition'
43
+ require_relative 'tzinfo/data_sources'
44
+ require_relative 'tzinfo/data_sources/timezone_info'
45
+ require_relative 'tzinfo/data_sources/data_timezone_info'
46
+ require_relative 'tzinfo/data_sources/linked_timezone_info'
47
+ require_relative 'tzinfo/data_sources/constant_offset_data_timezone_info'
48
+ require_relative 'tzinfo/data_sources/transitions_data_timezone_info'
10
49
 
11
- require 'tzinfo/timezone_offset'
12
- require 'tzinfo/timezone_transition'
13
- require 'tzinfo/timezone_transition_definition'
50
+ require_relative 'tzinfo/data_sources/country_info'
14
51
 
15
- require 'tzinfo/timezone_index_definition'
52
+ require_relative 'tzinfo/data_sources/posix_time_zone_parser'
53
+ require_relative 'tzinfo/data_sources/zoneinfo_reader'
16
54
 
17
- require 'tzinfo/timezone_info'
18
- require 'tzinfo/data_timezone_info'
19
- require 'tzinfo/linked_timezone_info'
20
- require 'tzinfo/transition_data_timezone_info'
21
- require 'tzinfo/zoneinfo_timezone_info'
55
+ require_relative 'tzinfo/data_source'
56
+ require_relative 'tzinfo/data_sources/ruby_data_source'
57
+ require_relative 'tzinfo/data_sources/zoneinfo_data_source'
22
58
 
23
- require 'tzinfo/data_source'
24
- require 'tzinfo/ruby_data_source'
25
- require 'tzinfo/zoneinfo_data_source'
59
+ require_relative 'tzinfo/timezone_period'
60
+ require_relative 'tzinfo/offset_timezone_period'
61
+ require_relative 'tzinfo/transitions_timezone_period'
62
+ require_relative 'tzinfo/timezone'
63
+ require_relative 'tzinfo/info_timezone'
64
+ require_relative 'tzinfo/data_timezone'
65
+ require_relative 'tzinfo/linked_timezone'
66
+ require_relative 'tzinfo/timezone_proxy'
26
67
 
27
- require 'tzinfo/timezone_period'
28
- require 'tzinfo/timezone'
29
- require 'tzinfo/info_timezone'
30
- require 'tzinfo/data_timezone'
31
- require 'tzinfo/linked_timezone'
32
- require 'tzinfo/timezone_proxy'
68
+ require_relative 'tzinfo/country'
69
+ require_relative 'tzinfo/country_timezone'
33
70
 
34
- require 'tzinfo/country_index_definition'
35
- require 'tzinfo/country_info'
36
- require 'tzinfo/ruby_country_info'
37
- require 'tzinfo/zoneinfo_country_info'
71
+ require_relative 'tzinfo/format2'
72
+ require_relative 'tzinfo/format2/country_definer'
73
+ require_relative 'tzinfo/format2/country_index_definer'
74
+ require_relative 'tzinfo/format2/country_index_definition'
75
+ require_relative 'tzinfo/format2/timezone_definer'
76
+ require_relative 'tzinfo/format2/timezone_definition'
77
+ require_relative 'tzinfo/format2/timezone_index_definer'
78
+ require_relative 'tzinfo/format2/timezone_index_definition'
38
79
 
39
- require 'tzinfo/country'
40
- require 'tzinfo/country_timezone'
80
+ require_relative 'tzinfo/format1'
81
+ require_relative 'tzinfo/format1/country_definer'
82
+ require_relative 'tzinfo/format1/country_index_definition'
83
+ require_relative 'tzinfo/format1/timezone_definer'
84
+ require_relative 'tzinfo/format1/timezone_definition'
85
+ require_relative 'tzinfo/format1/timezone_index_definition'
data.tar.gz.sig CHANGED
Binary file
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.5
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
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lxn6k6ZZeEdvG6ya33AXktE3jmmF+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: 2022-07-19 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,112 +59,64 @@ files:
60
59
  - CHANGES.md
61
60
  - LICENSE
62
61
  - README.md
63
- - Rakefile
64
62
  - lib/tzinfo.rb
63
+ - lib/tzinfo/annual_rules.rb
65
64
  - lib/tzinfo/country.rb
66
- - lib/tzinfo/country_index_definition.rb
67
- - lib/tzinfo/country_info.rb
68
65
  - lib/tzinfo/country_timezone.rb
69
66
  - lib/tzinfo/data_source.rb
67
+ - lib/tzinfo/data_sources.rb
68
+ - lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb
69
+ - lib/tzinfo/data_sources/country_info.rb
70
+ - lib/tzinfo/data_sources/data_timezone_info.rb
71
+ - lib/tzinfo/data_sources/linked_timezone_info.rb
72
+ - lib/tzinfo/data_sources/posix_time_zone_parser.rb
73
+ - lib/tzinfo/data_sources/ruby_data_source.rb
74
+ - lib/tzinfo/data_sources/timezone_info.rb
75
+ - lib/tzinfo/data_sources/transitions_data_timezone_info.rb
76
+ - lib/tzinfo/data_sources/zoneinfo_data_source.rb
77
+ - lib/tzinfo/data_sources/zoneinfo_reader.rb
70
78
  - lib/tzinfo/data_timezone.rb
71
- - lib/tzinfo/data_timezone_info.rb
79
+ - lib/tzinfo/datetime_with_offset.rb
80
+ - lib/tzinfo/format1.rb
81
+ - lib/tzinfo/format1/country_definer.rb
82
+ - lib/tzinfo/format1/country_index_definition.rb
83
+ - lib/tzinfo/format1/timezone_definer.rb
84
+ - lib/tzinfo/format1/timezone_definition.rb
85
+ - lib/tzinfo/format1/timezone_index_definition.rb
86
+ - lib/tzinfo/format2.rb
87
+ - lib/tzinfo/format2/country_definer.rb
88
+ - lib/tzinfo/format2/country_index_definer.rb
89
+ - lib/tzinfo/format2/country_index_definition.rb
90
+ - lib/tzinfo/format2/timezone_definer.rb
91
+ - lib/tzinfo/format2/timezone_definition.rb
92
+ - lib/tzinfo/format2/timezone_index_definer.rb
93
+ - lib/tzinfo/format2/timezone_index_definition.rb
72
94
  - lib/tzinfo/info_timezone.rb
73
95
  - 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
96
+ - lib/tzinfo/offset_timezone_period.rb
97
+ - lib/tzinfo/string_deduper.rb
98
+ - lib/tzinfo/time_with_offset.rb
99
+ - lib/tzinfo/timestamp.rb
100
+ - lib/tzinfo/timestamp_with_offset.rb
80
101
  - lib/tzinfo/timezone.rb
81
- - lib/tzinfo/timezone_definition.rb
82
- - lib/tzinfo/timezone_index_definition.rb
83
- - lib/tzinfo/timezone_info.rb
84
102
  - lib/tzinfo/timezone_offset.rb
85
103
  - lib/tzinfo/timezone_period.rb
86
104
  - lib/tzinfo/timezone_proxy.rb
87
105
  - 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
106
+ - lib/tzinfo/transition_rule.rb
107
+ - lib/tzinfo/transitions_timezone_period.rb
108
+ - lib/tzinfo/untaint_ext.rb
109
+ - lib/tzinfo/version.rb
110
+ - lib/tzinfo/with_offset.rb
111
+ homepage: https://tzinfo.github.io
166
112
  licenses:
167
113
  - MIT
168
- metadata: {}
114
+ metadata:
115
+ bug_tracker_uri: https://github.com/tzinfo/tzinfo/issues
116
+ changelog_uri: https://github.com/tzinfo/tzinfo/blob/master/CHANGES.md
117
+ documentation_uri: https://rubydoc.info/gems/tzinfo/2.0.5
118
+ homepage_uri: https://tzinfo.github.io
119
+ source_code_uri: https://github.com/tzinfo/tzinfo/tree/v2.0.5
169
120
  post_install_message:
170
121
  rdoc_options:
171
122
  - "--title"
@@ -178,16 +129,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
129
  requirements:
179
130
  - - ">="
180
131
  - !ruby/object:Gem::Version
181
- version: 1.8.7
132
+ version: 1.9.3
182
133
  required_rubygems_version: !ruby/object:Gem::Requirement
183
134
  requirements:
184
135
  - - ">="
185
136
  - !ruby/object:Gem::Version
186
137
  version: '0'
187
138
  requirements: []
188
- rubyforge_project:
189
- rubygems_version: 2.7.4
139
+ rubygems_version: 3.3.7
190
140
  signing_key:
191
141
  specification_version: 4
192
- summary: Daylight savings aware timezone library
142
+ summary: Time Zone Library
193
143
  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
@@ -1,42 +0,0 @@
1
- module TZInfo
2
- # Represents a country and references to its timezones as returned by a
3
- # DataSource.
4
- class CountryInfo
5
- # The ISO 3166 country code.
6
- attr_reader :code
7
-
8
- # The name of the country.
9
- attr_reader :name
10
-
11
- # Constructs a new CountryInfo with an ISO 3166 country code and name
12
- def initialize(code, name)
13
- @code = code
14
- @name = name
15
- end
16
-
17
- # Returns internal object state as a programmer-readable string.
18
- def inspect
19
- "#<#{self.class}: #@code>"
20
- end
21
-
22
- # Returns a frozen array of all the zone identifiers for the country.
23
- # The identifiers are ordered by importance according to the DataSource.
24
- def zone_identifiers
25
- raise_not_implemented('zone_identifiers')
26
- end
27
-
28
- # Returns a frozen array of all the timezones for the for the country as
29
- # CountryTimezone instances.
30
- #
31
- # The timezones are ordered by importance according to the DataSource.
32
- def zones
33
- raise_not_implemented('zones')
34
- end
35
-
36
- private
37
-
38
- def raise_not_implemented(method_name)
39
- raise NotImplementedError, "Subclasses must override #{method_name}"
40
- end
41
- end
42
- end
@@ -1,55 +0,0 @@
1
- module TZInfo
2
- # Represents a defined timezone containing transition data.
3
- class DataTimezoneInfo < TimezoneInfo
4
-
5
- # Returns the TimezonePeriod for the given UTC time.
6
- def period_for_utc(utc)
7
- raise_not_implemented('period_for_utc')
8
- end
9
-
10
- # Returns the set of TimezonePeriods for the given local time as an array.
11
- # Results returned are ordered by increasing UTC start date.
12
- # Returns an empty array if no periods are found for the given time.
13
- def periods_for_local(local)
14
- raise_not_implemented('periods_for_local')
15
- end
16
-
17
- # Returns an Array of TimezoneTransition instances representing the times
18
- # where the UTC offset of the timezone changes.
19
- #
20
- # Transitions are returned up to a given date and time up to a given date
21
- # and time, specified in UTC (utc_to).
22
- #
23
- # A from date and time may also be supplied using the utc_from parameter
24
- # (also specified in UTC). If utc_from is not nil, only transitions from
25
- # that date and time onwards will be returned.
26
- #
27
- # Comparisons with utc_to are exclusive. Comparisons with utc_from are
28
- # inclusive. If a transition falls precisely on utc_to, it will be excluded.
29
- # If a transition falls on utc_from, it will be included.
30
- #
31
- # Transitions returned are ordered by when they occur, from earliest to
32
- # latest.
33
- #
34
- # utc_to and utc_from can be specified using either DateTime, Time or
35
- # integer timestamps (Time.to_i).
36
- #
37
- # If utc_from is specified and utc_to is not greater than utc_from, then
38
- # transitions_up_to raises an ArgumentError exception.
39
- def transitions_up_to(utc_to, utc_from = nil)
40
- raise_not_implemented('transitions_up_to')
41
- end
42
-
43
- # Constructs a Timezone instance for the timezone represented by this
44
- # DataTimezoneInfo.
45
- def create_timezone
46
- DataTimezone.new(self)
47
- end
48
-
49
- private
50
-
51
- def raise_not_implemented(method_name)
52
- raise NotImplementedError, "Subclasses must override #{method_name}"
53
- end
54
- end
55
- end
@@ -1,26 +0,0 @@
1
- module TZInfo
2
- # Represents a timezone that is defined as a link or alias to another zone.
3
- class LinkedTimezoneInfo < TimezoneInfo
4
-
5
- # The zone that provides the data (that this zone is an alias for).
6
- attr_reader :link_to_identifier
7
-
8
- # Constructs a new LinkedTimezoneInfo with an identifier and the identifier
9
- # of the zone linked to.
10
- def initialize(identifier, link_to_identifier)
11
- super(identifier)
12
- @link_to_identifier = link_to_identifier
13
- end
14
-
15
- # Returns internal object state as a programmer-readable string.
16
- def inspect
17
- "#<#{self.class}: #@identifier,#@link_to_identifier>"
18
- end
19
-
20
- # Constructs a Timezone instance for the timezone represented by this
21
- # DataTimezoneInfo.
22
- def create_timezone
23
- LinkedTimezone.new(self)
24
- end
25
- end
26
- end