hyperclient 0.9.1 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +12 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +9 -0
- data/Gemfile +1 -1
- data/README.md +0 -1
- data/hyperclient.gemspec +1 -1
- data/lib/hyperclient/entry_point.rb +5 -3
- data/lib/hyperclient/link_collection.rb +3 -1
- data/lib/hyperclient/resource.rb +3 -1
- data/lib/hyperclient/resource_collection.rb +3 -1
- data/lib/hyperclient/version.rb +1 -1
- data/test/hyperclient/entry_point_test.rb +8 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30a6a424eb3f9cd9a70b19d49f3f9d3f3b952921fb6a2b034116296c7eb1e31f
|
4
|
+
data.tar.gz: b35c0cd0abaa39753b53f59c0f718152acf3a8915b498d0acef4e7b8f2f0d82c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93c51dca3fa731081e1e82540d0c0f2d22f17e65ae336021b4b7199eac4ff1eecd3bd37e840cc02831e2d62b98d20a4a1e696dd5fba8bdd5ff51516f6bc763b6
|
7
|
+
data.tar.gz: 9a2ad7090c37531384d42105754bc4d492ba711048d758b042863e43a43612317007d8446c02ad0efc88e09f95f6f5cdbb48239319724e1c2f35862f2ad92dcc
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2020-05-10 19:37:12 -0400 using RuboCop version 0.81.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -11,7 +11,7 @@
|
|
11
11
|
Metrics/ClassLength:
|
12
12
|
Max: 103
|
13
13
|
|
14
|
-
# Offense count:
|
14
|
+
# Offense count: 4
|
15
15
|
# Configuration parameters: CountComments, ExcludedMethods.
|
16
16
|
Metrics/MethodLength:
|
17
17
|
Max: 25
|
@@ -46,14 +46,22 @@ Style/DoubleNegation:
|
|
46
46
|
- 'lib/hyperclient/curie.rb'
|
47
47
|
- 'lib/hyperclient/link.rb'
|
48
48
|
|
49
|
+
# Offense count: 3
|
50
|
+
# Cop supports --auto-correct.
|
51
|
+
Style/IfUnlessModifier:
|
52
|
+
Exclude:
|
53
|
+
- 'lib/hyperclient/link_collection.rb'
|
54
|
+
- 'lib/hyperclient/resource.rb'
|
55
|
+
- 'lib/hyperclient/resource_collection.rb'
|
56
|
+
|
49
57
|
# Offense count: 1
|
50
58
|
Style/MethodMissingSuper:
|
51
59
|
Exclude:
|
52
60
|
- 'lib/hyperclient/collection.rb'
|
53
61
|
|
54
|
-
# Offense count:
|
62
|
+
# Offense count: 91
|
55
63
|
# Cop supports --auto-correct.
|
56
64
|
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
57
65
|
# URISchemes: http, https
|
58
|
-
|
66
|
+
Layout/LineLength:
|
59
67
|
Max: 142
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
## Changelog
|
2
2
|
|
3
|
+
### 0.9.3 (2020/05/14)
|
4
|
+
|
5
|
+
* [#149](https://github.com/codegram/hyperclient/pull/149): Address Faraday warnings - [@yuki24](https://github.com/yuki24).
|
6
|
+
* [#160](https://github.com/codegram/hyperclient/pull/160): Require newer 'faraday-digestauth' - [@dblock](https://github.com/dblock).
|
7
|
+
|
8
|
+
### 0.9.2 (2020/05/12)
|
9
|
+
|
10
|
+
* NOTE: **⚠ This version has been yanked ⚠** - [@dblock](https://github.com/dblock).
|
11
|
+
|
3
12
|
### 0.9.1 (2019/08/25)
|
4
13
|
|
5
14
|
* NOTE: **⚠ This version is no longer tested with Ruby < 2.3 ⚠** - [@ivoanjo](https://github.com/ivoanjo).
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](http://img.shields.io/gem/v/hyperclient.svg)](http://badge.fury.io/rb/hyperclient)
|
4
4
|
[![Build Status](http://img.shields.io/travis/codegram/hyperclient.svg)](https://travis-ci.org/codegram/hyperclient)
|
5
|
-
[![Dependency Status](https://gemnasium.com/codegram/hyperclient.svg)](https://gemnasium.com/codegram/hyperclient)
|
6
5
|
[![Code Climate](https://codeclimate.com/github/codegram/hyperclient.svg)](https://codeclimate.com/github/codegram/hyperclient)
|
7
6
|
[![Coverage Status](https://img.shields.io/coveralls/codegram/hyperclient.svg)](https://coveralls.io/r/codegram/hyperclient?branch=master)
|
8
7
|
|
data/hyperclient.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
|
16
16
|
gem.add_dependency 'addressable'
|
17
17
|
gem.add_dependency 'faraday', '>= 0.9.0'
|
18
|
-
gem.add_dependency 'faraday-digestauth'
|
18
|
+
gem.add_dependency 'faraday-digestauth', '>= 0.3.0'
|
19
19
|
gem.add_dependency 'faraday_hal_middleware'
|
20
20
|
gem.add_dependency 'faraday_middleware'
|
21
21
|
gem.add_dependency 'net-http-digest_auth'
|
@@ -62,8 +62,7 @@ module Hyperclient
|
|
62
62
|
block
|
63
63
|
else
|
64
64
|
lambda do |conn|
|
65
|
-
default_faraday_block.call
|
66
|
-
yield conn
|
65
|
+
default_faraday_block.call(conn, &block)
|
67
66
|
end
|
68
67
|
end
|
69
68
|
else
|
@@ -138,11 +137,14 @@ module Hyperclient
|
|
138
137
|
#
|
139
138
|
# Returns a block.
|
140
139
|
def default_faraday_block
|
141
|
-
lambda do |connection|
|
140
|
+
lambda do |connection, &block|
|
142
141
|
connection.use Faraday::Response::RaiseError
|
143
142
|
connection.use FaradayMiddleware::FollowRedirects
|
144
143
|
connection.request :hal_json
|
145
144
|
connection.response :hal_json, content_type: /\bjson$/
|
145
|
+
|
146
|
+
block&.call(connection)
|
147
|
+
|
146
148
|
connection.adapter :net_http
|
147
149
|
connection.options.params_encoder = Faraday::FlatParamsEncoder
|
148
150
|
end
|
@@ -15,7 +15,9 @@ module Hyperclient
|
|
15
15
|
# curies - The Hash with link curies.
|
16
16
|
# entry_point - The EntryPoint object to inject the configuration.
|
17
17
|
def initialize(collection, curies, entry_point)
|
18
|
-
|
18
|
+
if collection && !collection.respond_to?(:collect)
|
19
|
+
raise "Invalid response for LinkCollection. The response was: #{collection.inspect}"
|
20
|
+
end
|
19
21
|
|
20
22
|
@_curies = (curies || {}).reduce({}) do |hash, curie_hash|
|
21
23
|
curie = build_curie(curie_hash, entry_point)
|
data/lib/hyperclient/resource.rb
CHANGED
@@ -111,7 +111,9 @@ module Hyperclient
|
|
111
111
|
elsif !Array.method_defined?(method)
|
112
112
|
%i[_attributes _embedded _links].each do |target|
|
113
113
|
target = send(target)
|
114
|
-
|
114
|
+
if target.respond_to?(method.to_s)
|
115
|
+
return target.send(method, *args, &block)
|
116
|
+
end
|
115
117
|
end
|
116
118
|
super
|
117
119
|
end
|
@@ -23,7 +23,9 @@ module Hyperclient
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def build_resource(representation)
|
26
|
-
|
26
|
+
if representation.is_a?(Array)
|
27
|
+
return representation.map(&method(:build_resource))
|
28
|
+
end
|
27
29
|
|
28
30
|
Resource.new(representation, @entry_point)
|
29
31
|
end
|
data/lib/hyperclient/version.rb
CHANGED
@@ -26,7 +26,14 @@ module Hyperclient
|
|
26
26
|
|
27
27
|
it 'can insert additional middleware after a connection has been constructed' do
|
28
28
|
entry_point.connection.must_be_kind_of Faraday::Connection
|
29
|
-
|
29
|
+
|
30
|
+
warning = 'WARNING: Unexpected middleware set after the adapter. ' \
|
31
|
+
"This won't be supported from Faraday 1.0.\n"
|
32
|
+
|
33
|
+
assert_output nil, warning do
|
34
|
+
entry_point.connection.use :instrumentation
|
35
|
+
end
|
36
|
+
|
30
37
|
handlers = entry_point.connection.builder.handlers
|
31
38
|
handlers.must_include FaradayMiddleware::Instrumentation
|
32
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oriol Gual
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.3.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.3.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: faraday_hal_middleware
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
- !ruby/object:Gem::Version
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
|
-
rubygems_version: 3.
|
171
|
+
rubygems_version: 3.1.3
|
172
172
|
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: ''
|