acfs 1.7.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +144 -116
- data/README.md +19 -24
- data/acfs.gemspec +7 -10
- data/lib/acfs/collections/paginatable.rb +11 -11
- data/lib/acfs/configuration.rb +1 -1
- data/lib/acfs/errors.rb +6 -6
- data/lib/acfs/global.rb +2 -2
- data/lib/acfs/location.rb +1 -1
- data/lib/acfs/resource/attributes/uuid.rb +1 -1
- data/lib/acfs/resource/attributes.rb +1 -1
- data/lib/acfs/resource/dirty.rb +1 -1
- data/lib/acfs/resource/operational.rb +4 -4
- data/lib/acfs/resource/query_methods.rb +3 -3
- data/lib/acfs/response/status.rb +1 -1
- data/lib/acfs/service/middleware.rb +2 -2
- data/lib/acfs/singleton_resource.rb +2 -2
- data/lib/acfs/stub.rb +1 -1
- data/lib/acfs/version.rb +2 -2
- data/lib/acfs/yard.rb +1 -0
- data/spec/acfs/adapter/typhoeus_spec.rb +3 -3
- data/spec/acfs/configuration_spec.rb +1 -1
- data/spec/acfs/global_spec.rb +5 -5
- data/spec/acfs/location_spec.rb +1 -1
- data/spec/acfs/middleware/json_spec.rb +1 -1
- data/spec/acfs/middleware/message_pack_spec.rb +1 -1
- data/spec/acfs/operation_spec.rb +1 -1
- data/spec/acfs/resource/attributes/boolean_spec.rb +31 -31
- data/spec/acfs/resource/attributes/date_time_spec.rb +9 -9
- data/spec/acfs/resource/attributes/dict_spec.rb +10 -10
- data/spec/acfs/resource/attributes/float_spec.rb +11 -11
- data/spec/acfs/resource/attributes/integer_spec.rb +6 -6
- data/spec/acfs/resource/attributes/list_spec.rb +1 -1
- data/spec/acfs/resource/attributes/uuid_spec.rb +8 -8
- data/spec/acfs/resource/attributes_spec.rb +8 -8
- data/spec/acfs/resource/dirty_spec.rb +1 -1
- data/spec/acfs/resource/persistence_spec.rb +7 -7
- data/spec/acfs/resource/query_methods_spec.rb +1 -1
- data/spec/acfs/runner_spec.rb +12 -12
- data/spec/acfs/stub_spec.rb +13 -18
- data/spec/acfs_spec.rb +4 -4
- data/spec/spec_helper.rb +9 -5
- data/spec/support/hash.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/README.md +23 -0
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/rubocop-config.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/CHANGELOG.md +205 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/README.rdoc +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/CHANGELOG.md +67 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/README.rdoc +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/CHANGELOG.md +110 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/README.rdoc +266 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/CHANGELOG.md +157 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/README.rdoc +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/CHANGELOG.md +301 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/README.md +121 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/addressable.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/README.md +243 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/appraisal.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/README.md +48 -0
- data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/README.md +138 -0
- data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/benchmark.gemspec +32 -0
- data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/LICENSE +56 -0
- data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/bigdecimal.gemspec +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/README.md +258 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/builder.gemspec +49 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/CHANGELOG.md +603 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/LICENSE.txt +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/README.md +407 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/README.md +167 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/connection_pool.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/crack-1.0.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/crack-1.0.0/README.md +43 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/LICENSE +18 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/README.md +192 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/crass.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/License.md +41 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/README.rdoc +84 -0
- data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/drb.gemspec +41 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/CHANGELOG +111 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/README.rdoc +151 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/CHANGELOG.md +375 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/README.md +118 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/ethon.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/CHANGELOG.md +465 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/LICENSE +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/LICENSE.SPECS +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/README.md +137 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/ffi.gemspec +42 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/LICENSE +19 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/README.md +298 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/changelog.md +119 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/hashdiff.gemspec +39 -0
- data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.6/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.6/README.md +127 -0
- data/vendor/bundle/ruby/3.4.0/gems/json-2.9.1/README.md +195 -0
- data/vendor/bundle/ruby/3.4.0/gems/json-2.9.1/json.gemspec +64 -0
- data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/README.md +104 -0
- data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/logger.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/CHANGELOG.md +591 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/MIT-LICENSE.txt +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/README.md +410 -0
- data/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.4/README.rdoc +835 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/CHANGELOG.md +275 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/README.md +121 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/LICENSE-DEPENDENCIES.md +2224 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/LICENSE.md +9 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/README.md +293 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/CHANGELOG.md +491 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/README.md +222 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/ChangeLog +846 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +60 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/CHANGELOG.md +998 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/README.md +328 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-session-2.1.0/license.md +72 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-session-2.1.0/readme.md +47 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/MIT-LICENSE.txt +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/README.md +139 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/MIT-LICENSE +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/README.md +91 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/CHANGELOG.md +255 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/MIT-LICENSE +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/README.md +267 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/README.rdoc +155 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/rake.gemspec +101 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/README.md +107 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/rake-release.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.0/README.md +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/LICENSE.md +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/README.md +47 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/Changelog.md +68 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/LICENSE.txt +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/README.md +76 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/rspec-collection_matchers.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/Changelog.md +2415 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/LICENSE.md +26 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/README.md +389 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/Changelog.md +1352 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/LICENSE.md +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/README.md +326 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/Changelog.md +73 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/LICENSE.txt +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/README.md +104 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/rspec-its.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/Changelog.md +1299 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/LICENSE.md +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/README.md +465 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/Changelog.md +408 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/LICENSE.md +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/README.md +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/securerandom-0.4.1/README.md +72 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/README.md +45 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/thor.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/CHANGELOG.md +410 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/LICENSE +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/README.md +588 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/typhoeus.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/LICENSE +19 -0
- data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/README.md +406 -0
- data/vendor/bundle/ruby/3.4.0/gems/uri-1.0.2/README.md +55 -0
- data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/README.md +42 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/CHANGELOG.md +2104 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/README.md +1222 -0
- data/vendor/bundle/ruby/3.4.0/specifications/actionpack-8.0.1.gemspec +36 -0
- data/vendor/bundle/ruby/3.4.0/specifications/actionview-8.0.1.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/activemodel-8.0.1.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/activesupport-8.0.1.gemspec +38 -0
- data/vendor/bundle/ruby/3.4.0/specifications/addressable-2.8.7.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/appraisal-2.5.0.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/base64-0.2.0.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/benchmark-0.4.0.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/bigdecimal-3.1.9.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/builder-3.3.0.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/concurrent-ruby-1.3.5.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/connection_pool-2.5.0.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/crack-1.0.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/crass-1.0.6.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/diff-lcs-1.5.1.gemspec +37 -0
- data/vendor/bundle/ruby/3.4.0/specifications/drb-2.2.1.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/erubi-1.13.1.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/ethon-0.16.0.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/ffi-1.17.1-x86_64-linux-gnu.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/hashdiff-1.1.2.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/i18n-1.14.6.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/json-2.9.1.gemspec +0 -0
- data/vendor/bundle/ruby/3.4.0/specifications/logger-1.6.5.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/loofah-2.24.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/minitest-5.25.4.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/multi_json-1.15.0.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/nokogiri-1.18.1-x86_64-linux-gnu.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/public_suffix-6.0.1.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-3.1.8.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-session-2.1.0.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-test-2.2.0.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rails-dom-testing-2.2.0.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rails-html-sanitizer-1.6.2.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rake-13.2.1.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rake-release-1.3.0.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rexml-3.4.0.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-3.13.0.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-collection_matchers-1.2.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-core-3.13.2.gemspec +39 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-expectations-3.13.3.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-its-2.0.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-mocks-3.13.2.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-support-3.13.2.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/securerandom-0.4.1.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/thor-1.3.2.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/typhoeus-1.4.1.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/tzinfo-2.0.6.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/uri-1.0.2.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/useragent-0.16.11.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/webmock-3.24.0.gemspec +45 -0
- metadata +204 -67
@@ -0,0 +1,406 @@
|
|
1
|
+
# TZInfo - Ruby Time Zone Library
|
2
|
+
|
3
|
+
[![RubyGems](https://img.shields.io/gem/v/tzinfo?logo=rubygems&label=Gem)](https://rubygems.org/gems/tzinfo) [![Tests](https://github.com/tzinfo/tzinfo/workflows/Tests/badge.svg?branch=master&event=push)](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,55 @@
|
|
1
|
+
# URI
|
2
|
+
|
3
|
+
[![CI](https://github.com/ruby/uri/actions/workflows/test.yml/badge.svg)](https://github.com/ruby/uri/actions/workflows/test.yml)
|
4
|
+
[![Yard Docs](https://img.shields.io/badge/docs-exist-blue.svg)](https://ruby.github.io/uri/)
|
5
|
+
|
6
|
+
URI is a module providing classes to handle Uniform Resource Identifiers [RFC2396](http://tools.ietf.org/html/rfc2396).
|
7
|
+
|
8
|
+
## Features
|
9
|
+
|
10
|
+
* Uniform way of handling URIs.
|
11
|
+
* Flexibility to introduce custom URI schemes.
|
12
|
+
* Flexibility to have an alternate URI::Parser (or just different patterns and regexp's).
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
Add this line to your application's Gemfile:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
gem 'uri'
|
20
|
+
```
|
21
|
+
|
22
|
+
And then execute:
|
23
|
+
|
24
|
+
$ bundle
|
25
|
+
|
26
|
+
Or install it yourself as:
|
27
|
+
|
28
|
+
$ gem install uri
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
require 'uri'
|
34
|
+
|
35
|
+
uri = URI("http://foo.com/posts?id=30&limit=5#time=1305298413")
|
36
|
+
#=> #<URI::HTTP http://foo.com/posts?id=30&limit=5#time=1305298413>
|
37
|
+
|
38
|
+
uri.scheme #=> "http"
|
39
|
+
uri.host #=> "foo.com"
|
40
|
+
uri.path #=> "/posts"
|
41
|
+
uri.query #=> "id=30&limit=5"
|
42
|
+
uri.fragment #=> "time=1305298413"
|
43
|
+
|
44
|
+
uri.to_s #=> "http://foo.com/posts?id=30&limit=5#time=1305298413"
|
45
|
+
```
|
46
|
+
|
47
|
+
## Development
|
48
|
+
|
49
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
50
|
+
|
51
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
52
|
+
|
53
|
+
## Contributing
|
54
|
+
|
55
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/uri.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2015 Garry Shutler
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# UserAgent
|
2
|
+
|
3
|
+
[![Build Status](https://github.com/gshutler/useragent/actions/workflows/test.yml/badge.svg)](https://github.com/gshutler/useragent/actions/workflows/test.yml)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/useragent.svg)](http://badge.fury.io/rb/useragent)
|
5
|
+
|
6
|
+
UserAgent is a Ruby library that parses and compares HTTP User Agents.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
gem install useragent
|
11
|
+
|
12
|
+
### Examples
|
13
|
+
|
14
|
+
#### Reporting
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
string = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5'
|
18
|
+
user_agent = UserAgent.parse(string)
|
19
|
+
user_agent.browser
|
20
|
+
# => 'Chrome'
|
21
|
+
user_agent.version
|
22
|
+
# => '19.0.1084.56'
|
23
|
+
user_agent.platform
|
24
|
+
# => 'Macintosh'
|
25
|
+
```
|
26
|
+
|
27
|
+
#### Comparison
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
Browser = Struct.new(:browser, :version)
|
31
|
+
|
32
|
+
SupportedBrowsers = [
|
33
|
+
Browser.new("Safari", "3.1.1"),
|
34
|
+
Browser.new("Firefox", "2.0.0.14"),
|
35
|
+
Browser.new("Internet Explorer", "7.0")
|
36
|
+
]
|
37
|
+
|
38
|
+
user_agent = UserAgent.parse(request.user_agent)
|
39
|
+
SupportedBrowsers.detect { |browser| user_agent >= browser }
|
40
|
+
```
|
41
|
+
|
42
|
+
Copyright (c) 2015-2019 Garry Shutler, released under the MIT license
|