Skip to content

Commit 2698d6c

Browse files
Update rubocop requirement from ~> 0.50.0 to ~> 0.72.0 (codegram#140)
Update rubocop requirement from ~> 0.50.0 to ~> 0.72.0 Co-authored-by: null <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Marc Riera <[email protected]>
2 parents 1c32ac1 + c9c12a3 commit 2698d6c

File tree

9 files changed

+24
-12
lines changed

9 files changed

+24
-12
lines changed

.rubocop.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
inherit_from: .rubocop_todo.yml
22

33
AllCops:
4-
TargetRubyVersion: 2.2
4+
TargetRubyVersion: 2.3
55

66
Metrics/BlockLength:
77
ExcludedMethods: [it, describe]
8+
9+
Style/FrozenStringLiteralComment:
10+
Enabled: false

.rubocop_todo.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ Style/DoubleNegation:
5252
- 'lib/hyperclient/link.rb'
5353

5454
# Offense count: 1
55-
Style/MethodMissing:
55+
Style/MethodMissingSuper:
5656
Exclude:
5757
- 'lib/hyperclient/collection.rb'

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ end
1616

1717
group :development, :test do
1818
gem 'rake'
19-
gem 'rubocop', '~> 0.50.0', require: false
19+
gem 'rubocop', '~> 0.72.0', require: false
2020
gem 'simplecov', require: false
2121
end
2222

Rakefile

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env rake
2+
23
require 'rubygems'
34
require 'bundler'
45
Bundler.setup :default, :test, :development

hyperclient.gemspec

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
require File.expand_path('../lib/hyperclient/version', __FILE__)
1+
require File.expand_path('lib/hyperclient/version', __dir__)
32

43
Gem::Specification.new do |gem|
54
gem.authors = ['Oriol Gual']
@@ -14,10 +13,10 @@ Gem::Specification.new do |gem|
1413
gem.require_paths = ['lib']
1514
gem.version = Hyperclient::VERSION
1615

16+
gem.add_dependency 'addressable'
1717
gem.add_dependency 'faraday', '>= 0.9.0'
18-
gem.add_dependency 'faraday_middleware'
18+
gem.add_dependency 'faraday-digestauth'
1919
gem.add_dependency 'faraday_hal_middleware'
20-
gem.add_dependency 'addressable'
20+
gem.add_dependency 'faraday_middleware'
2121
gem.add_dependency 'net-http-digest_auth'
22-
gem.add_dependency 'faraday-digestauth'
2322
end

lib/hyperclient/curie.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def inspect
4141
# Returns a new expanded url.
4242
def expand(rel)
4343
return rel unless rel && templated?
44-
href.gsub('{rel}', rel) if href
44+
45+
href&.gsub('{rel}', rel)
4546
end
4647
end
4748
end

lib/hyperclient/entry_point.rb

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def connection(options = {}, &block)
5757
@faraday_options ||= options.dup
5858
if block_given?
5959
raise ConnectionAlreadyInitializedError if @connection
60+
6061
@faraday_block = if @faraday_options.delete(:default) == false
6162
block
6263
else
@@ -75,6 +76,7 @@ def connection(options = {}, &block)
7576
# Returns a Hash.
7677
def headers
7778
return @connection.headers if @connection
79+
7880
@headers ||= default_headers
7981
end
8082

@@ -83,6 +85,7 @@ def headers
8385
# value - A Hash containing headers to include with every API request.
8486
def headers=(value)
8587
raise ConnectionAlreadyInitializedError if @connection
88+
8689
@headers = value
8790
end
8891

@@ -98,6 +101,7 @@ def faraday_options
98101
# value - A Hash containing options to pass to Faraday
99102
def faraday_options=(value)
100103
raise ConnectionAlreadyInitializedError if @connection
104+
101105
@faraday_options = value
102106
end
103107

@@ -113,6 +117,7 @@ def faraday_block
113117
# value - A Proc accepting a Faraday::Connection.
114118
def faraday_block=(value)
115119
raise ConnectionAlreadyInitializedError if @connection
120+
116121
@faraday_block = value
117122
end
118123

lib/hyperclient/link.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def _expand(uri_variables = {})
3939
# Public: Returns the url of the Link.
4040
def _url
4141
return @link['href'] unless _templated?
42+
4243
@url ||= _uri_template.expand(@uri_variables || {}).to_s
4344
end
4445

@@ -137,8 +138,10 @@ def method_missing(method, *args, &block)
137138
# This allows `api.posts` instead of `api._links.posts.embedded.posts`
138139
def delegate_method(method, *args, &block)
139140
return unless @key && _resource.respond_to?(@key)
141+
140142
@delegate ||= _resource.send(@key)
141-
return unless @delegate && @delegate.respond_to?(method.to_s)
143+
return unless @delegate&.respond_to?(method.to_s)
144+
142145
@delegate.send(method, *args, &block)
143146
end
144147

lib/hyperclient/resource.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ def inspect
5555
end
5656

5757
def _success?
58-
_response && _response.success?
58+
_response&.success?
5959
end
6060

6161
def _status
62-
_response && _response.status
62+
_response&.status
6363
end
6464

6565
def [](name)

0 commit comments

Comments
 (0)