Merge pull request #13587 from Homebrew/dependabot/bundler/Library/Homebrew/tzinfo-2.0.5

build(deps): bump tzinfo from 2.0.4 to 2.0.5 in /Library/Homebrew
This commit is contained in:
Rylan Polster 2022-07-21 10:56:29 +02:00 committed by GitHub
commit 0b030b74e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 78 additions and 29 deletions

View File

@ -181,7 +181,7 @@ GEM
thor (>= 1.2.0)
yard-sorbet
thor (1.2.1)
tzinfo (2.0.4)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext

View File

@ -4,7 +4,11 @@
# This is an autogenerated file for types exported from the `tzinfo` gem.
# Please instead update this file by running `bin/tapioca gem tzinfo`.
module TZInfo; end
module TZInfo
class << self
def eager_load!; end
end
end
class TZInfo::AbsoluteDayOfYearTransitionRule < ::TZInfo::DayOfYearTransitionRule
def initialize(day, transition_at = T.unsafe(nil)); end
@ -94,6 +98,7 @@ class TZInfo::DataSource
def country_codes; end
def data_timezone_identifiers; end
def eager_load!; end
def get_country_info(code); end
def get_timezone_info(identifier); end
def inspect; end
@ -275,6 +280,7 @@ end
TZInfo::DataSources::ZoneinfoDataSource::DEFAULT_ALTERNATE_ISO3166_TAB_SEARCH_PATH = T.let(T.unsafe(nil), Array)
TZInfo::DataSources::ZoneinfoDataSource::DEFAULT_SEARCH_PATH = T.let(T.unsafe(nil), Array)
TZInfo::DataSources::ZoneinfoDataSource::EXCLUDED_FILENAMES = T.let(T.unsafe(nil), Array)
class TZInfo::DataSources::ZoneinfoDirectoryNotFound < ::StandardError; end
class TZInfo::DataSources::ZoneinfoReader

View File

@ -6,7 +6,7 @@ path = File.expand_path('..', __FILE__)
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/i18n-1.12.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/minitest-5.16.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-2.0.4/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/tzinfo-2.0.5/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/zeitwerk-2.6.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/activesupport-6.1.6.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/public_suffix-4.0.7/lib"

View File

@ -3,6 +3,18 @@
# The top level module for TZInfo.
module TZInfo
class << self
# Instructs the current {DataSource} to load all timezone and country data
# into memory (initializing the {DataSource} first if not previously
# accessed or set).
#
# This may be desirable in production environments to improve copy-on-write
# performance and to avoid flushing the constant cache every time a new
# timezone or country is loaded from {DataSources::RubyDataSource}.
def eager_load!
DataSource.get.eager_load!
end
end
end
# Object#untaint is a deprecated no-op in Ruby >= 2.7 and will be removed in

View File

@ -247,6 +247,17 @@ module TZInfo
raise_invalid_data_source('country_codes')
end
# Loads all timezone and country data into memory.
#
# This may be desirable in production environments to improve copy-on-write
# performance and to avoid flushing the constant cache every time a new
# timezone or country is loaded from {DataSources::RubyDataSource}.
def eager_load!
timezone_identifiers.each {|identifier| load_timezone_info(identifier) }
country_codes.each {|code| load_country_info(code) }
nil
end
# @return [String] a description of the {DataSource}.
def to_s
"Default DataSource"

View File

@ -116,14 +116,14 @@ module TZInfo
# @param identifier [Array<string>] the component parts of a time zone
# identifier (split on /). This must have already been validated.
def require_definition(identifier)
require_data(*(['definitions'] + identifier))
require_data('definitions', *identifier)
end
# Requires an index by its name.
#
# @param name [String] an index name.
def require_index(name)
require_data(*['indexes', name])
require_data('indexes', name)
end
# Requires a file from tzinfo/data.

View File

@ -78,6 +78,30 @@ module TZInfo
DEFAULT_ALTERNATE_ISO3166_TAB_SEARCH_PATH = ['/usr/share/misc/iso3166.tab', '/usr/share/misc/iso3166'].freeze
private_constant :DEFAULT_ALTERNATE_ISO3166_TAB_SEARCH_PATH
# Files and directories in the top level zoneinfo directory that will be
# excluded from the list of available time zones:
#
# - +VERSION is included on Mac OS X.
# - leapseconds is a list of leap seconds.
# - localtime is the current local timezone (may be a link).
# - posix, posixrules and right are directories containing other
# versions of the zoneinfo files.
# - SECURITY is included in the Arch Linux tzdata package.
# - src is a directory containing the tzdata source included on Solaris.
# - timeconfig is a symlink included on Slackware.
EXCLUDED_FILENAMES = [
'+VERSION',
'leapseconds',
'localtime',
'posix',
'posixrules',
'right',
'SECURITY',
'src',
'timeconfig'
].freeze
private_constant :EXCLUDED_FILENAMES
# Paths to be checked to find the system zoneinfo directory.
#
# @private
@ -394,15 +418,7 @@ module TZInfo
def load_timezone_identifiers
index = []
# Ignoring particular files:
# +VERSION is included on Mac OS X.
# leapseconds is a list of leap seconds.
# localtime is the current local timezone (may be a link).
# posix, posixrules and right are directories containing other versions of the zoneinfo files.
# src is a directory containing the tzdata source included on Solaris.
# timeconfig is a symlink included on Slackware.
enum_timezones([], ['+VERSION', 'leapseconds', 'localtime', 'posix', 'posixrules', 'right', 'src', 'timeconfig']) do |identifier|
enum_timezones([], EXCLUDED_FILENAMES) do |identifier|
index << identifier.join('/').freeze
end

