Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IE-962] Bump dependency to allow faraday 2 releases #22

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/qualtrics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
require 'open-uri'
require 'virtus'
require "faraday"
require "faraday_middleware"
require "faraday/follow_redirects"
require "faraday/multipart"
Comment on lines +8 to +9
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 These middleware were split into their own gems


require "qualtrics_api/version"
require "qualtrics_api/request_error_handler"
Expand Down
3 changes: 2 additions & 1 deletion lib/qualtrics_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ def establish_connection(api_token, data_center_id)
Faraday.new(url: QualtricsAPI.url(data_center_id), headers: { "X-API-TOKEN" => api_token }.merge(custom_headers)) do |faraday|
faraday.request :multipart
faraday.request :json

faraday.response :json, :content_type => /\bjson$/
faraday.response :follow_redirects

faraday.use FaradayMiddleware::FollowRedirects
faraday.use QualtricsAPI::RequestErrorHandler

faraday.adapter Faraday.default_adapter
Expand Down
2 changes: 1 addition & 1 deletion lib/qualtrics_api/request_error_handler.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'logger'

module QualtricsAPI
class RequestErrorHandler < Faraday::Response::Middleware
class RequestErrorHandler < Faraday::Middleware
HTTP_RESPONSE_ERROR_RANGE = 400..599

def on_complete(env)
Expand Down
2 changes: 1 addition & 1 deletion lib/qualtrics_api/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module QualtricsAPI
VERSION = "0.1.1".freeze
VERSION = "0.2.0".freeze
end
11 changes: 6 additions & 5 deletions qualtrics_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.required_ruby_version = '>= 3.0.6'
spec.required_ruby_version = ">= 3.0.6"

spec.add_dependency "activesupport", "~> 6.1.7.6"
spec.add_dependency "faraday", ">= 0.13.1"
spec.add_dependency "faraday_middleware", ">= 0.12.2"
spec.add_dependency "activesupport", "~> 6.1"
spec.add_dependency "faraday", "~> 2"
spec.add_dependency "faraday-follow_redirects", "~> 0.3"
spec.add_dependency "faraday-multipart", "~> 1.1"
spec.add_dependency "virtus", ">= 1.0"

spec.add_development_dependency "bundler", "~> 2.2.0"
spec.add_development_dependency "bundler", "~> 2.2"
spec.add_development_dependency "rake", "~> 12.3"
spec.add_development_dependency "rspec", "~> 3.7"
spec.add_development_dependency "vcr", "~> 3.0"
Expand Down
Loading