tzinfo 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7f0a351bb373ff9068cb63ac357116b714aba6ee3a80c937bab19598f1cb524
4
- data.tar.gz: 73fe312723a4ffdeb9ca5340156ef3708795d8485dfd4739aaef5d7c79773937
3
+ metadata.gz: ec86298303c2574741a727440578c6e0b7f89be23f2c6d6e3ee01fccfeb1206e
4
+ data.tar.gz: c0fddb69282a1d64a69c5c73419ec5971a0baf7cc0d6af904879e39393953aa0
5
5
  SHA512:
6
- metadata.gz: 5ac0373dd3c0355db72d99d0cb59fb5adb34cd26bc084bdf3beaa06e35e195e23fbeb444b6d125d956157ab66705fe044c0b12111db634873d90ecccddc59aca
7
- data.tar.gz: 04cddba2b691dc949cd61d9a2f5dd58a77a9bd4d0c5042fa02d43359432edeba36e336db7bf1fa0dc0289eaa17c2f6fb08631af7211ed21f07ebb51a22461471
6
+ metadata.gz: 24abd1a7d10d00dacf003d6d80211fa2f6bd46f90bf1068ed473d74a4cab3f2a44a46c3224a942f41850cbdaf303bbf59e02dba37b5bf0af600d60435f5d5242
7
+ data.tar.gz: a4665320a7cf87ac113e50e6af2f93f5d4df9c6f40af1b3d35bbf8a2ee88aeb95fb98d7e04b6cb3c2fedc1e0bb94c13d185fd712cd2105ae527129ae2abbecac
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1 @@
1
- ^u�_o,eIM���N!�m:2�� ir@-DR����((���6��@ �燫z7���[zb�yHߢ���BX9�qE Ni��l�U7
2
- ��β�A�8iKCJ��=ܧ��f��7�w;]x4�
1
+ <�U��#񑐋�p�D��P�����Kf��� ��_0e|��)��E��H�C�p`t�XR��d���R�[x�����-�,5�h۫��U�{u��wu���b���! d�`jX5?��>���T��)a��2��� _���.d~�^��/�t'z%��?�'eh�~�T{BRĐY�'_$�0~����8'�����O6ŏ( yp� ������S`d{r���1�B���b�u�n��[�������$o��8��jt�#E
data/CHANGES.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changes
2
2
 
3
+ ## Version 2.0.1 - 24-Dec-2019
4
+
5
+ * Fixed "SecurityError: Insecure operation - require" exceptions when loading
6
+ data with recent Ruby releases in safe mode. #100.
7
+ * Fixed warnings when running on Ruby 2.7. #109.
8
+ * Add a `TZInfo::Timezone#=~` method that performs a regex match on the time
9
+ zone identifier. #99.
10
+ * Add a `TZInfo::Country#=~` method that performs a regex match on the country
11
+ code.
12
+
13
+
3
14
  ## Version 2.0.0 - 26-Dec-2018
4
15
 
5
16
  ### Added
@@ -145,6 +156,16 @@
145
156
  `TZInfo::Country.get('US').zone_identifiers` should be used instead.
146
157
 
147
158
 
159
+ ## Version 1.2.6 - 24-Dec-2019
160
+
161
+ * `Timezone#strftime('%s', time)` will now return the correct number of seconds
162
+ since the epoch. #91.
163
+ * Removed the unused `TZInfo::RubyDataSource::REQUIRE_PATH` constant.
164
+ * Fixed "SecurityError: Insecure operation - require" exceptions when loading
165
+ data with recent Ruby releases in safe mode.
166
+ * Fixed warnings when running on Ruby 2.7. #106 and #111.
167
+
168
+
148
169
  ## Version 1.2.5 - 4-Feb-2018
149
170
 
150
171
  * Support recursively (deep) freezing `Country` and `Timezone` instances. #80.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2005-2018 Philip Ross
1
+ Copyright (c) 2005-2019 Philip Ross
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the "Software"), to deal in
@@ -5,6 +5,18 @@
5
5
  module TZInfo
6
6
  end
7
7
 
8
+ # Object#untaint is a deprecated no-op in Ruby >= 2.7 and will be removed in
9
+ # 3.0. Add a refinement to either silence the warning, or supply the method if
10
+ # needed.
11
+ old_verbose = $VERBOSE
12
+ $VERBOSE = false
13
+ begin
14
+ o = Object.new
15
+ require_relative 'tzinfo/untaint_ext' if [:taint, :untaint, :tainted?].none? {|m| o.respond_to?(m) } || !o.taint.tainted?
16
+ ensure
17
+ $VERBOSE = old_verbose
18
+ end
19
+
8
20
  require_relative 'tzinfo/version'
9
21
 
10
22
  require_relative 'tzinfo/string_deduper'
@@ -176,6 +176,16 @@ module TZInfo
176
176
  code.hash
177
177
  end
178
178
 
179
+ # Matches `regexp` against the {code} of this {Country}.
180
+ #
181
+ # @param regexp [Regexp] a `Regexp` to match against the {code} of
182
+ # this {Country}.
183
+ # @return [Integer] the position the match starts, or `nil` if there is no
184
+ # match.
185
+ def =~(regexp)
186
+ regexp =~ code
187
+ end
188
+
179
189
  # Returns a serialized representation of this {Country}. This method is
180
190
  # called when using `Marshal.dump` with an instance of {Country}.
181
191
  #
@@ -2,6 +2,8 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module TZInfo
5
+ using UntaintExt if TZInfo.const_defined?(:UntaintExt)
6
+
5
7
  module DataSources
6
8
  # A {TZInfoDataNotFound} exception is raised if the tzinfo-data gem could
7
9
  # not be found (i.e. `require 'tzinfo/data'` failed) when selecting the Ruby
@@ -48,7 +50,7 @@ module TZInfo
48
50
  data_file = File.join('', 'tzinfo', 'data.rb')
49
51
  path = $".reverse_each.detect {|p| p.end_with?(data_file) }
50
52
  if path
51
- @base_path = File.join(File.dirname(path), 'data')
53
+ @base_path = File.join(File.dirname(path), 'data').untaint
52
54
  else
53
55
  @base_path = 'tzinfo/data'
54
56
  end
@@ -2,6 +2,8 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module TZInfo
5
+ using UntaintExt if TZInfo.const_defined?(:UntaintExt)
6
+
5
7
  module DataSources
6
8
  # An {InvalidZoneinfoDirectory} exception is raised if {ZoneinfoDataSource}
7
9
  # is initialized with a specific zoneinfo path that is not a valid zoneinfo
@@ -2,6 +2,8 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module TZInfo
5
+ using UntaintExt if TZInfo.const_defined?(:UntaintExt)
6
+
5
7
  module DataSources
6
8
  # An {InvalidZoneinfoFile} exception is raised if an attempt is made to load
7
9
  # an invalid zoneinfo file.
@@ -1119,6 +1119,16 @@ module TZInfo
1119
1119
  identifier.hash
1120
1120
  end
1121
1121
 
1122
+ # Matches `regexp` against the {identifier} of this {Timezone}.
1123
+ #
1124
+ # @param regexp [Regexp] a `Regexp` to match against the {identifier} of
1125
+ # this {Timezone}.
1126
+ # @return [Integer] the position the match starts, or `nil` if there is no
1127
+ # match.
1128
+ def =~(regexp)
1129
+ regexp =~ identifier
1130
+ end
1131
+
1122
1132
  # Returns a serialized representation of this {Timezone}. This method is
1123
1133
  # called when using `Marshal.dump` with an instance of {Timezone}.
1124
1134
  #
@@ -0,0 +1,18 @@
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.0.
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
@@ -3,5 +3,5 @@
3
3
 
4
4
  module TZInfo
5
5
  # The TZInfo version number.
6
- VERSION = '2.0.0'
6
+ VERSION = '2.0.1'
7
7
  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: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Ross
@@ -11,8 +11,8 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDPDCCAiSgAwIBAgIBATANBgkqhkiG9w0BAQsFADAkMSIwIAYDVQQDDBlwaGls
14
- LnJvc3MvREM9Z21haWwvREM9Y29tMB4XDTE4MTAyNzE3NTQyNVoXDTE5MTAyNzE3
15
- NTQyNVowJDEiMCAGA1UEAwwZcGhpbC5yb3NzL0RDPWdtYWlsL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HsWPF/MQYgerAFCZS5+PzOTudwZ+7OsMW4/EMHy6aCVHEd
27
+ c7HzQRC4mSrDRpWxzyBnZ5nX5OAmIkKA8NgeKybT/4Ku6iFPPUQwlyxQaO+Wlxdo
28
+ FqHwpjRyoiVSpe4RUTNK3d3qesWPYi7Lxn6k6ZZeEdvG6ya33AXktE3jmmF+jPR1
29
+ J3Zn/kSTjTekiaspyGbczC3PUaeJNxr+yCvR4sk71Xmk/GaKKGOHedJ1uj/LAXrA
30
+ MR0mpl7b8zCg0PFC1J73uw==
31
31
  -----END CERTIFICATE-----
32
- date: 2018-12-26 00:00:00.000000000 Z
32
+ date: 2019-12-24 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: concurrent-ruby
@@ -102,6 +102,7 @@ files:
102
102
  - lib/tzinfo/timezone_proxy.rb
103
103
  - lib/tzinfo/timezone_transition.rb
104
104
  - lib/tzinfo/transitions_timezone_period.rb
105
+ - lib/tzinfo/untaint_ext.rb
105
106
  - lib/tzinfo/version.rb
106
107
  - lib/tzinfo/with_offset.rb
107
108
  homepage: https://tzinfo.github.io
@@ -127,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
128
  - !ruby/object:Gem::Version
128
129
  version: '0'
129
130
  requirements: []
130
- rubygems_version: 3.0.1
131
+ rubygems_version: 3.1.2
131
132
  signing_key:
132
133
  specification_version: 4
133
134
  summary: Time Zone Library
metadata.gz.sig CHANGED
Binary file