tzinfo 1.2.5 → 2.0.0
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 +1 -3
- data.tar.gz.sig +0 -0
- data/.yardopts +3 -0
- data/CHANGES.md +469 -377
- data/LICENSE +12 -12
- data/README.md +368 -113
- data/lib/tzinfo.rb +60 -37
- data/lib/tzinfo/country.rb +131 -129
- data/lib/tzinfo/country_timezone.rb +70 -112
- data/lib/tzinfo/data_source.rb +389 -144
- data/lib/tzinfo/data_sources.rb +8 -0
- 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/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 +573 -0
- data/lib/tzinfo/data_sources/zoneinfo_reader.rb +284 -0
- data/lib/tzinfo/data_timezone.rb +33 -47
- data/lib/tzinfo/datetime_with_offset.rb +153 -0
- data/lib/tzinfo/format1.rb +10 -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/format2.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/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/string_deduper.rb +118 -0
- data/lib/tzinfo/time_with_offset.rb +128 -0
- data/lib/tzinfo/timestamp.rb +548 -0
- data/lib/tzinfo/timestamp_with_offset.rb +85 -0
- data/lib/tzinfo/timezone.rb +979 -498
- 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/transitions_timezone_period.rb +63 -0
- data/lib/tzinfo/version.rb +7 -0
- data/lib/tzinfo/with_offset.rb +61 -0
- metadata +62 -121
- metadata.gz.sig +2 -2
- 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/ruby_core_support.rb +0 -146
- data/lib/tzinfo/ruby_country_info.rb +0 -74
- data/lib/tzinfo/ruby_data_source.rb +0 -136
- data/lib/tzinfo/time_or_datetime.rb +0 -340
- 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 -488
- data/lib/tzinfo/zoneinfo_timezone_info.rb +0 -296
- data/test/tc_country.rb +0 -234
- 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_ruby_core_support.rb +0 -168
- data/test/tc_ruby_country_info.rb +0 -110
- data/test/tc_ruby_data_source.rb +0 -143
- data/test/tc_time_or_datetime.rb +0 -654
- data/test/tc_timezone.rb +0 -1350
- 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 -423
- data/test/tc_zoneinfo_country_info.rb +0 -78
- data/test/tc_zoneinfo_data_source.rb +0 -1195
- data/test/tc_zoneinfo_timezone_info.rb +0 -1232
- data/test/test_utils.rb +0 -163
- data/test/ts_all.rb +0 -7
- data/test/ts_all_ruby.rb +0 -5
- data/test/ts_all_zoneinfo.rb +0 -7
- data/test/tzinfo-data/tzinfo/data.rb +0 -8
- 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 -315
- data/test/tzinfo-data/tzinfo/data/definitions/Australia/Melbourne.rb +0 -218
- 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 -261
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Andorra.rb +0 -186
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/London.rb +0 -321
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Paris.rb +0 -265
- data/test/tzinfo-data/tzinfo/data/definitions/Europe/Prague.rb +0 -220
- data/test/tzinfo-data/tzinfo/data/definitions/UTC.rb +0 -16
- data/test/tzinfo-data/tzinfo/data/indexes/countries.rb +0 -927
- data/test/tzinfo-data/tzinfo/data/indexes/timezones.rb +0 -596
- data/test/tzinfo-data/tzinfo/data/version.rb +0 -14
- 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 -275
- data/test/zoneinfo/leapseconds +0 -61
- 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 -439
- data/test/zoneinfo/zone1970.tab +0 -369
- data/tzinfo.gemspec +0 -21
@@ -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:
|
4
|
+
version: 2.0.0
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
IYlrSPqJ7q3pK9kchFKrrktRA6yVf+fR
|
13
|
+
MIIDPDCCAiSgAwIBAgIBATANBgkqhkiG9w0BAQsFADAkMSIwIAYDVQQDDBlwaGls
|
14
|
+
LnJvc3MvREM9Z21haWwvREM9Y29tMB4XDTE4MTAyNzE3NTQyNVoXDTE5MTAyNzE3
|
15
|
+
NTQyNVowJDEiMCAGA1UEAwwZcGhpbC5yb3NzL0RDPWdtYWlsL0RDPWNvbTCCASIw
|
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
|
+
G7spOhX+wjEVvsn5KAqbeDXcRhnuAzz/DbAq8xkG84etG4HNNdGxe8z7DY0YuqQQ
|
26
|
+
uau4AXpjQwtXRp6wYrzLjpn6Gsj0NGcv9TOcxHPPpr/cZnFuLdN5Sk7Q1sK8OuJ1
|
27
|
+
7JSj/nRsuNVgoo5dSAghVbCUNd2Ch31oDGPQFzedmKo09mNTd72CfcjzrjXaHDIB
|
28
|
+
ObXSs1zIhlYXDJGC5Dpr1/fG2W7bd8xt4UwQBH8u53KKYbHjHcbF+9x3O9TDweZq
|
29
|
+
lDDjxNrOZq4IuD3jrJI+T95Lo5RSCenQmPnJIGtfaoN+omC2q0HMFNx31TcWCcC8
|
30
|
+
Y2Wt5gQskVrMQo+j0zgJcw==
|
32
31
|
-----END CERTIFICATE-----
|
33
|
-
date: 2018-
|
32
|
+
date: 2018-12-26 00:00:00.000000000 Z
|
34
33
|
dependencies:
|
35
34
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
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
|
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
|
49
|
-
description: TZInfo provides
|
50
|
-
|
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,52 @@ 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/
|
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/
|
75
|
-
- lib/tzinfo/
|
76
|
-
- lib/tzinfo/
|
77
|
-
- lib/tzinfo/
|
78
|
-
- lib/tzinfo/
|
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/
|
89
|
-
- lib/tzinfo/
|
90
|
-
- lib/tzinfo/
|
91
|
-
|
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/version.rb
|
106
|
+
- lib/tzinfo/with_offset.rb
|
107
|
+
homepage: https://tzinfo.github.io
|
166
108
|
licenses:
|
167
109
|
- MIT
|
168
110
|
metadata: {}
|
@@ -178,16 +120,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
120
|
requirements:
|
179
121
|
- - ">="
|
180
122
|
- !ruby/object:Gem::Version
|
181
|
-
version: 1.
|
123
|
+
version: 1.9.3
|
182
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
125
|
requirements:
|
184
126
|
- - ">="
|
185
127
|
- !ruby/object:Gem::Version
|
186
128
|
version: '0'
|
187
129
|
requirements: []
|
188
|
-
|
189
|
-
rubygems_version: 2.7.4
|
130
|
+
rubygems_version: 3.0.1
|
190
131
|
signing_key:
|
191
132
|
specification_version: 4
|
192
|
-
summary:
|
133
|
+
summary: Time Zone Library
|
193
134
|
test_files: []
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
x��^ ����z�t��CR�n4"f܀��E���S��;�yUQKɪGI$��lz�3�o��xuؙ��8����������i};���{�j������Ly�r�L�|.�U8<X�1q���d���?td1T��zS���i��u��0��n�\AQ�;J��"�
|
2
|
+
`f����㛌���W��*���ʃ� ���yNfO�j�a��a��^)ۮ��2�ꇄ�'뉩JW]${�i+���4il�����A��z�>
|
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
|