View File

@ -3,10 +3,11 @@
module TZInfo
# A time represented as an `Integer` number of seconds since 1970-01-01
# 00:00:00 UTC (ignoring leap seconds), the fraction through the second
# (sub_second as a `Rational`) and an optional UTC offset. Like Ruby's `Time`
# class, {Timestamp} can distinguish between a local time with a zero offset
# and a time specified explicitly as UTC.
# 00:00:00 UTC (ignoring leap seconds and using the proleptic Gregorian
# calendar), the fraction through the second (sub_second as a `Rational`) and
# an optional UTC offset. Like Ruby's `Time` class, {Timestamp} can
# distinguish between a local time with a zero offset and a time specified
# explicitly as UTC.
class Timestamp
include Comparable
@ -16,8 +17,8 @@ module TZInfo
private_constant :JD_EPOCH
class << self
# Returns a new {Timestamp} representing the (Gregorian calendar) date and
# time specified by the supplied parameters.
# Returns a new {Timestamp} representing the (proleptic Gregorian
# calendar) date and time specified by the supplied parameters.
#
# If `utc_offset` is `nil`, `:utc` or 0, the date and time parameters will
# be interpreted as representing a UTC date and time. Otherwise the date
@ -37,7 +38,7 @@ module TZInfo
# specified offset, an offset from UTC specified as an `Integer` number
# of seconds or the `Symbol` `:utc`).
# @return [Timestamp] a new {Timestamp} representing the specified
# (Gregorian calendar) date and time.
# (proleptic Gregorian calendar) date and time.
# @raise [ArgumentError] if either of `year`, `month`, `day`, `hour`,
# `minute`, or `second` is not an `Integer`.
# @raise [ArgumentError] if `sub_second` is not a `Rational`, or the
@ -84,7 +85,8 @@ module TZInfo
# When called with a block, the {Timestamp} representation of `value` is
# passed to the block. The block must then return a {Timestamp}, which
# will be converted back to the type of the initial value. If the initial
# value was a {Timestamp}, the block result will just be returned.
# value was a {Timestamp}, the block result will be returned. If the
# initial value was a `DateTime`, a Gregorian `DateTime` will be returned.
#
# The UTC offset of `value` can either be preserved (the {Timestamp}
# representation will have the same UTC offset as `value`), ignored (the
@ -396,11 +398,11 @@ module TZInfo
end
end
# Converts this {Timestamp} to a `DateTime`.
# Converts this {Timestamp} to a Gregorian `DateTime`.
#
# @return [DateTime] a DateTime representation of this {Timestamp}. If the
# UTC offset of this {Timestamp} is not specified, a UTC `DateTime` will
# be returned.
# @return [DateTime] a Gregorian `DateTime` representation of this
# {Timestamp}. If the UTC offset of this {Timestamp} is not specified, a
# UTC `DateTime` will be returned.
def to_datetime
new_datetime
end
@ -408,7 +410,7 @@ module TZInfo
# Converts this {Timestamp} to an `Integer` number of seconds since
# 1970-01-01 00:00:00 UTC (ignoring leap seconds).
#
# @return [Integer] an Integer representation of this {Timestamp} (the
# @return [Integer] an `Integer` representation of this {Timestamp} (the
# number of seconds since 1970-01-01 00:00:00 UTC ignoring leap seconds).
def to_i
value
@ -492,7 +494,9 @@ module TZInfo
#
# @private
def new_datetime(klass = DateTime)
datetime = klass.jd(JD_EPOCH + ((@value.to_r + @sub_second) / 86400))
# Can't specify the start parameter unless the jd parameter is an exact number of days.
# Use #gregorian instead.
datetime = klass.jd(JD_EPOCH + ((@value.to_r + @sub_second) / 86400)).gregorian
@utc_offset && @utc_offset != 0 ? datetime.new_offset(Rational(@utc_offset, 86400)) : datetime
end

View File

@ -3,5 +3,5 @@
module TZInfo
# The TZInfo version number.
VERSION = '2.0.4'
VERSION = '2.0.5'
end