tzinfo 1.2.10 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.yardopts +3 -0
- data/CHANGES.md +583 -391
- data/LICENSE +13 -13
- data/README.md +368 -114
- data/lib/tzinfo/annual_rules.rb +32 -12
- data/lib/tzinfo/country.rb +141 -129
- data/lib/tzinfo/country_timezone.rb +70 -112
- data/lib/tzinfo/data_source.rb +400 -144
- data/lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb +56 -0
- data/lib/tzinfo/data_sources/country_info.rb +42 -0
- data/lib/tzinfo/data_sources/data_timezone_info.rb +91 -0
- data/lib/tzinfo/data_sources/linked_timezone_info.rb +33 -0
- data/lib/tzinfo/data_sources/posix_time_zone_parser.rb +177 -0
- data/lib/tzinfo/data_sources/ruby_data_source.rb +141 -0
- data/lib/tzinfo/data_sources/timezone_info.rb +47 -0
- data/lib/tzinfo/data_sources/transitions_data_timezone_info.rb +214 -0
- data/lib/tzinfo/data_sources/zoneinfo_data_source.rb +592 -0
- data/lib/tzinfo/data_sources/zoneinfo_reader.rb +482 -0
- data/lib/tzinfo/data_sources.rb +8 -0
- data/lib/tzinfo/data_timezone.rb +33 -47
- data/lib/tzinfo/datetime_with_offset.rb +153 -0
- data/lib/tzinfo/format1/country_definer.rb +17 -0
- data/lib/tzinfo/format1/country_index_definition.rb +64 -0
- data/lib/tzinfo/format1/timezone_definer.rb +64 -0
- data/lib/tzinfo/format1/timezone_definition.rb +39 -0
- data/lib/tzinfo/format1/timezone_index_definition.rb +77 -0
- data/lib/tzinfo/format1.rb +10 -0
- data/lib/tzinfo/format2/country_definer.rb +68 -0
- data/lib/tzinfo/format2/country_index_definer.rb +68 -0
- data/lib/tzinfo/format2/country_index_definition.rb +46 -0
- data/lib/tzinfo/format2/timezone_definer.rb +94 -0
- data/lib/tzinfo/format2/timezone_definition.rb +73 -0
- data/lib/tzinfo/format2/timezone_index_definer.rb +45 -0
- data/lib/tzinfo/format2/timezone_index_definition.rb +55 -0
- data/lib/tzinfo/format2.rb +10 -0
- data/lib/tzinfo/info_timezone.rb +26 -21
- data/lib/tzinfo/linked_timezone.rb +33 -52
- data/lib/tzinfo/offset_timezone_period.rb +42 -0
- data/lib/tzinfo/ruby_core_support.rb +24 -155
- data/lib/tzinfo/string_deduper.rb +118 -0
- data/lib/tzinfo/time_with_offset.rb +154 -0
- data/lib/tzinfo/timestamp.rb +552 -0
- data/lib/tzinfo/timestamp_with_offset.rb +85 -0
- data/lib/tzinfo/timezone.rb +989 -502
- data/lib/tzinfo/timezone_offset.rb +84 -74
- data/lib/tzinfo/timezone_period.rb +151 -217
- data/lib/tzinfo/timezone_proxy.rb +70 -79
- data/lib/tzinfo/timezone_transition.rb +77 -109
- data/lib/tzinfo/transition_rule.rb +207 -77
- data/lib/tzinfo/transitions_timezone_period.rb +63 -0
- data/lib/tzinfo/version.rb +7 -0
- data/lib/tzinfo/with_offset.rb +61 -0
- data/lib/tzinfo.rb +78 -40
- data.tar.gz.sig +0 -0
- metadata +50 -105
- metadata.gz.sig +0 -0
- data/Rakefile +0 -107
- data/lib/tzinfo/country_index_definition.rb +0 -31
- data/lib/tzinfo/country_info.rb +0 -42
- data/lib/tzinfo/data_timezone_info.rb +0 -55
- data/lib/tzinfo/linked_timezone_info.rb +0 -26
- data/lib/tzinfo/offset_rationals.rb +0 -77
- data/lib/tzinfo/posix_time_zone_parser.rb +0 -136
- data/lib/tzinfo/ruby_country_info.rb +0 -74
- data/lib/tzinfo/ruby_data_source.rb +0 -140
- data/lib/tzinfo/time_or_datetime.rb +0 -351
- data/lib/tzinfo/timezone_definition.rb +0 -36
- data/lib/tzinfo/timezone_index_definition.rb +0 -54
- data/lib/tzinfo/timezone_info.rb +0 -30
- data/lib/tzinfo/timezone_transition_definition.rb +0 -104
- data/lib/tzinfo/transition_data_timezone_info.rb +0 -274
- data/lib/tzinfo/zoneinfo_country_info.rb +0 -37
- data/lib/tzinfo/zoneinfo_data_source.rb +0 -512
- data/lib/tzinfo/zoneinfo_timezone_info.rb +0 -520
- data/test/assets/payload.rb +0 -1
- data/test/tc_annual_rules.rb +0 -95
- data/test/tc_country.rb +0 -238
- data/test/tc_country_index_definition.rb +0 -69
- data/test/tc_country_info.rb +0 -16
- data/test/tc_country_timezone.rb +0 -173
- data/test/tc_data_source.rb +0 -218
- data/test/tc_data_timezone.rb +0 -99
- data/test/tc_data_timezone_info.rb +0 -18
- data/test/tc_info_timezone.rb +0 -34
- data/test/tc_linked_timezone.rb +0 -155
- data/test/tc_linked_timezone_info.rb +0 -23
- data/test/tc_offset_rationals.rb +0 -23
- data/test/tc_posix_time_zone_parser.rb +0 -261
- data/test/tc_ruby_core_support.rb +0 -168
- data/test/tc_ruby_country_info.rb +0 -110
- data/test/tc_ruby_data_source.rb +0 -173
- data/test/tc_time_or_datetime.rb +0 -674
- data/test/tc_timezone.rb +0 -1361
- data/test/tc_timezone_definition.rb +0 -113
- data/test/tc_timezone_index_definition.rb +0 -73
- data/test/tc_timezone_info.rb +0 -11
- data/test/tc_timezone_london.rb +0 -143
- data/test/tc_timezone_melbourne.rb +0 -142
- data/test/tc_timezone_new_york.rb +0 -142
- data/test/tc_timezone_offset.rb +0 -126
- data/test/tc_timezone_period.rb +0 -555
- data/test/tc_timezone_proxy.rb +0 -136
- data/test/tc_timezone_transition.rb +0 -366
- data/test/tc_timezone_transition_definition.rb +0 -295
- data/test/tc_timezone_utc.rb +0 -27
- data/test/tc_transition_data_timezone_info.rb +0 -433
- data/test/tc_transition_rule.rb +0 -663
- data/test/tc_zoneinfo_country_info.rb +0 -78
- data/test/tc_zoneinfo_data_source.rb +0 -1223
- data/test/tc_zoneinfo_timezone_info.rb +0 -2153
- data/test/test_utils.rb +0 -208
- data/test/ts_all.rb +0 -7
- data/test/ts_all_ruby.rb +0 -5
- data/test/ts_all_zoneinfo.rb +0 -9
- data/test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb +0 -89
- data/test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb +0 -327
- data/test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb +0 -230
- data/test/tzinfo-data/tzinfo/data/definitions/EST.rb +0 -19
- data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb +0 -21
- data/test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb +0 -21
- data/test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb +0 -21
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb +0 -273
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb +0 -198
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb +0 -333
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb +0 -277
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb +0 -235
- data/test/tzinfo-data/tzinfo/data/definitions/UTC.rb +0 -16
- data/test/tzinfo-data/tzinfo/data/indexes/countries.rb +0 -940
- data/test/tzinfo-data/tzinfo/data/indexes/timezones.rb +0 -609
- data/test/tzinfo-data/tzinfo/data/version.rb +0 -20
- data/test/tzinfo-data/tzinfo/data.rb +0 -8
- data/test/zoneinfo/America/Argentina/Buenos_Aires +0 -0
- data/test/zoneinfo/America/New_York +0 -0
- data/test/zoneinfo/Australia/Melbourne +0 -0
- data/test/zoneinfo/EST +0 -0
- data/test/zoneinfo/Etc/UTC +0 -0
- data/test/zoneinfo/Europe/Amsterdam +0 -0
- data/test/zoneinfo/Europe/Andorra +0 -0
- data/test/zoneinfo/Europe/London +0 -0
- data/test/zoneinfo/Europe/Paris +0 -0
- data/test/zoneinfo/Europe/Prague +0 -0
- data/test/zoneinfo/Factory +0 -0
- data/test/zoneinfo/iso3166.tab +0 -274
- data/test/zoneinfo/leapseconds +0 -78
- data/test/zoneinfo/posix/Europe/London +0 -0
- data/test/zoneinfo/posixrules +0 -0
- data/test/zoneinfo/right/Europe/London +0 -0
- data/test/zoneinfo/zone.tab +0 -452
- data/test/zoneinfo/zone1970.tab +0 -384
- data/tzinfo.gemspec +0 -21
data/lib/tzinfo.rb
CHANGED
@@ -1,43 +1,81 @@
|
|
1
|
-
#
|
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
|
3
18
|
end
|
4
19
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
20
|
+
|
21
|
+
require_relative 'tzinfo/ruby_core_support'
|
22
|
+
|
23
|
+
require_relative 'tzinfo/version'
|
24
|
+
|
25
|
+
require_relative 'tzinfo/string_deduper'
|
26
|
+
|
27
|
+
require_relative 'tzinfo/timestamp'
|
28
|
+
|
29
|
+
require_relative 'tzinfo/with_offset'
|
30
|
+
require_relative 'tzinfo/datetime_with_offset'
|
31
|
+
require_relative 'tzinfo/time_with_offset'
|
32
|
+
require_relative 'tzinfo/timestamp_with_offset'
|
33
|
+
|
34
|
+
require_relative 'tzinfo/timezone_offset'
|
35
|
+
require_relative 'tzinfo/timezone_transition'
|
36
|
+
require_relative 'tzinfo/transition_rule'
|
37
|
+
require_relative 'tzinfo/annual_rules'
|
38
|
+
|
39
|
+
require_relative 'tzinfo/data_sources'
|
40
|
+
require_relative 'tzinfo/data_sources/timezone_info'
|
41
|
+
require_relative 'tzinfo/data_sources/data_timezone_info'
|
42
|
+
require_relative 'tzinfo/data_sources/linked_timezone_info'
|
43
|
+
require_relative 'tzinfo/data_sources/constant_offset_data_timezone_info'
|
44
|
+
require_relative 'tzinfo/data_sources/transitions_data_timezone_info'
|
45
|
+
|
46
|
+
require_relative 'tzinfo/data_sources/country_info'
|
47
|
+
|
48
|
+
require_relative 'tzinfo/data_sources/posix_time_zone_parser'
|
49
|
+
require_relative 'tzinfo/data_sources/zoneinfo_reader'
|
50
|
+
|
51
|
+
require_relative 'tzinfo/data_source'
|
52
|
+
require_relative 'tzinfo/data_sources/ruby_data_source'
|
53
|
+
require_relative 'tzinfo/data_sources/zoneinfo_data_source'
|
54
|
+
|
55
|
+
require_relative 'tzinfo/timezone_period'
|
56
|
+
require_relative 'tzinfo/offset_timezone_period'
|
57
|
+
require_relative 'tzinfo/transitions_timezone_period'
|
58
|
+
require_relative 'tzinfo/timezone'
|
59
|
+
require_relative 'tzinfo/info_timezone'
|
60
|
+
require_relative 'tzinfo/data_timezone'
|
61
|
+
require_relative 'tzinfo/linked_timezone'
|
62
|
+
require_relative 'tzinfo/timezone_proxy'
|
63
|
+
|
64
|
+
require_relative 'tzinfo/country'
|
65
|
+
require_relative 'tzinfo/country_timezone'
|
66
|
+
|
67
|
+
require_relative 'tzinfo/format2'
|
68
|
+
require_relative 'tzinfo/format2/country_definer'
|
69
|
+
require_relative 'tzinfo/format2/country_index_definer'
|
70
|
+
require_relative 'tzinfo/format2/country_index_definition'
|
71
|
+
require_relative 'tzinfo/format2/timezone_definer'
|
72
|
+
require_relative 'tzinfo/format2/timezone_definition'
|
73
|
+
require_relative 'tzinfo/format2/timezone_index_definer'
|
74
|
+
require_relative 'tzinfo/format2/timezone_index_definition'
|
75
|
+
|
76
|
+
require_relative 'tzinfo/format1'
|
77
|
+
require_relative 'tzinfo/format1/country_definer'
|
78
|
+
require_relative 'tzinfo/format1/country_index_definition'
|
79
|
+
require_relative 'tzinfo/format1/timezone_definer'
|
80
|
+
require_relative 'tzinfo/format1/timezone_definition'
|
81
|
+
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:
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Ross
|
@@ -29,24 +29,24 @@ cert_chain:
|
|
29
29
|
J3Zn/kSTjTekiaspyGbczC3PUaeJNxr+yCvR4sk71Xmk/GaKKGOHedJ1uj/LAXrA
|
30
30
|
MR0mpl7b8zCg0PFC1J73uw==
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2023-01-28 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
|
-
name:
|
35
|
+
name: concurrent-ruby
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0
|
40
|
+
version: '1.0'
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0
|
48
|
-
description: TZInfo provides
|
49
|
-
|
47
|
+
version: '1.0'
|
48
|
+
description: TZInfo provides access to time zone data and allows times to be converted
|
49
|
+
using time zone rules.
|
50
50
|
email: phil.ross@gmail.com
|
51
51
|
executables: []
|
52
52
|
extensions: []
|
@@ -59,119 +59,64 @@ files:
|
|
59
59
|
- CHANGES.md
|
60
60
|
- LICENSE
|
61
61
|
- README.md
|
62
|
-
- Rakefile
|
63
62
|
- lib/tzinfo.rb
|
64
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/
|
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/
|
75
|
-
- lib/tzinfo/offset_rationals.rb
|
76
|
-
- lib/tzinfo/posix_time_zone_parser.rb
|
96
|
+
- lib/tzinfo/offset_timezone_period.rb
|
77
97
|
- lib/tzinfo/ruby_core_support.rb
|
78
|
-
- lib/tzinfo/
|
79
|
-
- lib/tzinfo/
|
80
|
-
- lib/tzinfo/
|
98
|
+
- lib/tzinfo/string_deduper.rb
|
99
|
+
- lib/tzinfo/time_with_offset.rb
|
100
|
+
- lib/tzinfo/timestamp.rb
|
101
|
+
- lib/tzinfo/timestamp_with_offset.rb
|
81
102
|
- lib/tzinfo/timezone.rb
|
82
|
-
- lib/tzinfo/timezone_definition.rb
|
83
|
-
- lib/tzinfo/timezone_index_definition.rb
|
84
|
-
- lib/tzinfo/timezone_info.rb
|
85
103
|
- lib/tzinfo/timezone_offset.rb
|
86
104
|
- lib/tzinfo/timezone_period.rb
|
87
105
|
- lib/tzinfo/timezone_proxy.rb
|
88
106
|
- lib/tzinfo/timezone_transition.rb
|
89
|
-
- lib/tzinfo/timezone_transition_definition.rb
|
90
|
-
- lib/tzinfo/transition_data_timezone_info.rb
|
91
107
|
- lib/tzinfo/transition_rule.rb
|
92
|
-
- lib/tzinfo/
|
93
|
-
- lib/tzinfo/
|
94
|
-
- lib/tzinfo/
|
95
|
-
- test/assets/payload.rb
|
96
|
-
- test/tc_annual_rules.rb
|
97
|
-
- test/tc_country.rb
|
98
|
-
- test/tc_country_index_definition.rb
|
99
|
-
- test/tc_country_info.rb
|
100
|
-
- test/tc_country_timezone.rb
|
101
|
-
- test/tc_data_source.rb
|
102
|
-
- test/tc_data_timezone.rb
|
103
|
-
- test/tc_data_timezone_info.rb
|
104
|
-
- test/tc_info_timezone.rb
|
105
|
-
- test/tc_linked_timezone.rb
|
106
|
-
- test/tc_linked_timezone_info.rb
|
107
|
-
- test/tc_offset_rationals.rb
|
108
|
-
- test/tc_posix_time_zone_parser.rb
|
109
|
-
- test/tc_ruby_core_support.rb
|
110
|
-
- test/tc_ruby_country_info.rb
|
111
|
-
- test/tc_ruby_data_source.rb
|
112
|
-
- test/tc_time_or_datetime.rb
|
113
|
-
- test/tc_timezone.rb
|
114
|
-
- test/tc_timezone_definition.rb
|
115
|
-
- test/tc_timezone_index_definition.rb
|
116
|
-
- test/tc_timezone_info.rb
|
117
|
-
- test/tc_timezone_london.rb
|
118
|
-
- test/tc_timezone_melbourne.rb
|
119
|
-
- test/tc_timezone_new_york.rb
|
120
|
-
- test/tc_timezone_offset.rb
|
121
|
-
- test/tc_timezone_period.rb
|
122
|
-
- test/tc_timezone_proxy.rb
|
123
|
-
- test/tc_timezone_transition.rb
|
124
|
-
- test/tc_timezone_transition_definition.rb
|
125
|
-
- test/tc_timezone_utc.rb
|
126
|
-
- test/tc_transition_data_timezone_info.rb
|
127
|
-
- test/tc_transition_rule.rb
|
128
|
-
- test/tc_zoneinfo_country_info.rb
|
129
|
-
- test/tc_zoneinfo_data_source.rb
|
130
|
-
- test/tc_zoneinfo_timezone_info.rb
|
131
|
-
- test/test_utils.rb
|
132
|
-
- test/ts_all.rb
|
133
|
-
- test/ts_all_ruby.rb
|
134
|
-
- test/ts_all_zoneinfo.rb
|
135
|
-
- test/tzinfo-data/tzinfo/data.rb
|
136
|
-
- test/tzinfo-data/tzinfo/data/definitions/America/Argentina/Buenos_Aires.rb
|
137
|
-
- test/tzinfo-data/tzinfo/data/definitions/America/New_York.rb
|
138
|
-
- test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb
|
139
|
-
- test/tzinfo-data/tzinfo/data/definitions/EST.rb
|
140
|
-
- test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__m__1.rb
|
141
|
-
- test/tzinfo-data/tzinfo/data/definitions/Etc/GMT__p__1.rb
|
142
|
-
- test/tzinfo-data/tzinfo/data/definitions/Etc/UTC.rb
|
143
|
-
- test/tzinfo-data/tzinfo/data/definitions/Europe/Amsterdam.rb
|
144
|
-
- test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb
|
145
|
-
- test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb
|
146
|
-
- test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb
|
147
|
-
- test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb
|
148
|
-
- test/tzinfo-data/tzinfo/data/definitions/UTC.rb
|
149
|
-
- test/tzinfo-data/tzinfo/data/indexes/countries.rb
|
150
|
-
- test/tzinfo-data/tzinfo/data/indexes/timezones.rb
|
151
|
-
- test/tzinfo-data/tzinfo/data/version.rb
|
152
|
-
- test/zoneinfo/America/Argentina/Buenos_Aires
|
153
|
-
- test/zoneinfo/America/New_York
|
154
|
-
- test/zoneinfo/Australia/Melbourne
|
155
|
-
- test/zoneinfo/EST
|
156
|
-
- test/zoneinfo/Etc/UTC
|
157
|
-
- test/zoneinfo/Europe/Amsterdam
|
158
|
-
- test/zoneinfo/Europe/Andorra
|
159
|
-
- test/zoneinfo/Europe/London
|
160
|
-
- test/zoneinfo/Europe/Paris
|
161
|
-
- test/zoneinfo/Europe/Prague
|
162
|
-
- test/zoneinfo/Factory
|
163
|
-
- test/zoneinfo/iso3166.tab
|
164
|
-
- test/zoneinfo/leapseconds
|
165
|
-
- test/zoneinfo/posix/Europe/London
|
166
|
-
- test/zoneinfo/posixrules
|
167
|
-
- test/zoneinfo/right/Europe/London
|
168
|
-
- test/zoneinfo/zone.tab
|
169
|
-
- test/zoneinfo/zone1970.tab
|
170
|
-
- tzinfo.gemspec
|
108
|
+
- lib/tzinfo/transitions_timezone_period.rb
|
109
|
+
- lib/tzinfo/version.rb
|
110
|
+
- lib/tzinfo/with_offset.rb
|
171
111
|
homepage: https://tzinfo.github.io
|
172
112
|
licenses:
|
173
113
|
- MIT
|
174
|
-
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.6
|
118
|
+
homepage_uri: https://tzinfo.github.io
|
119
|
+
source_code_uri: https://github.com/tzinfo/tzinfo/tree/v2.0.6
|
175
120
|
post_install_message:
|
176
121
|
rdoc_options:
|
177
122
|
- "--title"
|
@@ -184,15 +129,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
129
|
requirements:
|
185
130
|
- - ">="
|
186
131
|
- !ruby/object:Gem::Version
|
187
|
-
version: 1.
|
132
|
+
version: 1.9.3
|
188
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
134
|
requirements:
|
190
135
|
- - ">="
|
191
136
|
- !ruby/object:Gem::Version
|
192
137
|
version: '0'
|
193
138
|
requirements: []
|
194
|
-
rubygems_version: 3.
|
139
|
+
rubygems_version: 3.4.5
|
195
140
|
signing_key:
|
196
141
|
specification_version: 4
|
197
|
-
summary:
|
142
|
+
summary: Time Zone Library
|
198
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
|
data/lib/tzinfo/country_info.rb
DELETED
@@ -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
|