Tue Oct 18 16:08:35 2016 UTC ()
Update ruby-rest-client to 2.0.0.

pkgsrc change: Add pkg_alternatives support.

# 2.0.0

This release is largely API compatible, but makes several breaking changes.

- Drop support for Ruby 1.9
- Allow mime-types as new as 3.x (requires ruby 2.0)
- Respect Content-Type charset header provided by server. Previously,
  rest-client would not override the string encoding chosen by Net::HTTP. Now
  responses that specify a charset will yield a body string in that encoding.
  For example, `Content-Type: text/plain; charset=EUC-JP` will return a String
  encoded with `Encoding::EUC_JP`. (#361)
- Change exceptions raised on request timeout. Instead of
  `RestClient::RequestTimeout` (which is still used for HTTP 408), network
  timeouts will now raise either `RestClient::Exceptions::ReadTimeout` or
  `RestClient::Exceptions::OpenTimeout`, both of which inherit from
  `RestClient::Exceptions::Timeout`. For backwards compatibility, this still
  inherits from `RestClient::RequestTimeout` so existing uses will still work.
  This may change in a future major release. These new timeout classes also
  make the original wrapped exception available as `#original_exception`.
- Unify request exceptions under `RestClient::RequestFailed`, which still
  inherits from `ExceptionWithResponse`. Previously, HTTP 304, 401, and 404
  inherited directly from `ExceptionWithResponse` rather than from
  `RequestFailed`. Now _all_ HTTP status code exceptions inherit from both.
- Rename the `:timeout` request option to `:read_timeout`. When `:timeout` is
  passed, now set both `:read_timeout` and `:open_timeout`.
- Change default HTTP Accept header to `*/*`
- Use a more descriptive User-Agent header by default
- Drop RC4-MD5 from default cipher list
- Only prepend http:// to URIs without a scheme
- Fix some support for using IPv6 addresses in URLs (still affected by Ruby
  2.0+ bug https://bugs.ruby-lang.org/issues/9129, with the fix expected to be
  backported to 2.0 and 2.1)
- `Response` objects are now a subclass of `String` rather than a `String` that
  mixes in the response functionality. Most of the methods remain unchanged,
  but this makes it much easier to understand what is happening when you look
  at a RestClient response object. There are a few additional changes:
  - Response objects now implement `.inspect` to make this distinction clearer.
  - `Response#to_i` will now behave like `String#to_i` instead of returning the
    HTTP response code, which was very surprising behavior.
  - `Response#body` and `#to_s` will now return a true `String` object rather
    than self. Previously there was no easy way to get the true `String`
    response instead of the Frankenstein response string object with
    AbstractResponse mixed in.
  - Response objects no longer accept an extra request args hash, but instead
    access request args directly from the request object, which reduces
    confusion and duplication.
- Handle multiple HTTP response headers with the same name (except for
  Set-Cookie, which is special) by joining the values with a comma space,
  compliant with RFC 7230
- Rewrite cookie support to be much smarter and to use cookie jars consistently
  for requests, responses, and redirection in order to resolve long-standing
  complaints about the previously broken behavior: (#498)
  - The `:cookies` option may now be a Hash of Strings, an Array of
    HTTP::Cookie objects, or a full HTTP::CookieJar.
  - Add `RestClient::Request#cookie_jar` and reimplement `Request#cookies` to
    be a wrapper around the cookie jar.
  - Still support passing the `:cookies` option in the headers hash, but now
    raise ArgumentError if that option is also passed to `Request#initialize`.
  - Warn if both `:cookies` and a `Cookie` header are supplied.
  - Use the `Request#cookie_jar` as the basis for `Response#cookie_jar`,
    creating a copy of the jar and adding any newly received cookies.
  - When following redirection, also use this same strategy so that cookies
    from the original request are carried through in a standards-compliant way
    by the cookie jar.
- Don't set basic auth header if explicit `Authorization` header is specified
- Add `:proxy` option to requests, which can be used for thread-safe
  per-request proxy configuration, overriding `RestClient.proxy`
- Allow overriding `ENV['http_proxy']` to disable proxies by setting
  `RestClient.proxy` to a falsey value. Previously there was no way in Ruby 2.x
  to turn off a proxy specified in the environment without changing `ENV`.
- Add actual support for streaming request payloads. Previously rest-client
  would call `.to_s` even on RestClient::Payload::Streamed objects. Instead,
  treat any object that responds to `.read` as a streaming payload and pass it
  through to `.body_stream=` on the Net:HTTP object. This massively reduces the
  memory required for large file uploads.
- Changes to redirection behavior: (#381, #484)
  - Remove `RestClient::MaxRedirectsReached` in favor of the normal
    `ExceptionWithResponse` subclasses. This makes the response accessible on
    the exception object as `.response`, making it possible for callers to tell
    what has actually happened when the redirect limit is reached.
  - When following HTTP redirection, store a list of each previous response on
    the response object as `.history`. This makes it possible to access the
    original response headers and body before the redirection was followed.
  - Follow redirection consistently, regardless of whether the HTTP method was
    passed as a symbol or string. Under the hood rest-client now normalizes the
    HTTP request method to a lowercase string.
- Add `:before_execution_proc` option to `RestClient::Request`. This makes it
  possible to add procs like `RestClient.add_before_execution_proc` to a single
  request without global state.
- Run tests on Travis's beta OS X support.
- Make `Request#transmit` a private method, along with a few others.
- Refactor URI parsing to happen earlier, in Request initialization.
- Improve consistency and functionality of complex URL parameter handling:
  - When adding URL params, handle URLs that already contain params.
  - Add new convention for handling URL params containing deeply nested arrays
    and hashes, unify handling of null/empty values, and use the same code for
    GET and POST params. (#437)
  - Add the RestClient::ParamsArray class, a simple array-like container that
    can be used to pass multiple keys with same name or keys where the ordering
    is significant.
- Add a few more exception classes for obscure HTTP status codes.
- Multipart: use a much more robust multipart boundary with greater entropy.
- Make `RestClient::Payload::Base#inspect` stop pretending to be a String.
- Add `Request#redacted_uri` and `Request#redacted_url` to display the URI
  with any password redacted.

# 2.0.0.rc1

Changes in the release candidate that did not persist through the final 2.0.0
release:
- RestClient::Exceptions::Timeout was originally going to be a direct subclass
  of RestClient::Exception in the release candidate. This exception tree was
  made a subclass of RestClient::RequestTimeout prior to the final release.


(taca)
diff -r0 -r1.1 pkgsrc/www/ruby-rest-client/ALTERNATIVES
diff -r1.4 -r1.5 pkgsrc/www/ruby-rest-client/Makefile
diff -r1.4 -r1.5 pkgsrc/www/ruby-rest-client/distinfo
diff -r1.2 -r1.3 pkgsrc/www/ruby-rest-client/PLIST

File Added: pkgsrc/www/ruby-rest-client/ALTERNATIVES
bin/restclient @PREFIX@/bin/restclient@RUBY_SUFFIX@

cvs diff -r1.4 -r1.5 pkgsrc/www/ruby-rest-client/Makefile (expand / switch to unified diff)

--- pkgsrc/www/ruby-rest-client/Makefile 2015/12/13 16:42:31 1.4
+++ pkgsrc/www/ruby-rest-client/Makefile 2016/10/18 16:08:35 1.5
@@ -1,18 +1,19 @@ @@ -1,18 +1,19 @@
1# $NetBSD: Makefile,v 1.4 2015/12/13 16:42:31 taca Exp $ 1# $NetBSD: Makefile,v 1.5 2016/10/18 16:08:35 taca Exp $
2 2
3DISTNAME= rest-client-1.8.0 3DISTNAME= rest-client-2.0.0
4PKGREVISION= 1 
5CATEGORIES= www 4CATEGORIES= www
6 5
7MAINTAINER= pkgsrc-users@NetBSD.org 6MAINTAINER= pkgsrc-users@NetBSD.org
8HOMEPAGE= http://github.com/archiloque/rest-client 7HOMEPAGE= http://github.com/archiloque/rest-client
9COMMENT= Simple HTTP and REST client for Ruby inspired by Sinatra 8COMMENT= Simple HTTP and REST client for Ruby inspired by Sinatra
10LICENSE= mit 9LICENSE= mit
11 10
12DEPENDS+= ${RUBY_PKGPREFIX}-readline>=${RUBY_VERSION}:../../devel/ruby-readline 11DEPENDS+= ${RUBY_PKGPREFIX}-readline>=${RUBY_VERSION}:../../devel/ruby-readline
13DEPENDS+= ${RUBY_PKGPREFIX}-mime-types2>=1.16<3.0:../../mail/ruby-mime-types2 12DEPENDS+= ${RUBY_PKGPREFIX}-mime-types>=3.0<4.0:../../mail/ruby-mime-types
14DEPENDS+= ${RUBY_PKGPREFIX}-netrc>=0.7<1:../../net/ruby-netrc 13DEPENDS+= ${RUBY_PKGPREFIX}-netrc>=0.7<1:../../net/ruby-netrc
15DEPENDS+= ${RUBY_PKGPREFIX}-http-cookie>=1.0.2<2:../../www/ruby-http-cookie 14DEPENDS+= ${RUBY_PKGPREFIX}-http-cookie>=1.0.2<2:../../www/ruby-http-cookie
16 15
 16RUBYGEM_OPTIONS+= --format-executable
 17
17.include "../../lang/ruby/gem.mk" 18.include "../../lang/ruby/gem.mk"
18.include "../../mk/bsd.pkg.mk" 19.include "../../mk/bsd.pkg.mk"

cvs diff -r1.4 -r1.5 pkgsrc/www/ruby-rest-client/distinfo (expand / switch to unified diff)

--- pkgsrc/www/ruby-rest-client/distinfo 2015/11/04 02:47:37 1.4
+++ pkgsrc/www/ruby-rest-client/distinfo 2016/10/18 16:08:35 1.5
@@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
1$NetBSD: distinfo,v 1.4 2015/11/04 02:47:37 agc Exp $ 1$NetBSD: distinfo,v 1.5 2016/10/18 16:08:35 taca Exp $
2 2
3SHA1 (rest-client-1.8.0.gem) = 271b57e37e69afbc1a02b455391d171379bdda8a 3SHA1 (rest-client-2.0.0.gem) = 00ac660748bfec3a4ddac935680553c928691eae
4RMD160 (rest-client-1.8.0.gem) = be9fab9a89955c9db281adbe9b1692d9f17a8b15 4RMD160 (rest-client-2.0.0.gem) = 6ae4cb0a99e346fa0e6c3e214ad8a14cf0fbc8bc
5SHA512 (rest-client-1.8.0.gem) = d4c03b2d2807ae963b116e8c977411305b55836e4129b18ce2e88ea5795838c448bece151f6b57aa03920ea21d9120835159a7e9c4bc5c9998beb3705d1f2bfd 5SHA512 (rest-client-2.0.0.gem) = 711b749d83a155d52a24427adadb300169182de1125dc44d3729cdd0f2e7e82e03cb152ab0c414960c966f35006b57defb3adca385377f0d8ee18cdcb5232832
6Size (rest-client-1.8.0.gem) = 124928 bytes 6Size (rest-client-2.0.0.gem) = 148480 bytes

cvs diff -r1.2 -r1.3 pkgsrc/www/ruby-rest-client/PLIST (expand / switch to unified diff)

--- pkgsrc/www/ruby-rest-client/PLIST 2015/03/13 17:36:10 1.2
+++ pkgsrc/www/ruby-rest-client/PLIST 2016/10/18 16:08:35 1.3
@@ -1,54 +1,64 @@ @@ -1,54 +1,64 @@
1@comment $NetBSD: PLIST,v 1.2 2015/03/13 17:36:10 taca Exp $ 1@comment $NetBSD: PLIST,v 1.3 2016/10/18 16:08:35 taca Exp $
2bin/restclient 2bin/restclient${RUBY_SUFFIX}
3${GEM_HOME}/cache/${GEM_NAME}.gem 3${GEM_HOME}/cache/${GEM_NAME}.gem
4${GEM_LIBDIR}/.gitignore 4${GEM_LIBDIR}/.gitignore
5${GEM_LIBDIR}/.rspec 5${GEM_LIBDIR}/.rspec
 6${GEM_LIBDIR}/.rubocop-disables.yml
 7${GEM_LIBDIR}/.rubocop.yml
6${GEM_LIBDIR}/.travis.yml 8${GEM_LIBDIR}/.travis.yml
7${GEM_LIBDIR}/AUTHORS 9${GEM_LIBDIR}/AUTHORS
8${GEM_LIBDIR}/Gemfile 10${GEM_LIBDIR}/Gemfile
9${GEM_LIBDIR}/LICENSE 11${GEM_LIBDIR}/LICENSE
10${GEM_LIBDIR}/README.rdoc 12${GEM_LIBDIR}/README.md
11${GEM_LIBDIR}/Rakefile 13${GEM_LIBDIR}/Rakefile
12${GEM_LIBDIR}/bin/restclient 14${GEM_LIBDIR}/bin/restclient
13${GEM_LIBDIR}/history.md 15${GEM_LIBDIR}/history.md
14${GEM_LIBDIR}/lib/rest-client.rb 16${GEM_LIBDIR}/lib/rest-client.rb
15${GEM_LIBDIR}/lib/rest_client.rb 17${GEM_LIBDIR}/lib/rest_client.rb
16${GEM_LIBDIR}/lib/restclient.rb 18${GEM_LIBDIR}/lib/restclient.rb
17${GEM_LIBDIR}/lib/restclient/abstract_response.rb 19${GEM_LIBDIR}/lib/restclient/abstract_response.rb
18${GEM_LIBDIR}/lib/restclient/exceptions.rb 20${GEM_LIBDIR}/lib/restclient/exceptions.rb
 21${GEM_LIBDIR}/lib/restclient/params_array.rb
19${GEM_LIBDIR}/lib/restclient/payload.rb 22${GEM_LIBDIR}/lib/restclient/payload.rb
20${GEM_LIBDIR}/lib/restclient/platform.rb 23${GEM_LIBDIR}/lib/restclient/platform.rb
21${GEM_LIBDIR}/lib/restclient/raw_response.rb 24${GEM_LIBDIR}/lib/restclient/raw_response.rb
22${GEM_LIBDIR}/lib/restclient/request.rb 25${GEM_LIBDIR}/lib/restclient/request.rb
23${GEM_LIBDIR}/lib/restclient/resource.rb 26${GEM_LIBDIR}/lib/restclient/resource.rb
24${GEM_LIBDIR}/lib/restclient/response.rb 27${GEM_LIBDIR}/lib/restclient/response.rb
 28${GEM_LIBDIR}/lib/restclient/utils.rb
25${GEM_LIBDIR}/lib/restclient/version.rb 29${GEM_LIBDIR}/lib/restclient/version.rb
26${GEM_LIBDIR}/lib/restclient/windows.rb 30${GEM_LIBDIR}/lib/restclient/windows.rb
27${GEM_LIBDIR}/lib/restclient/windows/root_certs.rb 31${GEM_LIBDIR}/lib/restclient/windows/root_certs.rb
28${GEM_LIBDIR}/rest-client.gemspec 32${GEM_LIBDIR}/rest-client.gemspec
29${GEM_LIBDIR}/rest-client.windows.gemspec 33${GEM_LIBDIR}/rest-client.windows.gemspec
 34${GEM_LIBDIR}/spec/helpers.rb
 35${GEM_LIBDIR}/spec/integration/_lib.rb
30${GEM_LIBDIR}/spec/integration/capath_digicert/244b5494.0 36${GEM_LIBDIR}/spec/integration/capath_digicert/244b5494.0
31${GEM_LIBDIR}/spec/integration/capath_digicert/81b9768f.0 37${GEM_LIBDIR}/spec/integration/capath_digicert/81b9768f.0
32${GEM_LIBDIR}/spec/integration/capath_digicert/README 38${GEM_LIBDIR}/spec/integration/capath_digicert/README
33${GEM_LIBDIR}/spec/integration/capath_digicert/digicert.crt 39${GEM_LIBDIR}/spec/integration/capath_digicert/digicert.crt
34${GEM_LIBDIR}/spec/integration/capath_verisign/415660c1.0 40${GEM_LIBDIR}/spec/integration/capath_verisign/415660c1.0
35${GEM_LIBDIR}/spec/integration/capath_verisign/7651b327.0 41${GEM_LIBDIR}/spec/integration/capath_verisign/7651b327.0
36${GEM_LIBDIR}/spec/integration/capath_verisign/README 42${GEM_LIBDIR}/spec/integration/capath_verisign/README
37${GEM_LIBDIR}/spec/integration/capath_verisign/verisign.crt 43${GEM_LIBDIR}/spec/integration/capath_verisign/verisign.crt
38${GEM_LIBDIR}/spec/integration/certs/digicert.crt 44${GEM_LIBDIR}/spec/integration/certs/digicert.crt
39${GEM_LIBDIR}/spec/integration/certs/verisign.crt 45${GEM_LIBDIR}/spec/integration/certs/verisign.crt
 46${GEM_LIBDIR}/spec/integration/httpbin_spec.rb
40${GEM_LIBDIR}/spec/integration/integration_spec.rb 47${GEM_LIBDIR}/spec/integration/integration_spec.rb
41${GEM_LIBDIR}/spec/integration/request_spec.rb 48${GEM_LIBDIR}/spec/integration/request_spec.rb
42${GEM_LIBDIR}/spec/spec_helper.rb 49${GEM_LIBDIR}/spec/spec_helper.rb
 50${GEM_LIBDIR}/spec/unit/_lib.rb
43${GEM_LIBDIR}/spec/unit/abstract_response_spec.rb 51${GEM_LIBDIR}/spec/unit/abstract_response_spec.rb
44${GEM_LIBDIR}/spec/unit/exceptions_spec.rb 52${GEM_LIBDIR}/spec/unit/exceptions_spec.rb
45${GEM_LIBDIR}/spec/unit/master_shake.jpg 53${GEM_LIBDIR}/spec/unit/master_shake.jpg
 54${GEM_LIBDIR}/spec/unit/params_array_spec.rb
46${GEM_LIBDIR}/spec/unit/payload_spec.rb 55${GEM_LIBDIR}/spec/unit/payload_spec.rb
47${GEM_LIBDIR}/spec/unit/raw_response_spec.rb 56${GEM_LIBDIR}/spec/unit/raw_response_spec.rb
48${GEM_LIBDIR}/spec/unit/request2_spec.rb 57${GEM_LIBDIR}/spec/unit/request2_spec.rb
49${GEM_LIBDIR}/spec/unit/request_spec.rb 58${GEM_LIBDIR}/spec/unit/request_spec.rb
50${GEM_LIBDIR}/spec/unit/resource_spec.rb 59${GEM_LIBDIR}/spec/unit/resource_spec.rb
51${GEM_LIBDIR}/spec/unit/response_spec.rb 60${GEM_LIBDIR}/spec/unit/response_spec.rb
52${GEM_LIBDIR}/spec/unit/restclient_spec.rb 61${GEM_LIBDIR}/spec/unit/restclient_spec.rb
 62${GEM_LIBDIR}/spec/unit/utils_spec.rb
53${GEM_LIBDIR}/spec/unit/windows/root_certs_spec.rb 63${GEM_LIBDIR}/spec/unit/windows/root_certs_spec.rb
54${GEM_HOME}/specifications/${GEM_NAME}.gemspec 64${GEM_HOME}/specifications/${GEM_NAME}.gemspec