tzinfo 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +10 -0
- data/LICENSE +1 -1
- data/lib/tzinfo/data_sources/posix_time_zone_parser.rb +2 -6
- data/lib/tzinfo/data_sources/ruby_data_source.rb +1 -5
- data/lib/tzinfo/data_sources/zoneinfo_data_source.rb +1 -5
- data/lib/tzinfo/data_sources/zoneinfo_reader.rb +1 -5
- data/lib/tzinfo/ruby_core_support.rb +38 -0
- data/lib/tzinfo/version.rb +1 -1
- data/lib/tzinfo.rb +2 -6
- data.tar.gz.sig +0 -0
- metadata +6 -6
- metadata.gz.sig +0 -0
- data/lib/tzinfo/untaint_ext.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15d9fc81161265595f6a97ed55898742c0b8f912052bffe58aca4528c08855c8
|
4
|
+
data.tar.gz: adf8f44066cfd018a145416f53b510615d8143bad62a3105dcabfb37c900a2e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5a124cea3cb29e8e6227bc72527da598d4047801a32998a3cb427d3dae4bfdc241e070f95c0db556db504f773f470a3855b2e4579bded1b5e00e68c33f2733b
|
7
|
+
data.tar.gz: 6f00d941afda6034a23a125ec06a175c60c0c50e0c7cf9b8b1f2a7adad82b9bd768d2c46b3d44bf1b2f0dc8b690ccf410d979a9821d3959e370b2c93e41163b8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## Version 2.0.6 - 28-Jan-2023
|
4
|
+
|
5
|
+
* Eliminate `Object#untaint` deprecation warnings on JRuby 9.4.0.0. #145.
|
6
|
+
|
7
|
+
|
3
8
|
## Version 2.0.5 - 19-Jul-2022
|
4
9
|
|
5
10
|
* Changed `DateTime` results to always use the proleptic Gregorian calendar.
|
@@ -194,6 +199,11 @@
|
|
194
199
|
`TZInfo::Country.get('US').zone_identifiers` should be used instead.
|
195
200
|
|
196
201
|
|
202
|
+
## Version 1.2.11 - 28-Jan-2023
|
203
|
+
|
204
|
+
* Eliminate `Object#untaint` deprecation warnings on JRuby 9.4.0.0. #145.
|
205
|
+
|
206
|
+
|
197
207
|
## Version 1.2.10 - 19-Jul-2022
|
198
208
|
|
199
209
|
* Fixed a relative path traversal bug that could cause arbitrary files to be
|
data/LICENSE
CHANGED
@@ -4,10 +4,6 @@
|
|
4
4
|
require 'strscan'
|
5
5
|
|
6
6
|
module TZInfo
|
7
|
-
# Use send as a workaround for erroneous 'wrong number of arguments' errors
|
8
|
-
# with JRuby 9.0.5.0 when calling methods with Java implementations. See #114.
|
9
|
-
send(:using, UntaintExt) if TZInfo.const_defined?(:UntaintExt)
|
10
|
-
|
11
7
|
module DataSources
|
12
8
|
# An {InvalidPosixTimeZone} exception is raised if an invalid POSIX-style
|
13
9
|
# time zone string is encountered.
|
@@ -43,12 +39,12 @@ module TZInfo
|
|
43
39
|
|
44
40
|
s = StringScanner.new(tz_string)
|
45
41
|
check_scan(s, /([^-+,\d<][^-+,\d]*) | <([^>]+)>/x)
|
46
|
-
std_abbrev = @string_deduper.dedupe((s[1] || s[2])
|
42
|
+
std_abbrev = @string_deduper.dedupe(RubyCoreSupport.untaint(s[1] || s[2]))
|
47
43
|
check_scan(s, /([-+]?\d+)(?::(\d+)(?::(\d+))?)?/)
|
48
44
|
std_offset = get_offset_from_hms(s[1], s[2], s[3])
|
49
45
|
|
50
46
|
if s.scan(/([^-+,\d<][^-+,\d]*) | <([^>]+)>/x)
|
51
|
-
dst_abbrev = @string_deduper.dedupe((s[1] || s[2])
|
47
|
+
dst_abbrev = @string_deduper.dedupe(RubyCoreSupport.untaint(s[1] || s[2]))
|
52
48
|
|
53
49
|
if s.scan(/([-+]?\d+)(?::(\d+)(?::(\d+))?)?/)
|
54
50
|
dst_offset = get_offset_from_hms(s[1], s[2], s[3])
|
@@ -2,10 +2,6 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module TZInfo
|
5
|
-
# Use send as a workaround for erroneous 'wrong number of arguments' errors
|
6
|
-
# with JRuby 9.0.5.0 when calling methods with Java implementations. See #114.
|
7
|
-
send(:using, UntaintExt) if TZInfo.const_defined?(:UntaintExt)
|
8
|
-
|
9
5
|
module DataSources
|
10
6
|
# A {TZInfoDataNotFound} exception is raised if the tzinfo-data gem could
|
11
7
|
# not be found (i.e. `require 'tzinfo/data'` failed) when selecting the Ruby
|
@@ -52,7 +48,7 @@ module TZInfo
|
|
52
48
|
data_file = File.join('', 'tzinfo', 'data.rb')
|
53
49
|
path = $".reverse_each.detect {|p| p.end_with?(data_file) }
|
54
50
|
if path
|
55
|
-
@base_path = File.join(File.dirname(path), 'data')
|
51
|
+
@base_path = RubyCoreSupport.untaint(File.join(File.dirname(path), 'data'))
|
56
52
|
else
|
57
53
|
@base_path = 'tzinfo/data'
|
58
54
|
end
|
@@ -2,10 +2,6 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module TZInfo
|
5
|
-
# Use send as a workaround for erroneous 'wrong number of arguments' errors
|
6
|
-
# with JRuby 9.0.5.0 when calling methods with Java implementations. See #114.
|
7
|
-
send(:using, UntaintExt) if TZInfo.const_defined?(:UntaintExt)
|
8
|
-
|
9
5
|
module DataSources
|
10
6
|
# An {InvalidZoneinfoDirectory} exception is raised if {ZoneinfoDataSource}
|
11
7
|
# is initialized with a specific zoneinfo path that is not a valid zoneinfo
|
@@ -444,7 +440,7 @@ module TZInfo
|
|
444
440
|
end
|
445
441
|
|
446
442
|
unless entry =~ /\./ || exclude.include?(entry)
|
447
|
-
|
443
|
+
RubyCoreSupport.untaint(entry)
|
448
444
|
path = dir + [entry]
|
449
445
|
full_path = File.join(@zoneinfo_dir, *path)
|
450
446
|
|
@@ -2,10 +2,6 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module TZInfo
|
5
|
-
# Use send as a workaround for erroneous 'wrong number of arguments' errors
|
6
|
-
# with JRuby 9.0.5.0 when calling methods with Java implementations. See #114.
|
7
|
-
send(:using, UntaintExt) if TZInfo.const_defined?(:UntaintExt)
|
8
|
-
|
9
5
|
module DataSources
|
10
6
|
# An {InvalidZoneinfoFile} exception is raised if an attempt is made to load
|
11
7
|
# an invalid zoneinfo file.
|
@@ -448,7 +444,7 @@ module TZInfo
|
|
448
444
|
abbrev_end = abbrev.index("\0", abbrev_start)
|
449
445
|
raise InvalidZoneinfoFile, "Missing abbreviation null terminator in file '#{file.path}'." unless abbrev_end
|
450
446
|
|
451
|
-
abbr = @string_deduper.dedupe(abbrev[abbrev_start...abbrev_end].force_encoding(Encoding::UTF_8)
|
447
|
+
abbr = @string_deduper.dedupe(RubyCoreSupport.untaint(abbrev[abbrev_start...abbrev_end].force_encoding(Encoding::UTF_8)))
|
452
448
|
|
453
449
|
TimezoneOffset.new(base_utc_offset, std_offset, abbr)
|
454
450
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module TZInfo
|
2
|
+
|
3
|
+
# Methods to support different versions of Ruby.
|
4
|
+
#
|
5
|
+
# @private
|
6
|
+
module RubyCoreSupport #:nodoc:
|
7
|
+
class << self
|
8
|
+
# Object#untaint is deprecated and becomes a no-op in Ruby >= 2.7. It has
|
9
|
+
# been removed from Ruby 3.2.
|
10
|
+
if !Object.new.respond_to?(:untaint) || RUBY_VERSION =~ /\A(\d+)\.(\d+)(?:\.|\z)/ && ($1 == '2' && $2.to_i >= 7 || $1.to_i >= 3)
|
11
|
+
# :nocov_functional_untaint:
|
12
|
+
|
13
|
+
# Returns the supplied `Object`
|
14
|
+
#
|
15
|
+
# @param o [Object] the `Object` to untaint.
|
16
|
+
# @return [Object] `o`.
|
17
|
+
def untaint(o)
|
18
|
+
o
|
19
|
+
end
|
20
|
+
|
21
|
+
# :nocov_functional_untaint:
|
22
|
+
else
|
23
|
+
# :nocov_no_functional_untaint:
|
24
|
+
|
25
|
+
# Untaints and returns the supplied `Object`.
|
26
|
+
#
|
27
|
+
# @param o [Object] the `Object` to untaint.
|
28
|
+
# @return [Object] `o`.
|
29
|
+
def untaint(o)
|
30
|
+
o.untaint
|
31
|
+
end
|
32
|
+
|
33
|
+
# :nocov_no_functional_untaint:
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
private_constant :RubyCoreSupport
|
38
|
+
end
|
data/lib/tzinfo/version.rb
CHANGED
data/lib/tzinfo.rb
CHANGED
@@ -17,12 +17,8 @@ module TZInfo
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
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'
|
25
|
-
end
|
20
|
+
|
21
|
+
require_relative 'tzinfo/ruby_core_support'
|
26
22
|
|
27
23
|
require_relative 'tzinfo/version'
|
28
24
|
|
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: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Ross
|
@@ -29,7 +29,7 @@ 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
35
|
name: concurrent-ruby
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- lib/tzinfo/info_timezone.rb
|
95
95
|
- lib/tzinfo/linked_timezone.rb
|
96
96
|
- lib/tzinfo/offset_timezone_period.rb
|
97
|
+
- lib/tzinfo/ruby_core_support.rb
|
97
98
|
- lib/tzinfo/string_deduper.rb
|
98
99
|
- lib/tzinfo/time_with_offset.rb
|
99
100
|
- lib/tzinfo/timestamp.rb
|
@@ -105,7 +106,6 @@ files:
|
|
105
106
|
- lib/tzinfo/timezone_transition.rb
|
106
107
|
- lib/tzinfo/transition_rule.rb
|
107
108
|
- lib/tzinfo/transitions_timezone_period.rb
|
108
|
-
- lib/tzinfo/untaint_ext.rb
|
109
109
|
- lib/tzinfo/version.rb
|
110
110
|
- lib/tzinfo/with_offset.rb
|
111
111
|
homepage: https://tzinfo.github.io
|
@@ -114,9 +114,9 @@ licenses:
|
|
114
114
|
metadata:
|
115
115
|
bug_tracker_uri: https://github.com/tzinfo/tzinfo/issues
|
116
116
|
changelog_uri: https://github.com/tzinfo/tzinfo/blob/master/CHANGES.md
|
117
|
-
documentation_uri: https://rubydoc.info/gems/tzinfo/2.0.
|
117
|
+
documentation_uri: https://rubydoc.info/gems/tzinfo/2.0.6
|
118
118
|
homepage_uri: https://tzinfo.github.io
|
119
|
-
source_code_uri: https://github.com/tzinfo/tzinfo/tree/v2.0.
|
119
|
+
source_code_uri: https://github.com/tzinfo/tzinfo/tree/v2.0.6
|
120
120
|
post_install_message:
|
121
121
|
rdoc_options:
|
122
122
|
- "--title"
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
- !ruby/object:Gem::Version
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
|
-
rubygems_version: 3.
|
139
|
+
rubygems_version: 3.4.5
|
140
140
|
signing_key:
|
141
141
|
specification_version: 4
|
142
142
|
summary: Time Zone Library
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/tzinfo/untaint_ext.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module TZInfo
|
5
|
-
# Object#untaint is deprecated in Ruby >= 2.7 and will be removed in 3.2.
|
6
|
-
# UntaintExt adds a refinement to make Object#untaint a no-op and avoid the
|
7
|
-
# warning.
|
8
|
-
#
|
9
|
-
# @private
|
10
|
-
module UntaintExt # :nodoc:
|
11
|
-
refine Object do
|
12
|
-
def untaint
|
13
|
-
self
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
private_constant :UntaintExt
|
18
|
-
end
|