Skip to content

Commit

Permalink
Run rubocop autocorrects
Browse files Browse the repository at this point in the history
  • Loading branch information
george-ma committed Apr 3, 2024
1 parent a431854 commit d8d28cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/buildkit/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def paginate(method, path, data, options = {})
response.concat @last_response.data

break if @last_response.headers[:link].nil?

link_header = parse_link_header(@last_response.headers[:link])
break if link_header[:next].nil?

Expand All @@ -170,7 +171,7 @@ def sawyer_agent
http.headers[:accept] = 'application/json'
http.headers[:content_type] = 'application/json'
http.headers[:user_agent] = "Buildkit v#{Buildkit::VERSION}"
if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new("1.7.1")
if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('1.7.1')
http.request :authorization, 'Bearer', @token
else
http.authorization 'Bearer', @token
Expand All @@ -194,7 +195,7 @@ def parse_query_and_convenience_headers(options)
end
query = options.delete(:query)
opts = {query: options}
opts[:query].merge!(query) if query&.is_a?(Hash)
opts[:query].merge!(query) if query.is_a?(Hash)
opts[:headers] = headers unless headers.empty?

opts
Expand Down
2 changes: 1 addition & 1 deletion lib/buildkit/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def documentation_url
# Array of validation errors
# @return [Array<Hash>] Error info
def errors
if data&.is_a?(Hash)
if data.is_a?(Hash)
data[:errors] || []
else
[]
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module AgentsAccessTokenFilter
def serializable_body(*)
body = super
body['string'].gsub!(/"access_token":\s*"\w+"/, '"access_token": "<<AGENT_ACCESS_TOKEN>>"')
body['string'].gsub!(/"ip_address":\s*"[\d\.]+"/, '"ip_address": "127.0.0.1"')
body['string'].gsub!(/(Commit|Author):\s*([\w\s]+?)\s*<([\w@\.\-]+)>/) do
body['string'].gsub!(/"ip_address":\s*"[\d.]+"/, '"ip_address": "127.0.0.1"')
body['string'].gsub!(/(Commit|Author):\s*([\w\s]+?)\s*<([\w@.-]+)>/) do
"#{$1}: Anonymous <[email protected]>"
end
body
Expand Down

0 comments on commit d8d28cf

Please sign in to comment.