documentation
documentation copied to clipboard
Update dependency tzinfo to v2
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| tzinfo (source, changelog) | major | "~> 1.2" -> "~> 2.0" |
Release Notes
tzinfo/tzinfo (tzinfo)
v2.0.6
- Eliminate
Object#untaintdeprecation warnings on JRuby 9.4.0.0. #145.
v2.0.5
- Changed
DateTimeresults to always use the proleptic Gregorian calendar. This affectsDateTimeresults prior to 1582-10-15 and any arithmetic performed on the results that would produce a secondary result prior to 1582-10-15. - Added support for eager loading all the time zone and country data by calling
either
TZInfo::DataSource#eager_load!orTZInfo.eager_load!. Compatible with Ruby On Rails'eager_load_namespaces. #129. - Ignore the SECURITY file from Arch Linux's tzdata package. #134.
v2.0.4
- Fixed an incorrect
InvalidTimezoneIdentifierexception raised when loading a zoneinfo file that includes rules specifying an additional transition to the final defined offset (for example, Africa/Casablanca in version 2018e of the Time Zone Database). #123.
v2.0.3
- Added support for handling "slim" format zoneinfo files that are produced by default by zic version 2020b and later. The POSIX-style TZ string is now used calculate DST transition times after the final defined transition in the file. #120.
- Fixed
TimeWithOffset#getlocalreturning aTimeWithOffsetwith thetimezone_offsetstill assigned when called with an offset argument on JRuby 9.3. - Rubinius is no longer supported.
v2.0.2
- Fixed 'wrong number of arguments' errors when running on JRuby 9.0. #114.
- Fixed warnings when running on Ruby 2.8. #113.
v2.0.1
- Fixed "SecurityError: Insecure operation - require" exceptions when loading data with recent Ruby releases in safe mode. #100.
- Fixed warnings when running on Ruby 2.7. #109.
- Added a
TZInfo::Timezone#=~method that performs a regex match on the time zone identifier. #99. - Added a
TZInfo::Country#=~method that performs a regex match on the country code.
v2.0.0
Added
-
to_localandperiod_forinstance methods have been added toTZInfo::Timezone. These are similar toutc_to_localandperiod_for_utc, but take the UTC offset of the given time into account. -
abbreviation,dst?,base_utc_offsetandobserved_utc_offsetinstance methods have been added toTZInfo::Timezone, returning the abbreviation, whether daylight savings time is in effect and the UTC offset of the time zone at a specified time. - A
TZInfo::Timestampclass has been added. It can be used withTZInfo::Timezonein place of aTimeorDateTime. -
local_time,local_datetimeandlocal_timestampinstance methods have been added toTZInfo::Timezone. These methods construct localTime,DateTimeandTZInfo::Timestampinstances with the correct UTC offset and abbreviation for the time zone. - Support for a (yet to be released) version 2 of tzinfo-data has been added, in
addition to support for version 1. The new version will remove the (no longer
needed)
DateTimeparameters from transition times, reduce memory consumption and improve the efficiency of loading timezone and country indexes. - A
TZInfo::VERSIONconstant has been added, indicating the TZInfo version number.
Changed
- The minimum supported Ruby versions are now Ruby MRI 1.9.3, JRuby 1.7 (in 1.9 or later mode) and Rubinius 3.
- Local times are now returned using the correct UTC offset (instead of using UTC). #49 and #52.
- Local times are returned as instances of
TimeWithOffset,DateTimeWithOffsetorTZInfo::TimestampWithOffset. These classes subclassTime,DateTimeandTZInfo::Timestamprespectively. They override the default behaviour of the base classes to return information about the observed offset at the indicated time. For example, the zone abbreviation is returned when using the%Zdirective withstrftime. - The
transitions_up_to,offsets_up_toandstrftimeinstance methods ofTZInfo::Timezonenow take the UTC offsets of given times into account (instead of ignoring them as was previously the case). - The
TZInfo::TimezonePeriodclass has been split into two subclasses:TZInfo::OffsetTimezonePeriodandTZInfo::TransitionsTimezonePeriod.TZInfo::OffsetTimezonePeriodis returned for time zones that only have a single offset.TZInfo::TransitionsTimezonePeriodis returned for periods that start or end with a transition. -
TZInfo::TimezoneOffset#abbreviation,TZInfo::TimezonePeriod#abbreviationandTZInfo::TimezonePeriod#zone_identifiernow return frozenStringinstances instead of instances ofSymbol. - The
utc_offsetandutc_total_offsetattributes ofTZInfo::TimezonePeriodandTZInfo::TimezoneOffsethave been renamedbase_utc_offsetandobserved_utc_offsetrespectively. The former names have been retained as aliases. -
TZInfo::Timezone.get,TZInfo::Timezone.get_proxyandTZInfo::Country.getcan now be used with strings having any encoding. Previously, only encodings that are directly comparable with UTF-8 were supported. - The requested identifier is included in
TZInfo::InvalidTimezoneIdentifierexception messages. - The requested country code is included in
TZInfo::InvalidCountryCodeexception messages. - The full range of transitions is now loaded from zoneinfo files. Zoneinfo
files produced with version 2014c of the
zictool contain an initial transition2**63seconds before the epoch. Zoneinfo files produced with version 2014d or later ofziccontain an initial transition2**59seconds before the epoch. These transitions would previously have been ignored, but are now returned in methods such asTZInfo::Timezone#transitions_up_to. - The
TZInfo::RubyDataSourceandTZInfo::ZoneinfoDataSourceclasses have been moved into a newTZInfo::DataSourcesmodule. Code that is settingTZInfo::ZoneinfoDataSource.search_pathorTZInfo::ZoneinfoDataSource.alternate_iso3166_tab_search_pathwill need to be updated accordingly. - The
TZInfo::InvalidZoneinfoDirectoryandTZInfo::ZoneinfoDirectoryNotFoundexception classes raised byTZInfo::DataSources::ZoneinfoDataSourcehave been moved into theTZInfo::DataSourcesmodule. - Setting the data source to
:rubyor instantiatingTZInfo::DataSources::RubyDataSourcewill now immediately raise aTZInfo::DataSources::TZInfoDataNotFoundexception ifrequire 'tzinfo/data'fails. Previously, a failure would only occur later when accessing an index or loading a timezone or country. - The
DEFAULT_SEARCH_PATHandDEFAULT_ALTERNATE_ISO3166_TAB_SEARCH_PATHconstants ofTZInfo::DataSources::ZoneinfoDataSourcehave been made private. - The
TZInfo::Country.data_source,TZInfo::DataSource.create_default_data_source,TZInfo::DataSources::ZoneinfoDataSource.process_search_path,TZInfo::Timezone.get_proxiesandTZInfo::Timezone.data_sourcemethods have been made private. - The performance of loading zoneinfo files and the associated indexes has been improved.
- Memory use has been decreased by deduplicating
Stringinstances when loading country and time zone data. - The dependency on the deprecated thread_safe gem as been removed and replaced by concurrent-ruby.
- The Info classes used to return time zone and country information from
TZInfo::DataSourceimplementations have been moved into theTZInfo::DataSourcesmodule. - The
TZInfo::TransitionDataTimezoneInfoclass has been removed and replaced withTZInfo::DataSources::TransitionsDataTimezoneInfoandTZInfo::DataSources::ConstantOffsetDataTimezoneInfo.TZInfo::DataSources::TransitionsDataTimezoneInfois constructed with anArrayofTZInfo::TimezoneTransitioninstances representing times when the offset changes.TZInfo::DataSources::ConstantOffsetDataTimezoneInfois constructed with aTZInfo::TimezoneOffsetinstance representing the offset constantly observed in a time zone. - The
TZInfo::DataSource#timezone_identifiersmethod should no longer be overridden in custom data source implementations. The implementation in the base class now calculates a result fromTZInfo::DataSource#data_timezone_identifiersandTZInfo::DataSource#linked_timezone_identifiers. - The results of the
TZInfo::DataSources::RubyDataSourceto_sandinspectmethods now include the time zone database and tzinfo-data versions.
Removed
- Methods of
TZInfo::Timezonethat accept time arguments no longer allowIntegertimestamp values.Time,DateTimeorTZInfo::Timestampvalues or objects that respond toto_i,subsecand optionallyutc_offsetmust be used instead. - The
%:::zformat directive can now only be used withTZInfo::Timezone#strftimeif it is supported byTime#strftimeon the runtime platform. - Using
TZInfo::Timezone.new(identifier)andTZInfo::Country.new(code)to obtain a specificTZInfo::TimezoneorTZInfo::Countrywill no longer work.TZInfo::Timezone.get(identifier)andTZInfo::Country.get(code)should be used instead. - The
TZInfo::TimeOrDateTimeclass has been removed. - The
valid_for_utc?,utc_after_start?,utc_before_end?,valid_for_local?,local_after_start?andlocal_before_end?instance methods ofTZInfo::TimezonePeriodhave been removed. Comparisons can be performed with the results of thestarts_at,ends_at,local_starts_atandlocal_ends_atmethods instead. - The
to_localandto_utcinstance methods ofTZInfo::TimezonePeriodandTZInfo::TimezoneOffsethave been removed. Conversions should be performed using theTZInfo::Timezoneclass instead. - The
TZInfo::TimezonePeriod#utc_total_offset_rationalmethod has been removed. Equivalent information can be obtained using theTZInfo::TimezonePeriod#observed_utc_offsetmethod. - The
datetime,time,local_end,local_end_time,local_startandlocal_start_timeinstance methods ofTZInfo::TimezoneTransitionhave been removed. Theat,local_end_atandlocal_start_atmethods should be used instead and the result (aTZInfo::TimestampWithOffset) converted to either aDateTimeorTimeby callingto_datetimeorto_timeon the result. - The
us_zonesandus_zone_identifiersclass methods ofTZInfo::Timezonehave been removed.TZInfo::Country.get('US').zonesandTZInfo::Country.get('US').zone_identifiersshould be used instead.
Configuration
📅 Schedule: Branch creation - "on the first day of the month" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
disabled