Skip to content

Commit

Permalink
Merge pull request #122 from kbrock/faraday-2.0
Browse files Browse the repository at this point in the history
upgrade faraday from 1.0 to 2.0
  • Loading branch information
Fryguy authored Mar 29, 2024
2 parents 0303c15 + e4e8f23 commit 0b53037
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
strategy:
matrix:
ruby-version:
- '2.7'
- '3.0'
- '3.1'
rails-version:
Expand Down
2 changes: 1 addition & 1 deletion lib/manageiq/api/client.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "active_support"
require "active_support/core_ext"
require "faraday"
require "faraday_middleware"
require "faraday/follow_redirects"
require 'forwardable'
require "json"
require "query_relation"
Expand Down
7 changes: 4 additions & 3 deletions lib/manageiq/api/client/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ def handle
faraday.options.open_timeout = @connection_options[:open_timeout] if @connection_options[:open_timeout]
faraday.options.timeout = @connection_options[:timeout] if @connection_options[:timeout]
faraday.response(:logger, client.logger)
faraday.use FaradayMiddleware::FollowRedirects, :limit => 3, :standards_compliant => true
faraday.adapter(Faraday.default_adapter) # make requests with Net::HTTP
faraday.response(:follow_redirects, :limit => 3, :standards_compliant => true)
# make requests with Net::HTTP
faraday.adapter(Faraday.default_adapter)
if authentication.token.blank? && authentication.miqtoken.blank? && authentication.bearer_token.blank?
faraday.basic_auth(authentication.user, authentication.password)
faraday.request(:authorization, :basic, authentication.user, authentication.password)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions manageiq-api-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "activesupport", ">= 6.0", "<7.1"
spec.add_dependency "faraday", "~> 1.0"
spec.add_dependency "faraday_middleware", "~> 1.0"
spec.add_dependency "faraday", "~> 2.9"
spec.add_dependency "faraday-follow_redirects"
spec.add_dependency "json", "~> 2.3"
spec.add_dependency "query_relation"

Expand Down

0 comments on commit 0b53037

Please sign in to comment.