Skip to content

Commit

Permalink
Implementação de compatibilidade com Faraday 2 (#37)
Browse files Browse the repository at this point in the history
* [Terraform] Create ".github/pull_request_template.md".

* Implementa compatibilidade com Faraday 2

* Atualiza a versão para 0.0.12

Co-authored-by: deploy <[email protected]>
Co-authored-by: Laerte Guimarães <[email protected]>
  • Loading branch information
3 people authored Mar 28, 2022
1 parent 9ce5750 commit b121e46
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/vindi/connection.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
require 'faraday'
require 'json'
begin
require 'faraday/multipart'
rescue LoadError
end

module Vindi
module Connection
Expand All @@ -11,7 +15,7 @@ def http_client
@http_client = Faraday.new(api_endpoint, connection_options) do |http|
http.request(:multipart)
http.request(:url_encoded)
http.request(:basic_auth, @key, '')
http.set_basic_auth(@key, '')
http.builder.use @middleware
http.adapter(Faraday.default_adapter)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/vindi/response/raise_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Vindi
module Response

# This class raises exceptions based HTTP status codes retuned by the API
class RaiseError < Faraday::Response::Middleware
class RaiseError < Faraday::Middleware

def on_complete(response)
error = Vindi::Error.from_response(response)
Expand Down
2 changes: 1 addition & 1 deletion lib/vindi/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Vindi
VERSION = '0.0.11'
VERSION = '0.0.12'
end
3 changes: 2 additions & 1 deletion vindi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]


spec.add_dependency 'faraday', '~> 1'
spec.add_dependency "faraday", "< 3"
spec.add_development_dependency "faraday-multipart"
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake", "~> 12.3.3"
end

0 comments on commit b121e46

Please sign in to comment.