From 943efbe3d1ffa6053ab586990d9ea282810eae2f Mon Sep 17 00:00:00 2001 From: Shojiro Yanagisawa Date: Thu, 28 Sep 2023 12:44:39 +0900 Subject: [PATCH 1/2] Requires Ruby 3.0.0 or higher --- .github/workflows/rspec.yml | 2 +- README.md | 2 +- lib/qiita/client.rb | 3 +-- qiita.gemspec | 2 +- spec/qiita/client_spec.rb | 16 ++++++---------- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 5407641..b072daa 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: - ruby-version: '2.3.1' + ruby-version: '3.0.0' bundler-cache: true - run: gem install bundler -v '< 2.0' - run: bundle install diff --git a/README.md b/README.md index 42ff77b..a14643c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Qiita API v2 client library and CLI tool, written in Ruby. ## Install -Note: requires Ruby 2.0.0 or higher. +Note: requires Ruby 3.0.0 or higher. ```bash gem install qiita diff --git a/lib/qiita/client.rb b/lib/qiita/client.rb index 31e90d6..251916c 100644 --- a/lib/qiita/client.rb +++ b/lib/qiita/client.rb @@ -1,4 +1,3 @@ -require "uri" require "qiita/resource_based_methods" require "qiita/version" @@ -152,7 +151,7 @@ def process(request_method, path, params, headers) Qiita::Response.new( connection.send( request_method, - URI.escape(path), + path, params, headers, ) diff --git a/qiita.gemspec b/qiita.gemspec index ba81bdd..a1845e0 100644 --- a/qiita.gemspec +++ b/qiita.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |spec| spec.add_dependency "rainbow" spec.add_dependency "rouge" spec.add_dependency "slop", "< 4.0.0" - spec.add_development_dependency "bundler", "~> 1.6" + spec.add_development_dependency "bundler", "~> 2.2" spec.add_development_dependency "json_schema" spec.add_development_dependency "pry" spec.add_development_dependency "rake" diff --git a/spec/qiita/client_spec.rb b/spec/qiita/client_spec.rb index f28ca3e..2f94279 100644 --- a/spec/qiita/client_spec.rb +++ b/spec/qiita/client_spec.rb @@ -49,7 +49,7 @@ def stub_api_request end let(:client) do - described_class.new(options) + described_class.new(**options) end let(:options) do @@ -116,11 +116,7 @@ def stub_api_request describe ".new" do subject do - described_class.new(*arguments) - end - - let(:arguments) do - [options] + described_class.new(**options) end let(:options) do @@ -133,9 +129,9 @@ def stub_api_request end end - context "without any arguments" do - let(:arguments) do - [] + context "without any options" do + let(:options) do + {} end include_examples "returns a Qiita::Client" end @@ -281,7 +277,7 @@ def stub_api_request end let(:requested_url) do - "https://#{requested_host}#{URI.escape(path)}" + "https://#{requested_host}#{CGI.escape(path)}" end it "sends request with escaped path" do From 4fe390d34f29bba370bd48df70137c0792cdc145 Mon Sep 17 00:00:00 2001 From: Shojiro Yanagisawa Date: Thu, 28 Sep 2023 12:49:03 +0900 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8676a7..b6ed8c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Unreleased - Migrate CI/CD platform from Travis CI to GitHub Actions +- Requires Ruby 3.0.0 or higher ## v1.3.5