From 688bab49d24b7539c8ae97fdaaddf9988cb1e877 Mon Sep 17 00:00:00 2001 From: Shojiro Yanagisawa Date: Sun, 15 Oct 2023 22:25:04 +0900 Subject: [PATCH] Require Faraday v2 --- CHANGELOG.md | 4 +++- lib/qiita.rb | 1 - qiita.gemspec | 5 ++--- spec/qiita/client_spec.rb | 8 ++++++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2c42af..bf26899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,11 @@ ## Unreleased +- Require Faraday v2 + ## v1.4.0 - Migrate CI/CD platform from Travis CI to GitHub Actions -- Requires Ruby 3.0.0 or higher +- Require Ruby 3.0.0 or higher ## v1.3.5 diff --git a/lib/qiita.rb b/lib/qiita.rb index 8688311..1edc321 100644 --- a/lib/qiita.rb +++ b/lib/qiita.rb @@ -2,7 +2,6 @@ require "active_support/core_ext/string/inflections" require "active_support/core_ext/string/strip" require "faraday" -require "faraday_middleware" require "json" require "rack/utils" require "rainbow" diff --git a/qiita.gemspec b/qiita.gemspec index a1845e0..ee53473 100644 --- a/qiita.gemspec +++ b/qiita.gemspec @@ -16,8 +16,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_dependency "activesupport" - spec.add_dependency "faraday", "~> 0.9" - spec.add_dependency "faraday_middleware" + spec.add_dependency 'faraday', '>= 2', '< 3' spec.add_dependency "rack" spec.add_dependency "rainbow" spec.add_dependency "rouge" @@ -27,5 +26,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "pry" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" - spec.add_development_dependency "webmock", "1.20.4" + spec.add_development_dependency "webmock" end diff --git a/spec/qiita/client_spec.rb b/spec/qiita/client_spec.rb index 2f94279..0e01792 100644 --- a/spec/qiita/client_spec.rb +++ b/spec/qiita/client_spec.rb @@ -341,6 +341,10 @@ def stub_api_request 204 end + let(:response_hash) do + nil + end + include_examples "valid condition" include_examples "sends request with JSON-encoded body" end @@ -362,6 +366,10 @@ def stub_api_request 204 end + let(:response_hash) do + nil + end + include_examples "valid condition" include_examples "sends request with URL query" end