restify 2.0.1 → 2.1.0
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
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/restify/adapter/base.rb +1 -1
- data/lib/restify/cache.rb +1 -1
- data/lib/restify/relation.rb +7 -11
- data/lib/restify/response.rb +2 -2
- data/lib/restify/version.rb +2 -2
- data/spec/restify/adapter/base_spec.rb +33 -0
- data/spec/restify/context_spec.rb +2 -2
- data/spec/restify/features/opentelemetry_spec.rb +1 -1
- data/spec/restify/global_spec.rb +50 -1
- data/spec/restify/link_spec.rb +13 -3
- data/spec/restify/relation_spec.rb +79 -7
- data/spec/restify/resource_spec.rb +6 -0
- data/spec/restify_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- data/vendor/bundle/ruby/4.0.0/bundler/gems/my-rubocop-2b861962124a/LICENSE +21 -0
- data/vendor/bundle/ruby/4.0.0/bundler/gems/my-rubocop-2b861962124a/README.md +23 -0
- data/vendor/bundle/ruby/4.0.0/gems/activesupport-8.1.3/CHANGELOG.md +561 -0
- data/vendor/bundle/ruby/4.0.0/gems/activesupport-8.1.3/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/activesupport-8.1.3/README.rdoc +40 -0
- data/vendor/bundle/ruby/4.0.0/gems/addressable-2.9.0/CHANGELOG.md +326 -0
- data/vendor/bundle/ruby/4.0.0/gems/addressable-2.9.0/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/4.0.0/gems/addressable-2.9.0/README.md +121 -0
- data/vendor/bundle/ruby/4.0.0/gems/ast-2.4.3/LICENSE.MIT +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/ast-2.4.3/README.YARD.md +12 -0
- data/vendor/bundle/ruby/4.0.0/gems/base64-0.3.0/README.md +48 -0
- data/vendor/bundle/ruby/4.0.0/gems/bigdecimal-4.1.2/LICENSE +56 -0
- data/vendor/bundle/ruby/4.0.0/gems/concurrent-ruby-1.3.7/CHANGELOG.md +615 -0
- data/vendor/bundle/ruby/4.0.0/gems/concurrent-ruby-1.3.7/LICENSE.txt +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/concurrent-ruby-1.3.7/README.md +409 -0
- data/vendor/bundle/ruby/4.0.0/gems/connection_pool-3.0.2/LICENSE +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/connection_pool-3.0.2/README.md +182 -0
- data/vendor/bundle/ruby/4.0.0/gems/crack-1.0.1/LICENSE +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/crack-1.0.1/README.md +43 -0
- data/vendor/bundle/ruby/4.0.0/gems/diff-lcs-1.6.2/CHANGELOG.md +518 -0
- data/vendor/bundle/ruby/4.0.0/gems/diff-lcs-1.6.2/README.md +92 -0
- data/vendor/bundle/ruby/4.0.0/gems/docile-1.4.1/LICENSE +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/docile-1.4.1/README.md +409 -0
- data/vendor/bundle/ruby/4.0.0/gems/drb-2.2.3/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/4.0.0/gems/ethon-0.18.0/CHANGELOG.md +417 -0
- data/vendor/bundle/ruby/4.0.0/gems/ethon-0.18.0/LICENSE +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/ethon-0.18.0/README.md +118 -0
- data/vendor/bundle/ruby/4.0.0/gems/ffi-1.17.4-x86_64-linux-gnu/CHANGELOG.md +507 -0
- data/vendor/bundle/ruby/4.0.0/gems/ffi-1.17.4-x86_64-linux-gnu/LICENSE +24 -0
- data/vendor/bundle/ruby/4.0.0/gems/ffi-1.17.4-x86_64-linux-gnu/LICENSE.SPECS +22 -0
- data/vendor/bundle/ruby/4.0.0/gems/ffi-1.17.4-x86_64-linux-gnu/README.md +138 -0
- data/vendor/bundle/ruby/4.0.0/gems/hashdiff-1.2.1/LICENSE +19 -0
- data/vendor/bundle/ruby/4.0.0/gems/hashdiff-1.2.1/README.md +323 -0
- data/vendor/bundle/ruby/4.0.0/gems/hashdiff-1.2.1/changelog.md +127 -0
- data/vendor/bundle/ruby/4.0.0/gems/hitimes-3.2.0/LICENSE.txt +16 -0
- data/vendor/bundle/ruby/4.0.0/gems/hitimes-3.2.0/README.md +187 -0
- data/vendor/bundle/ruby/4.0.0/gems/i18n-1.15.2/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/i18n-1.15.2/README.md +139 -0
- data/vendor/bundle/ruby/4.0.0/gems/json-2.19.9/README.md +310 -0
- data/vendor/bundle/ruby/4.0.0/gems/language_server-protocol-3.17.0.5/LICENSE.txt +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/language_server-protocol-3.17.0.5/README.md +88 -0
- data/vendor/bundle/ruby/4.0.0/gems/lint_roller-1.1.0/CHANGELOG.md +15 -0
- data/vendor/bundle/ruby/4.0.0/gems/lint_roller-1.1.0/LICENSE.txt +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/lint_roller-1.1.0/README.md +173 -0
- data/vendor/bundle/ruby/4.0.0/gems/little-plugger-1.1.4/README.rdoc +53 -0
- data/vendor/bundle/ruby/4.0.0/gems/logger-1.7.0/README.md +104 -0
- data/vendor/bundle/ruby/4.0.0/gems/logging-2.4.0/LICENSE +22 -0
- data/vendor/bundle/ruby/4.0.0/gems/logging-2.4.0/README.md +140 -0
- data/vendor/bundle/ruby/4.0.0/gems/minitest-6.0.6/README.rdoc +763 -0
- data/vendor/bundle/ruby/4.0.0/gems/msgpack-1.8.3/ChangeLog +383 -0
- data/vendor/bundle/ruby/4.0.0/gems/msgpack-1.8.3/LICENSE +177 -0
- data/vendor/bundle/ruby/4.0.0/gems/msgpack-1.8.3/README.md +302 -0
- data/vendor/bundle/ruby/4.0.0/gems/multi_json-1.21.1/LICENSE.md +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/multi_json-1.21.1/README.md +281 -0
- data/vendor/bundle/ruby/4.0.0/gems/nio4r-2.7.5/ext/libev/LICENSE +37 -0
- data/vendor/bundle/ruby/4.0.0/gems/nio4r-2.7.5/ext/libev/README +59 -0
- data/vendor/bundle/ruby/4.0.0/gems/nio4r-2.7.5/license.md +80 -0
- data/vendor/bundle/ruby/4.0.0/gems/nio4r-2.7.5/readme.md +91 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-api-1.10.0/CHANGELOG.md +219 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-api-1.10.0/LICENSE +201 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-api-1.10.0/README.md +68 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-common-0.25.0/CHANGELOG.md +110 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-common-0.25.0/LICENSE +201 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-common-0.25.0/README.md +62 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-instrumentation-base-0.26.1/CHANGELOG.md +97 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-instrumentation-base-0.26.1/LICENSE +201 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-instrumentation-base-0.26.1/README.md +155 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-instrumentation-ethon-0.29.0/CHANGELOG.md +192 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-instrumentation-ethon-0.29.0/LICENSE +201 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-instrumentation-ethon-0.29.0/README.md +66 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-registry-0.6.0/CHANGELOG.md +31 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-registry-0.6.0/LICENSE +201 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-registry-0.6.0/README.md +40 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-sdk-1.12.0/CHANGELOG.md +302 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-sdk-1.12.0/LICENSE +201 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-sdk-1.12.0/README.md +101 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-semantic_conventions-1.41.0/CHANGELOG.md +65 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-semantic_conventions-1.41.0/LICENSE +201 -0
- data/vendor/bundle/ruby/4.0.0/gems/opentelemetry-semantic_conventions-1.41.0/README.md +115 -0
- data/vendor/bundle/ruby/4.0.0/gems/parallel-2.1.0/MIT-LICENSE.txt +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/parser-3.3.11.1/LICENSE.txt +26 -0
- data/vendor/bundle/ruby/4.0.0/gems/prism-1.9.0/CHANGELOG.md +786 -0
- data/vendor/bundle/ruby/4.0.0/gems/prism-1.9.0/LICENSE.md +7 -0
- data/vendor/bundle/ruby/4.0.0/gems/prism-1.9.0/README.md +143 -0
- data/vendor/bundle/ruby/4.0.0/gems/public_suffix-7.0.5/CHANGELOG.md +649 -0
- data/vendor/bundle/ruby/4.0.0/gems/public_suffix-7.0.5/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/4.0.0/gems/public_suffix-7.0.5/README.md +231 -0
- data/vendor/bundle/ruby/4.0.0/gems/puma-8.0.2/LICENSE +29 -0
- data/vendor/bundle/ruby/4.0.0/gems/puma-8.0.2/README.md +484 -0
- data/vendor/bundle/ruby/4.0.0/gems/puma-8.0.2/docs/jungle/README.md +9 -0
- data/vendor/bundle/ruby/4.0.0/gems/puma-8.0.2/docs/jungle/rc.d/README.md +74 -0
- data/vendor/bundle/ruby/4.0.0/gems/racc-1.8.1/ChangeLog +846 -0
- data/vendor/bundle/ruby/4.0.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
- data/vendor/bundle/ruby/4.0.0/gems/racc-1.8.1/README.rdoc +60 -0
- data/vendor/bundle/ruby/4.0.0/gems/rack-3.2.6/CHANGELOG.md +1346 -0
- data/vendor/bundle/ruby/4.0.0/gems/rack-3.2.6/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/rack-3.2.6/README.md +384 -0
- data/vendor/bundle/ruby/4.0.0/gems/rainbow-3.1.1/Changelog.md +101 -0
- data/vendor/bundle/ruby/4.0.0/gems/rainbow-3.1.1/LICENSE +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/rainbow-3.1.1/README.markdown +227 -0
- data/vendor/bundle/ruby/4.0.0/gems/rake-13.4.2/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/rake-13.4.2/README.rdoc +155 -0
- data/vendor/bundle/ruby/4.0.0/gems/rake-release-1.4.0/LICENSE +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/rake-release-1.4.0/README.md +107 -0
- data/vendor/bundle/ruby/4.0.0/gems/regexp_parser-2.12.0/LICENSE +22 -0
- data/vendor/bundle/ruby/4.0.0/gems/rexml-3.4.4/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/4.0.0/gems/rexml-3.4.4/README.md +57 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-3.13.2/LICENSE.md +27 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-3.13.2/README.md +47 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-core-3.13.6/Changelog.md +2447 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-core-3.13.6/LICENSE.md +26 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-core-3.13.6/README.md +389 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-expectations-3.13.5/Changelog.md +1366 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-expectations-3.13.5/LICENSE.md +25 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-expectations-3.13.5/README.md +326 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-mocks-3.13.8/Changelog.md +1351 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-mocks-3.13.8/LICENSE.md +25 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-mocks-3.13.8/README.md +465 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-support-3.13.7/Changelog.md +444 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-support-3.13.7/LICENSE.md +23 -0
- data/vendor/bundle/ruby/4.0.0/gems/rspec-support-3.13.7/README.md +40 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-1.88.0/LICENSE.txt +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-1.88.0/README.md +255 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-ast-1.49.1/LICENSE.txt +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-ast-1.49.1/README.md +54 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-capybara-2.23.0/CHANGELOG.md +116 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-capybara-2.23.0/MIT-LICENSE.md +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-capybara-2.23.0/README.md +91 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-factory_bot-2.28.0/CHANGELOG.md +135 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-factory_bot-2.28.0/MIT-LICENSE.md +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-factory_bot-2.28.0/README.md +91 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-performance-1.26.1/LICENSE.txt +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-performance-1.26.1/README.md +100 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-rspec-3.10.2/CHANGELOG.md +1136 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-rspec-3.10.2/MIT-LICENSE.md +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-rspec-3.10.2/README.md +112 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-rspec_rails-2.32.0/CHANGELOG.md +98 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-rspec_rails-2.32.0/MIT-LICENSE.md +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-rspec_rails-2.32.0/README.md +93 -0
- data/vendor/bundle/ruby/4.0.0/gems/ruby-progressbar-1.13.0/LICENSE.txt +19 -0
- data/vendor/bundle/ruby/4.0.0/gems/ruby-progressbar-1.13.0/README.md +131 -0
- data/vendor/bundle/ruby/4.0.0/gems/securerandom-0.4.1/README.md +72 -0
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-0.22.0/CHANGELOG.md +191 -0
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-0.22.0/LICENSE +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-0.22.0/README.md +974 -0
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-cobertura-3.2.0/LICENSE +202 -0
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-cobertura-3.2.0/README.md +65 -0
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-html-0.13.2/CHANGELOG.md +114 -0
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-html-0.13.2/LICENSE +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-html-0.13.2/README.md +30 -0
- data/vendor/bundle/ruby/4.0.0/gems/simplecov_json_formatter-0.1.4/CHANGELOG.md +13 -0
- data/vendor/bundle/ruby/4.0.0/gems/simplecov_json_formatter-0.1.4/README.md +29 -0
- data/vendor/bundle/ruby/4.0.0/gems/typhoeus-1.6.0/CHANGELOG.md +465 -0
- data/vendor/bundle/ruby/4.0.0/gems/typhoeus-1.6.0/LICENSE +22 -0
- data/vendor/bundle/ruby/4.0.0/gems/typhoeus-1.6.0/README.md +588 -0
- data/vendor/bundle/ruby/4.0.0/gems/tzinfo-2.0.6/LICENSE +19 -0
- data/vendor/bundle/ruby/4.0.0/gems/tzinfo-2.0.6/README.md +406 -0
- data/vendor/bundle/ruby/4.0.0/gems/unicode-display_width-3.2.0/CHANGELOG.md +299 -0
- data/vendor/bundle/ruby/4.0.0/gems/unicode-display_width-3.2.0/MIT-LICENSE.txt +22 -0
- data/vendor/bundle/ruby/4.0.0/gems/unicode-display_width-3.2.0/README.md +194 -0
- data/vendor/bundle/ruby/4.0.0/gems/unicode-emoji-4.2.0/CHANGELOG.md +202 -0
- data/vendor/bundle/ruby/4.0.0/gems/unicode-emoji-4.2.0/MIT-LICENSE.txt +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/unicode-emoji-4.2.0/README.md +205 -0
- data/vendor/bundle/ruby/4.0.0/gems/uri-1.1.1/README.md +55 -0
- data/vendor/bundle/ruby/4.0.0/gems/webmock-3.26.2/CHANGELOG.md +2148 -0
- data/vendor/bundle/ruby/4.0.0/gems/webmock-3.26.2/LICENSE +20 -0
- data/vendor/bundle/ruby/4.0.0/gems/webmock-3.26.2/README.md +1229 -0
- metadata +171 -4
- data/doc/file.README.html +0 -192
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
# TZInfo - Ruby Time Zone Library
|
|
2
|
+
|
|
3
|
+
[](https://rubygems.org/gems/tzinfo) [](https://github.com/tzinfo/tzinfo/actions?query=workflow%3ATests+branch%3Amaster+event%3Apush)
|
|
4
|
+
|
|
5
|
+
[TZInfo](https://tzinfo.github.io) is a Ruby library that provides access to
|
|
6
|
+
time zone data and allows times to be converted using time zone rules.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Data Sources
|
|
10
|
+
|
|
11
|
+
TZInfo requires a source of time zone data. There are two options:
|
|
12
|
+
|
|
13
|
+
1. A zoneinfo directory containing timezone definition files. These files are
|
|
14
|
+
generated from the [IANA Time Zone Database](https://www.iana.org/time-zones)
|
|
15
|
+
using the `zic` utility. Most Unix-like systems include a zoneinfo directory.
|
|
16
|
+
2. The TZInfo::Data library (the tzinfo-data gem). TZInfo::Data contains a set
|
|
17
|
+
of Ruby modules that are also generated from the IANA Time Zone Database.
|
|
18
|
+
|
|
19
|
+
By default, TZInfo will attempt to use TZInfo::Data. If TZInfo::Data is not
|
|
20
|
+
available (i.e. if `require 'tzinfo/data'` fails), then TZInfo will search for a
|
|
21
|
+
zoneinfo directory instead (using the search path specified by
|
|
22
|
+
`TZInfo::ZoneinfoDataSource::DEFAULT_SEARCH_PATH`).
|
|
23
|
+
|
|
24
|
+
If no data source can be found, a `TZInfo::DataSourceNotFound` exception will be
|
|
25
|
+
raised when TZInfo is used. Further information is available
|
|
26
|
+
[in the wiki](https://tzinfo.github.io/datasourcenotfound) to help resolve
|
|
27
|
+
`TZInfo::DataSourceNotFound` errors.
|
|
28
|
+
|
|
29
|
+
The default data source selection can be overridden by calling
|
|
30
|
+
`TZInfo::DataSource.set`.
|
|
31
|
+
|
|
32
|
+
Custom data sources can also be used. See the `TZInfo::DataSource.set`
|
|
33
|
+
documentation for further details.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
The TZInfo gem can be installed by running `gem install tzinfo` or by adding
|
|
39
|
+
`gem 'tzinfo'` to your `Gemfile` and running `bundle install`.
|
|
40
|
+
|
|
41
|
+
To use the Ruby modules as the data source, TZInfo::Data will also need to be
|
|
42
|
+
installed by running `gem install tzinfo-data` or by adding `gem 'tzinfo-data'`
|
|
43
|
+
to your `Gemfile`.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## IANA Time Zone Database
|
|
47
|
+
|
|
48
|
+
The data returned and used by TZInfo is sourced from the
|
|
49
|
+
[IANA Time Zone Database](http://www.iana.org/time-zones). The
|
|
50
|
+
[Theory and pragmatics of the tz code and data](https://data.iana.org/time-zones/theory.html)
|
|
51
|
+
document gives details of how the data is organized and managed.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Example Usage
|
|
55
|
+
|
|
56
|
+
To use TZInfo, it must first be required with:
|
|
57
|
+
|
|
58
|
+
```ruby
|
|
59
|
+
require 'tzinfo'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The `TZInfo::Timezone` class provides access to time zone data and methods for
|
|
63
|
+
converting times.
|
|
64
|
+
|
|
65
|
+
The `all_identifiers` method returns a list of valid time zone identifiers:
|
|
66
|
+
|
|
67
|
+
```ruby
|
|
68
|
+
identifiers = TZInfo::Timezone.all_identifiers
|
|
69
|
+
# => ["Africa/Adibdjan", "Africa/Accra", ..., "Zulu"]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
A `TZInfo::Timezone` instance representing an individual time zone can be
|
|
73
|
+
obtained with `TZInfo::Timezone.get`:
|
|
74
|
+
|
|
75
|
+
```ruby
|
|
76
|
+
tz = TZInfo::Timezone.get('America/New_York')
|
|
77
|
+
# => #<TZInfo::DataTimezone: America/New_York>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
A time can be converted to the local time of the time zone with `to_local`:
|
|
81
|
+
|
|
82
|
+
```ruby
|
|
83
|
+
tz.to_local(Time.utc(2018, 2, 1, 12, 30, 0))
|
|
84
|
+
# => 2018-02-01 07:30:00 -0500
|
|
85
|
+
tz.to_local(Time.utc(2018, 7, 1, 12, 30, 0))
|
|
86
|
+
# => 2018-07-01 08:30:00 -0400
|
|
87
|
+
tz.to_local(Time.new(2018, 7, 1, 13, 30, 0, '+01:00'))
|
|
88
|
+
# => 2018-07-01 08:30:00 -0400
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Local times with the appropriate offset for the time zone can be constructed
|
|
92
|
+
with `local_time`:
|
|
93
|
+
|
|
94
|
+
```ruby
|
|
95
|
+
tz.local_time(2018, 2, 1, 7, 30, 0)
|
|
96
|
+
# => 2018-02-01 07:30:00 -0500
|
|
97
|
+
tz.local_time(2018, 7, 1, 8, 30, 0)
|
|
98
|
+
# => 2018-07-01 08:30:00 -0400
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Local times can be converted to UTC by using `local_time` and calling `utc` on
|
|
102
|
+
the result:
|
|
103
|
+
|
|
104
|
+
```ruby
|
|
105
|
+
tz.local_time(2018, 2, 1, 7, 30, 0).utc
|
|
106
|
+
# => 2018-02-01 12:30:00 UTC
|
|
107
|
+
tz.local_time(2018, 7, 1, 8, 30, 0).utc
|
|
108
|
+
# => 2018-07-01 12:30:00 UTC
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The `local_to_utc` method can also be used to convert a time object to UTC. The
|
|
112
|
+
offset of the time is ignored - it is treated as if it were a local time for the
|
|
113
|
+
time zone:
|
|
114
|
+
|
|
115
|
+
```ruby
|
|
116
|
+
tz.local_to_utc(Time.utc(2018, 2, 1, 7, 30, 0))
|
|
117
|
+
# => 2018-02-01 12:30:00 UTC
|
|
118
|
+
tz.local_to_utc(Time.new(2018, 2, 1, 7, 30, 0, '+01:00'))
|
|
119
|
+
# => 2018-02-01 12:30:00 UTC
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Information about the time zone can be obtained from returned local times:
|
|
123
|
+
|
|
124
|
+
```ruby
|
|
125
|
+
local_time = tz.to_local(Time.utc(2018, 2, 1, 12, 30, 0))
|
|
126
|
+
local_time.utc_offset # => -18000
|
|
127
|
+
local_time.dst? # => false
|
|
128
|
+
local_time.zone # => "EST"
|
|
129
|
+
|
|
130
|
+
local_time = tz.to_local(Time.utc(2018, 7, 1, 12, 30, 0))
|
|
131
|
+
local_time.utc_offset # => -14400
|
|
132
|
+
local_time.dst? # => true
|
|
133
|
+
local_time.zone # => "EDT"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Time zone information can be included when formatting times with `strftime`
|
|
137
|
+
using the `%z` and `%Z` directives:
|
|
138
|
+
|
|
139
|
+
```ruby
|
|
140
|
+
tz.to_local(Time.utc(2018, 2, 1, 12, 30, 0)).strftime('%Y-%m-%d %H:%M:%S %z %Z')
|
|
141
|
+
# => "2018-02-01 07:30:00 -0500 EST"
|
|
142
|
+
tz.to_local(Time.utc(2018, 7, 1, 12, 30, 0)).strftime('%Y-%m-%d %H:%M:%S %z %Z')
|
|
143
|
+
# => "2018-07-01 08:30:00 -0400 EDT"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The `period_for` method can be used to obtain information about the observed
|
|
147
|
+
time zone information at a particular time as a `TZInfo::TimezonePeriod` object:
|
|
148
|
+
|
|
149
|
+
```ruby
|
|
150
|
+
period = tz.period_for(Time.utc(2018, 7, 1, 12, 30, 0))
|
|
151
|
+
period.base_utc_offset # => -18000
|
|
152
|
+
period.std_offset # => 3600
|
|
153
|
+
period.observed_utc_offset # => -14400
|
|
154
|
+
period.abbreviation # => "EDT"
|
|
155
|
+
period.dst? # => true
|
|
156
|
+
period.local_starts_at.to_time # => 2018-03-11 03:00:00 -0400
|
|
157
|
+
period.local_ends_at.to_time # => 2018-11-04 02:00:00 -0400
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
A list of transitions between periods where different rules are observed can be
|
|
161
|
+
obtained with the `transitions_up_to` method. The result is returned as an
|
|
162
|
+
`Array` of `TZInfo::TimezoneTransition` objects:
|
|
163
|
+
|
|
164
|
+
```ruby
|
|
165
|
+
transitions = tz.transitions_up_to(Time.utc(2019, 1, 1), Time.utc(2017, 1, 1))
|
|
166
|
+
transitions.map do |t|
|
|
167
|
+
[t.local_end_at.to_time, t.offset.observed_utc_offset, t.offset.abbreviation]
|
|
168
|
+
end
|
|
169
|
+
# => [[2017-03-12 02:00:00 -0500, -14400, "EDT"],
|
|
170
|
+
# [2017-11-05 02:00:00 -0400, -18000, "EST"],
|
|
171
|
+
# [2018-03-11 02:00:00 -0500, -14400, "EDT"],
|
|
172
|
+
# [2018-11-04 02:00:00 -0400, -18000, "EST"]]
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
A list of the unique offsets used by a time zone can be obtained with the
|
|
176
|
+
`offsets_up_to` method. The result is returned as an `Array` of
|
|
177
|
+
`TZInfo::TimezoneOffset` objects:
|
|
178
|
+
|
|
179
|
+
```ruby
|
|
180
|
+
offsets = tz.offsets_up_to(Time.utc(2019, 1, 1))
|
|
181
|
+
offsets.map {|o| [o.observed_utc_offset, o.abbreviation] }
|
|
182
|
+
# => [[-17762, "LMT"],
|
|
183
|
+
# [-18000, "EST"],
|
|
184
|
+
# [-14400, "EDT"],
|
|
185
|
+
# [-14400, "EWT"],
|
|
186
|
+
# [-14400, "EPT"]]
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
All `TZInfo::Timezone` methods that accept a time as a parameter can be used
|
|
190
|
+
with either instances of `Time`, `DateTime` or `TZInfo::Timestamp`. Arbitrary
|
|
191
|
+
`Time`-like objects that respond to both `to_i` and `subsec` and optionally
|
|
192
|
+
`utc_offset` will be treated as if they are instances of `Time`.
|
|
193
|
+
|
|
194
|
+
`TZInfo::Timezone` methods that both accept and return times will return an
|
|
195
|
+
object with a type matching that of the parameter (actually a
|
|
196
|
+
`TZInfo::TimeWithOffset`, `TZInfo::DateTimeWithOffset` or
|
|
197
|
+
`TZInfo::TimestampWithOffset` subclass when returning a local time):
|
|
198
|
+
|
|
199
|
+
```ruby
|
|
200
|
+
tz.to_local(Time.utc(2018, 7, 1, 12, 30, 0))
|
|
201
|
+
# => 2018-07-01 08:30:00 -0400
|
|
202
|
+
tz.to_local(DateTime.new(2018, 7, 1, 12, 30, 0))
|
|
203
|
+
# => #<TZInfo::DateTimeWithOffset: 2018-07-01T08:30:00-04:00 ((2458301j,45000s,0n),-14400s,2299161j)>
|
|
204
|
+
tz.to_local(TZInfo::Timestamp.create(2018, 7, 1, 12, 30, 0, 0, :utc))
|
|
205
|
+
# => #<TZInfo::TimestampWithOffset: @value=1530448200, @sub_second=0, @utc_offset=-14400, @utc=false>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
In addition to `local_time`, which returns `Time` instances, the
|
|
209
|
+
`local_datetime` and `local_timestamp` methods can be used to construct local
|
|
210
|
+
`DateTime` and `TZInfo::Timestamp` instances with the appropriate offset:
|
|
211
|
+
|
|
212
|
+
```ruby
|
|
213
|
+
tz.local_time(2018, 2, 1, 7, 30, 0)
|
|
214
|
+
# => 2018-02-01 07:30:00 -0500
|
|
215
|
+
tz.local_datetime(2018, 2, 1, 7, 30, 0)
|
|
216
|
+
# => #<TZInfo::DateTimeWithOffset: 2018-02-01T07:30:00-05:00 ((2458151j,45000s,0n),-18000s,2299161j)>
|
|
217
|
+
tz.local_timestamp(2018, 2, 1, 7, 30, 0)
|
|
218
|
+
# => #<TZInfo::TimestampWithOffset: @value=1517488200, @sub_second=0, @utc_offset=-18000, @utc=false>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
The `local_to_utc`, `local_time`, `local_datetime` and `local_timestamp` methods
|
|
222
|
+
may raise a `TZInfo::PeriodNotFound` or a `TZInfo::AmbiguousTime` exception.
|
|
223
|
+
`TZInfo::PeriodNotFound` signals that there is no equivalent UTC time (for
|
|
224
|
+
example, during the transition from standard time to daylight savings time when
|
|
225
|
+
the clocks are moved forward and an hour is skipped). `TZInfo::AmbiguousTime`
|
|
226
|
+
signals that there is more than one equivalent UTC time (for example, during the
|
|
227
|
+
transition from daylight savings time to standard time where the clocks are
|
|
228
|
+
moved back and an hour is repeated):
|
|
229
|
+
|
|
230
|
+
```ruby
|
|
231
|
+
tz.local_time(2018, 3, 11, 2, 30, 0, 0)
|
|
232
|
+
# raises TZInfo::PeriodNotFound (2018-03-11 02:30:00 is an invalid local time.)
|
|
233
|
+
tz.local_time(2018, 11, 4, 1, 30, 0, 0)
|
|
234
|
+
# raises TZInfo::AmbiguousTime (2018-11-04 01:30:00 is an ambiguous local time.)
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
`TZInfo::PeriodNotFound` exceptions can only be resolved by adjusting the time,
|
|
238
|
+
for example, by advancing an hour:
|
|
239
|
+
|
|
240
|
+
```ruby
|
|
241
|
+
tz.local_time(2018, 3, 11, 3, 30, 0, 0)
|
|
242
|
+
# => 2018-03-11 03:30:00 -0400
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
`TZInfo::AmbiguousTime` exceptions can be resolved by setting the `dst`
|
|
246
|
+
parameter and/or specifying a block to choose one of the interpretations:
|
|
247
|
+
|
|
248
|
+
```ruby
|
|
249
|
+
tz.local_time(2018, 11, 4, 1, 30, 0, 0, true)
|
|
250
|
+
# => 2018-11-04 01:30:00 -0400
|
|
251
|
+
tz.local_time(2018, 11, 4, 1, 30, 0, 0, false)
|
|
252
|
+
# => 2018-11-04 01:30:00 -0500
|
|
253
|
+
|
|
254
|
+
tz.local_time(2018, 11, 4, 1, 30, 0, 0) {|p| p.first }
|
|
255
|
+
# => 2018-11-04 01:30:00 -0400
|
|
256
|
+
tz.local_time(2018, 11, 4, 1, 30, 0, 0) {|p| p.last }
|
|
257
|
+
# => 2018-11-04 01:30:00 -0500
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
The default value of the `dst` parameter can also be set globally:
|
|
261
|
+
|
|
262
|
+
```ruby
|
|
263
|
+
TZInfo::Timezone.default_dst = true
|
|
264
|
+
tz.local_time(2018, 11, 4, 1, 30, 0, 0)
|
|
265
|
+
# => 2018-11-04 01:30:00 -0400
|
|
266
|
+
TZInfo::Timezone.default_dst = false
|
|
267
|
+
tz.local_time(2018, 11, 4, 1, 30, 0, 0)
|
|
268
|
+
# => 2018-11-04 01:30:00 -0500
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
TZInfo also provides information about
|
|
272
|
+
[ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) countries and
|
|
273
|
+
their associated time zones via the `TZInfo::Country` class.
|
|
274
|
+
|
|
275
|
+
A list of valid ISO 3166-1 (alpha-2) country codes can be obtained by calling
|
|
276
|
+
`TZInfo::Country.all_codes`:
|
|
277
|
+
|
|
278
|
+
```ruby
|
|
279
|
+
TZInfo::Country.all_codes
|
|
280
|
+
# => ["AD", "AE", ..., "ZW"]
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
A `TZInfo::Country` instance representing an individual time zone can be
|
|
284
|
+
obtained with `TZInfo::Country.get`:
|
|
285
|
+
|
|
286
|
+
```ruby
|
|
287
|
+
c = TZInfo::Country.get('US')
|
|
288
|
+
# => #<TZInfo::Country: US>
|
|
289
|
+
c.name
|
|
290
|
+
# => "United States"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
The `zone_identifiers` method returns a list of the time zone identifiers used
|
|
294
|
+
in a country:
|
|
295
|
+
|
|
296
|
+
```ruby
|
|
297
|
+
c.zone_identifiers
|
|
298
|
+
# => ["America/New_York", "America/Detroit", ..., "Pacific/Honolulu"]
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
The `zone_info` method returns further information about the time zones used in
|
|
302
|
+
a country as an `Array` of `TZInfo::CountryTimezone` instances:
|
|
303
|
+
|
|
304
|
+
```ruby
|
|
305
|
+
zi = c.zone_info.first
|
|
306
|
+
zi.identifier # => "America/New_York"
|
|
307
|
+
zi.latitude.to_f.round(5) # => 40.71417
|
|
308
|
+
zi.longitude.to_f.round(5) # => -74.00639
|
|
309
|
+
zi.description # => "Eastern (most areas)"
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
The `zones` method returns an `Array` of `TZInfo::Timezone` instances for a
|
|
313
|
+
country. A `TZInfo::Timezone` instance can be obtained from a
|
|
314
|
+
`TZInfo::CountryTimezone` using the `timezone` method:
|
|
315
|
+
|
|
316
|
+
```ruby
|
|
317
|
+
zi.timezone.to_local(Time.utc(2018, 2, 1, 12, 30, 0))
|
|
318
|
+
# => 2018-02-01 07:30:00 -0500
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
For further detail, please refer to the API documentation for the
|
|
322
|
+
`TZInfo::Timezone` and `TZInfo::Country` classes.
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
## Time Zone Selection
|
|
326
|
+
|
|
327
|
+
The Time Zone Database maintainers recommend that time zone identifiers are not
|
|
328
|
+
made visible to end-users (see [Names of
|
|
329
|
+
timezones](https://data.iana.org/time-zones/theory.html#naming)).
|
|
330
|
+
|
|
331
|
+
Instead of displaying a list of time zone identifiers, time zones can be
|
|
332
|
+
selected by the user's country. Call `TZInfo::Country.all` to obtain a list of
|
|
333
|
+
`TZInfo::Country` objects, each with a unique `code` and a `name` that can be
|
|
334
|
+
used for display purposes.
|
|
335
|
+
|
|
336
|
+
Most countries have a single time zone. When choosing such a country, the time
|
|
337
|
+
zone can be inferred and selected automatically.
|
|
338
|
+
|
|
339
|
+
```ruby
|
|
340
|
+
croatia = TZInfo::Country.get('HR')
|
|
341
|
+
# => #<TZInfo::Country: HR>
|
|
342
|
+
croatia.zone_info.length
|
|
343
|
+
# => 1
|
|
344
|
+
croatia.zone_info[0].identifier
|
|
345
|
+
# => "Europe/Belgrade"
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Some countries have multiple time zones. The `zone_info` method can be used
|
|
349
|
+
to obtain a list of user-friendly descriptions of the available options:
|
|
350
|
+
|
|
351
|
+
```ruby
|
|
352
|
+
australia = TZInfo::Country.get('AU')
|
|
353
|
+
# => #<TZInfo::Country: AU>
|
|
354
|
+
australia.zone_info.length
|
|
355
|
+
# => 13
|
|
356
|
+
australia.zone_info.map {|i| [i.identifier, i.description] }
|
|
357
|
+
# => [["Australia/Lord_Howe", "Lord Howe Island"],
|
|
358
|
+
# ["Antarctica/Macquarie", "Macquarie Island"],
|
|
359
|
+
# ...
|
|
360
|
+
# ["Australia/Eucla", "Western Australia (Eucla)"]]
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Please note that country information available through TZInfo is intended as an
|
|
364
|
+
aid to help users select a time zone data appropriate for their practical needs.
|
|
365
|
+
It is not intended to take or endorse any position on legal or territorial
|
|
366
|
+
claims.
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
## Compatibility
|
|
370
|
+
|
|
371
|
+
TZInfo v2.0.0 requires a minimum of Ruby MRI 1.9.3 or JRuby 1.7 (in 1.9 mode or
|
|
372
|
+
later).
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
## Thread-Safety
|
|
376
|
+
|
|
377
|
+
The `TZInfo::Country` and `TZInfo::Timezone` classes are thread-safe. It is safe
|
|
378
|
+
to use class and instance methods of `TZInfo::Country` and `TZInfo::Timezone` in
|
|
379
|
+
concurrently executing threads. Instances of both classes can be shared across
|
|
380
|
+
thread boundaries.
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
## Documentation
|
|
384
|
+
|
|
385
|
+
API documentation for TZInfo is available on
|
|
386
|
+
[RubyDoc.info](https://www.rubydoc.info/gems/tzinfo/).
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
## License
|
|
390
|
+
|
|
391
|
+
TZInfo is released under the MIT license, see LICENSE for details.
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
## Source Code
|
|
395
|
+
|
|
396
|
+
Source code for TZInfo is available on
|
|
397
|
+
[GitHub](https://github.com/tzinfo/tzinfo).
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
## Issue Tracker
|
|
401
|
+
|
|
402
|
+
Please post any bugs, issues, feature requests or questions about TZInfo to the
|
|
403
|
+
[GitHub issue tracker](https://github.com/tzinfo/tzinfo/issues).
|
|
404
|
+
|
|
405
|
+
Issues with the underlying time zone data should be raised on the
|
|
406
|
+
[Time Zone Database Discussion mailing list](https://mm.icann.org/mailman/listinfo/tz).
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
## 3.2.0
|
|
4
|
+
|
|
5
|
+
- Unicode 17.0
|
|
6
|
+
|
|
7
|
+
## 3.1.5
|
|
8
|
+
|
|
9
|
+
- Cache Emoji support level for performance reasons #30, patch by @Earlopain:
|
|
10
|
+
|
|
11
|
+
## 3.1.4
|
|
12
|
+
|
|
13
|
+
- Fix that skin tone modifiers were ignored when used in a non-ZWJ sequence
|
|
14
|
+
context (= single emoji char + modifier) #29
|
|
15
|
+
- Add more docs and specs about modifier handling
|
|
16
|
+
|
|
17
|
+
## 3.1.3
|
|
18
|
+
|
|
19
|
+
Better handling of non-UTF-8 strings, patch by @Earlopain:
|
|
20
|
+
|
|
21
|
+
- Data with *BINARY* encoding is interpreted as UTF-8, if possible
|
|
22
|
+
- Use `invalid: :replace` and `undef: :replace` options when converting to UTF-8
|
|
23
|
+
|
|
24
|
+
## 3.1.2
|
|
25
|
+
|
|
26
|
+
- Performance improvements
|
|
27
|
+
|
|
28
|
+
## 3.1.1
|
|
29
|
+
|
|
30
|
+
- Performance improvements
|
|
31
|
+
|
|
32
|
+
## 3.1.0
|
|
33
|
+
|
|
34
|
+
**Improve Emoji support:**
|
|
35
|
+
|
|
36
|
+
- Emoji modes: Differentiate between well-formed Emoji (`:possible`) and any
|
|
37
|
+
ZWJ/modifier sequence (`:all`). The latter is more common and more efficient
|
|
38
|
+
to implement.
|
|
39
|
+
- Unify `:rgi_{fqe,mqe,uqe}` options to just `:rgi` to keep things simpler (corresponds to
|
|
40
|
+
the former `:rgi_uqe` option). Most terminals that want to support the RGI set
|
|
41
|
+
will probably want to catch Emoji sequences with missing VS16s.
|
|
42
|
+
- Add new `:all_no_vs16` and `:rgi_at` modes to be able to support some terminals
|
|
43
|
+
that needs these quirks
|
|
44
|
+
- Add alias `emoji: :auto` for `emoji: true` and `emoji: :none` for `emoji: false`
|
|
45
|
+
- `:auto` mode: Only consider terminal cells when recommending Emoji support level
|
|
46
|
+
(Emoji themselves might display differently)
|
|
47
|
+
- `:auto` mode: Set default Emoji mode for unknown/unsupported terminals to `:none`
|
|
48
|
+
- Rename `:basic` mode to `:vs16`
|
|
49
|
+
|
|
50
|
+
## 3.0.1
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
- Add WezTerm and foot as good Emoji terminals
|
|
54
|
+
|
|
55
|
+
## 3.0.0
|
|
56
|
+
|
|
57
|
+
**Rework Emoji support:**
|
|
58
|
+
|
|
59
|
+
- Emoji widths are now enabled by default
|
|
60
|
+
- Only reduce Emoji width to 2 when RGI Emoji detected (configurable)
|
|
61
|
+
- VS16 turns Emoji characters of width 1 into full-width
|
|
62
|
+
- Please note that Emoji parsing has a notable impact on performance.
|
|
63
|
+
You can use the `emoji: false` option to disable Emoji adjustments
|
|
64
|
+
- Tries to detect terminal's Emoji support level automatically (from ENV vars)
|
|
65
|
+
|
|
66
|
+
**Index fixes and updates:**
|
|
67
|
+
|
|
68
|
+
- Private-use characters are considered ambiguous (were given width 1 before)
|
|
69
|
+
- Fix that a few zero-width ignorable codepoints from recent Unicode were missing
|
|
70
|
+
- Consider the following separators to be zero-width:
|
|
71
|
+
- U+2028 - LINE SEPARATOR - Zl
|
|
72
|
+
- U+2029 - PARAGRAPH SEPARATOR - Zp
|
|
73
|
+
|
|
74
|
+
**Other:**
|
|
75
|
+
|
|
76
|
+
- Add keyword arguments to `Unicode::DisplayWidth.of`. If you are using a hash
|
|
77
|
+
with overwrite values as third parameter, be sure to put it in curly braces.
|
|
78
|
+
- Using third parameter or explicit hash as fourth parameter is deprecated,
|
|
79
|
+
please migrate to the keyword arguments API
|
|
80
|
+
- Gem raises `ArgumentError` for ambiguous values other than 1 or 2
|
|
81
|
+
- Performance optimizations
|
|
82
|
+
- Require Ruby 2.5
|
|
83
|
+
|
|
84
|
+
## 2.6.0
|
|
85
|
+
|
|
86
|
+
- Unicode 16
|
|
87
|
+
|
|
88
|
+
## 2.5.0
|
|
89
|
+
|
|
90
|
+
- Unicode 15.1
|
|
91
|
+
|
|
92
|
+
## 2.4.2
|
|
93
|
+
|
|
94
|
+
More performance improvements:
|
|
95
|
+
|
|
96
|
+
- Optimize lookup of first 4096 codepoints
|
|
97
|
+
- Avoid overwrite lookup if no overwrites are set
|
|
98
|
+
|
|
99
|
+
## 2.4.1
|
|
100
|
+
|
|
101
|
+
- Improve general performance!
|
|
102
|
+
- Further improve performance for ASCII strings
|
|
103
|
+
|
|
104
|
+
*You should really upgrade - it's much faster now!*
|
|
105
|
+
|
|
106
|
+
## 2.4.0
|
|
107
|
+
- Improve performance for ASCII-only strings, by @fatkodima
|
|
108
|
+
- Require Ruby 2.4
|
|
109
|
+
|
|
110
|
+
## 2.3.0
|
|
111
|
+
|
|
112
|
+
- Unicode 15.0
|
|
113
|
+
|
|
114
|
+
## 2.2.0
|
|
115
|
+
|
|
116
|
+
- Add *Hangul Jamo Extended-B* block to zero-width chars, thanks @ninjalj #22
|
|
117
|
+
|
|
118
|
+
## 2.1.0
|
|
119
|
+
|
|
120
|
+
- Unicode 14.0
|
|
121
|
+
|
|
122
|
+
## 2.0.0
|
|
123
|
+
|
|
124
|
+
Add Support for Ruby 3.0
|
|
125
|
+
|
|
126
|
+
### Breaking Changes
|
|
127
|
+
|
|
128
|
+
Some features of this library were marked deprecated for a long time and have been removed with Version 2.0:
|
|
129
|
+
|
|
130
|
+
- Aliases of display\_width (…\_size, …\_length) have been removed
|
|
131
|
+
- Auto-loading of string core extension has been removed:
|
|
132
|
+
|
|
133
|
+
If you are relying on the `String#display_width` string extension to be automatically loaded (old behavior), please load it explicitly now:
|
|
134
|
+
|
|
135
|
+
```ruby
|
|
136
|
+
require "unicode/display_width/string_ext"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
You could also change your `Gemfile` line to achieve this:
|
|
140
|
+
|
|
141
|
+
```ruby
|
|
142
|
+
gem "unicode-display_width", require: "unicode/display_width/string_ext"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 2.0.0.pre2
|
|
146
|
+
|
|
147
|
+
- Update 2.0 branch to Unicode 13
|
|
148
|
+
|
|
149
|
+
## 2.0.0.pre1
|
|
150
|
+
|
|
151
|
+
Will be published as non-pre version on rubygems.org when Ruby 3.0 is released (December 2020)
|
|
152
|
+
|
|
153
|
+
- Introduce new class-based API, which remembers your string-width configuration. See README for details.
|
|
154
|
+
- Remove auto-loading of string extension
|
|
155
|
+
- You can: `require "unicode/display_width/string_ext"` to continue to use the string extension
|
|
156
|
+
- The manual opt-out `require "unicode/display_width/no_string_ext"` is not needed anymore and will
|
|
157
|
+
issue a warning in the future
|
|
158
|
+
- Remove (already deprecated) String#display_size and String#display_width aliases
|
|
159
|
+
|
|
160
|
+
Refactorings / Internal Changes:
|
|
161
|
+
|
|
162
|
+
- Freeze string literals
|
|
163
|
+
- The Unicode::DisplayWidth now is class, instead of a module, this enables the new config-object API
|
|
164
|
+
|
|
165
|
+
## 1.8.0
|
|
166
|
+
|
|
167
|
+
- Unicode 14.0 (last release of 1.x)
|
|
168
|
+
|
|
169
|
+
## 1.7.0
|
|
170
|
+
|
|
171
|
+
- Unicode 13
|
|
172
|
+
|
|
173
|
+
## 1.6.1
|
|
174
|
+
|
|
175
|
+
- Fix that ambiguous and overwrite options where ignored for emoji-measuring
|
|
176
|
+
|
|
177
|
+
## 1.6.0
|
|
178
|
+
|
|
179
|
+
- Unicode 12.1
|
|
180
|
+
|
|
181
|
+
## 1.5.0
|
|
182
|
+
|
|
183
|
+
- Unicode 12
|
|
184
|
+
|
|
185
|
+
## 1.4.1
|
|
186
|
+
|
|
187
|
+
- Only bundle required lib/* and data/* files in actual rubygem, patch by @tas50
|
|
188
|
+
|
|
189
|
+
## 1.4.0
|
|
190
|
+
|
|
191
|
+
- Unicode 11
|
|
192
|
+
|
|
193
|
+
## 1.3.3
|
|
194
|
+
|
|
195
|
+
- Replace Gem::Util.gunzip with direct zlib implementation
|
|
196
|
+
This removes the dependency on rubygems, fixes #17
|
|
197
|
+
|
|
198
|
+
## 1.3.2
|
|
199
|
+
|
|
200
|
+
- Explicitly load rubygems/util, fixes regression in 1.3.1 (autoload issue)
|
|
201
|
+
|
|
202
|
+
## 1.3.1
|
|
203
|
+
|
|
204
|
+
- Use `Gem::Util` for `gunzip`, removes deprecation warning, patch by @Schwad
|
|
205
|
+
|
|
206
|
+
## 1.3.0
|
|
207
|
+
|
|
208
|
+
- Unicode 10
|
|
209
|
+
|
|
210
|
+
## 1.2.1
|
|
211
|
+
|
|
212
|
+
- Fix bug that `emoji: true` would fail for emoji without modifier
|
|
213
|
+
|
|
214
|
+
## 1.2.0
|
|
215
|
+
|
|
216
|
+
- Add zero-width codepoint ranges: U+2060..U+206F, U+FFF0..U+FFF8, U+E0000..U+E0FFF
|
|
217
|
+
- Add full-witdh codepoint ranges: U+3400..U+4DBF, U+4E00..U+9FFF, U+F900..U+FAFF, U+20000..U+2FFFD, U+30000..U+3FFFD
|
|
218
|
+
- Experimental emoji support using the [unicode-emoji](https://github.com/janlelis/unicode-emoji) gem
|
|
219
|
+
- Fix minor bug in index compression scheme
|
|
220
|
+
|
|
221
|
+
## 1.1.3
|
|
222
|
+
|
|
223
|
+
- Fix that non-UTF-8 encodings do not throw errors, patch by @windwiny
|
|
224
|
+
|
|
225
|
+
## 1.1.2
|
|
226
|
+
|
|
227
|
+
- Reduce memory consumption and increase performance, patch by @rrosenblum
|
|
228
|
+
|
|
229
|
+
## 1.1.1
|
|
230
|
+
|
|
231
|
+
- Always load index into memory, fixes #9
|
|
232
|
+
|
|
233
|
+
## 1.1.0
|
|
234
|
+
|
|
235
|
+
- Support Unicode 9.0
|
|
236
|
+
|
|
237
|
+
## 1.0.5
|
|
238
|
+
|
|
239
|
+
- Actually include new index from 1.0.4
|
|
240
|
+
|
|
241
|
+
## 1.0.4
|
|
242
|
+
|
|
243
|
+
- New index format (much smaller) and internal API changes
|
|
244
|
+
- Move index generation to a builder plugin for the unicoder gem
|
|
245
|
+
- No public API changes
|
|
246
|
+
|
|
247
|
+
## 1.0.3
|
|
248
|
+
|
|
249
|
+
- Avoid circular dependency warning
|
|
250
|
+
|
|
251
|
+
## 1.0.2
|
|
252
|
+
|
|
253
|
+
- Fix error that gemspec might be invalid under some circumstances (see gh#6)
|
|
254
|
+
|
|
255
|
+
## 1.0.1
|
|
256
|
+
|
|
257
|
+
- Inofficially allow Ruby 1.9
|
|
258
|
+
|
|
259
|
+
## 1.0.0
|
|
260
|
+
|
|
261
|
+
- Faster than 0.3.1
|
|
262
|
+
- Advanced determination of character width
|
|
263
|
+
- This includes: Treat width of most chars of general categories (Mn, Me, Cf) as 0
|
|
264
|
+
- This includes: Introduce list of characters with special widths
|
|
265
|
+
- Allow custom overrides for specific codepoints
|
|
266
|
+
- Set required Ruby version to 2.0
|
|
267
|
+
- Add NO_STRING_EXT mode to disable monkey patching
|
|
268
|
+
- Internal API & index format changed drastically
|
|
269
|
+
- Remove require 'unicode/display_size' (use 'unicode/display_width' instead)
|
|
270
|
+
|
|
271
|
+
## 0.3.1
|
|
272
|
+
|
|
273
|
+
- Faster than 0.3.0
|
|
274
|
+
- Deprecate usage of aliases: String#display_size and String#display_length
|
|
275
|
+
- Eliminate Ruby warnings (@amatsuda)
|
|
276
|
+
|
|
277
|
+
## 0.3.0
|
|
278
|
+
|
|
279
|
+
- Update EastAsianWidth from 7.0 to 8.0
|
|
280
|
+
- Add rake task to update EastAsianWidth.txt
|
|
281
|
+
- Move code to generate index from library to Rakefile
|
|
282
|
+
- Update project's meta files
|
|
283
|
+
- Deprecate requiring 'unicode-display_size'
|
|
284
|
+
|
|
285
|
+
## 0.2.0
|
|
286
|
+
|
|
287
|
+
- Update EastAsianWidth from 6.0 to 7.0
|
|
288
|
+
- Don't build index table automatically when not available
|
|
289
|
+
- Don't include EastAsianWidth.txt in gem (only index)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
## 0.1.0
|
|
293
|
+
|
|
294
|
+
- Fix github issue #1
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
## 0.1.0
|
|
298
|
+
|
|
299
|
+
- Initial release
|