From 8c01f348adb3f6d55f50fcd6406554e8f163436e Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Wed, 9 Apr 2025 14:56:06 +0200 Subject: [PATCH 1/8] feat: setup for 0.29 --- .ruby-version | 2 +- Gemfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ruby-version b/.ruby-version index 860487c..be94e6f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.1 +3.2.2 diff --git a/Gemfile b/Gemfile index b27fa89..4e5ebff 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gemspec group :test do gem "byebug" - gem "rack", ">= 1.6.2" + gem "rack", "~> 2.2" gem "rack-test" - gem "rspec", "~> 3.0" + gem "rspec", "~> 3.1" end From bb24cc6c8acd9ef45043d52d4ed86318c16f04b4 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Wed, 9 Apr 2025 14:56:35 +0200 Subject: [PATCH 2/8] feat: update gemspec --- omniauth-publik.gemspec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/omniauth-publik.gemspec b/omniauth-publik.gemspec index 1d3bd39..1063100 100644 --- a/omniauth-publik.gemspec +++ b/omniauth-publik.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.summary = "OmniAuth strategy for Publik" spec.description = "OmniAuth strategy for Publik" spec.homepage = "https://github.com/OpenSourcePolitics/omniauth-publik" - spec.required_ruby_version = ">= 2.7" + spec.required_ruby_version = ">= 3.2" spec.files = `git ls-files -z`.split("\x0").reject do |f| f.match(%r{^(test|spec|features)/}) end @@ -21,11 +21,11 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "omniauth", "~> 2.0" + spec.add_dependency "omniauth", "~> 2.1" spec.add_dependency "omniauth-oauth2", ">= 1.7.2", "< 2.0" - spec.add_development_dependency "bundler", "~> 2.3.4" - spec.add_development_dependency "rake", "~> 13.0" - spec.add_development_dependency "rubocop", "1.23" + spec.add_development_dependency "bundler", ">= 2.4" + spec.add_development_dependency "rake", "~> 13.2" + spec.add_development_dependency "rubocop", "~> 1.69" spec.add_development_dependency "rubocop-rspec" spec.metadata["rubygems_mfa_required"] = "true" end From 2a42d5a2e19323f57798f6ca419d11f4f5e62181 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Wed, 9 Apr 2025 14:56:57 +0200 Subject: [PATCH 3/8] ci: update ci --- .github/workflows/lint_code.yml | 2 +- .github/workflows/tests.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint_code.yml b/.github/workflows/lint_code.yml index 2c857da..0ca67c3 100644 --- a/.github/workflows/lint_code.yml +++ b/.github/workflows/lint_code.yml @@ -13,7 +13,7 @@ jobs: if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/checkout@v2.0.0 + - uses: actions/checkout@v3 with: fetch-depth: 1 - uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f1c7b7..45b798f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,13 +13,13 @@ jobs: if: "github.ref != 'refs/heads/master' || github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/checkout@v2.0.0 + - uses: actions/checkout@v3 with: fetch-depth: 1 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true - - uses: nanasess/setup-chromedriver@v1.0.1 + - uses: nanasess/setup-chromedriver@v2 - run: bundle exec rspec name: RSpec From a83a53b8a0d4b9b928677bbf181da05b68cba6a7 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Wed, 9 Apr 2025 14:57:32 +0200 Subject: [PATCH 4/8] test: update test file --- spec/omniauth/strategies/publik_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/omniauth/strategies/publik_spec.rb b/spec/omniauth/strategies/publik_spec.rb index 117e459..66aa445 100644 --- a/spec/omniauth/strategies/publik_spec.rb +++ b/spec/omniauth/strategies/publik_spec.rb @@ -62,7 +62,7 @@ let(:client_site) { "http : // example.com" } it "raises an ArgumentError" do - expect { subject.client.site }.to raise_error(URI::InvalidURIError, "bad URI(is not URI?): \"http : // example.com\"") + expect { subject.client.site }.to raise_error(URI::InvalidURIError, "bad URI (is not URI?): \"http : // example.com\"") end it "can't define authorize url" do From b1e452a589008e22b6c762ebf184507a5c249f9e Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Thu, 10 Apr 2025 11:51:11 +0200 Subject: [PATCH 5/8] ci: update ruby version --- .github/workflows/lint_code.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint_code.yml b/.github/workflows/lint_code.yml index 0ca67c3..7a65c96 100644 --- a/.github/workflows/lint_code.yml +++ b/.github/workflows/lint_code.yml @@ -2,7 +2,7 @@ name: "[CI] Lint" on: "push" env: - RUBY_VERSION: 2.7.1 + RUBY_VERSION: 3.2.2 jobs: lint: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 45b798f..e9cc95a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,7 @@ name: Tests on: "push" env: - RUBY_VERSION: 2.7.1 + RUBY_VERSION: 3.2.2 jobs: tests: From 12d4ba354ce88f1051dc33db34d5324ed9eef2dc Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Thu, 10 Apr 2025 14:08:13 +0200 Subject: [PATCH 6/8] chore: update rubocop yml file --- .rubocop.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index e72c634..ac83931 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,5 @@ -require: +plugins: - rubocop-rspec - # Common configuration. AllCops: # Default formatter will be used if no -f/--format option is given. @@ -1217,11 +1216,11 @@ RSpec/LeakyConstantDeclaration: RSpec/DescribedClass: Enabled: false -RSpec/FilePath: +RSpec/SpecFilePathFormat: Exclude: - "spec/omniauth/strategies/publik_spec.rb" # This is the default configuration file. RSpec/VerifiedDoubleReference: Exclude: - - "spec/omniauth/strategies/publik_spec.rb" \ No newline at end of file + - "spec/omniauth/strategies/publik_spec.rb" From 5972b4206738861e327d62fd0935539b9dc7534f Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Thu, 10 Apr 2025 14:21:05 +0200 Subject: [PATCH 7/8] fix: update TargetRubyVersion --- .rubocop.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index ac83931..a20f336 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -52,7 +52,7 @@ AllCops: # If a value is specified for TargetRubyVersion then it is used. # Else if .ruby-version exists and it contains an MRI version it is used. # Otherwise we fallback to the oldest officially supported Ruby version (2.0). - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.2.2 SuggestExtensions: false RSpec: @@ -1217,6 +1217,7 @@ RSpec/DescribedClass: Enabled: false RSpec/SpecFilePathFormat: + Enabled: true Exclude: - "spec/omniauth/strategies/publik_spec.rb" # This is the default configuration file. From 3bec74589e5a1c97a1529edfc20bfb61666021a8 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Thu, 10 Apr 2025 14:21:20 +0200 Subject: [PATCH 8/8] style: update with rubocop --- omniauth-publik.gemspec | 3 ++- spec/omniauth/strategies/publik_spec.rb | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/omniauth-publik.gemspec b/omniauth-publik.gemspec index 1063100..54ef4ec 100644 --- a/omniauth-publik.gemspec +++ b/omniauth-publik.gemspec @@ -20,12 +20,13 @@ Gem::Specification.new do |spec| spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - + # rubocop:disable Gemspec/DevelopmentDependencies spec.add_dependency "omniauth", "~> 2.1" spec.add_dependency "omniauth-oauth2", ">= 1.7.2", "< 2.0" spec.add_development_dependency "bundler", ">= 2.4" spec.add_development_dependency "rake", "~> 13.2" spec.add_development_dependency "rubocop", "~> 1.69" spec.add_development_dependency "rubocop-rspec" + # rubocop:enable Gemspec/DevelopmentDependencies spec.metadata["rubygems_mfa_required"] = "true" end diff --git a/spec/omniauth/strategies/publik_spec.rb b/spec/omniauth/strategies/publik_spec.rb index 66aa445..4df9ba0 100644 --- a/spec/omniauth/strategies/publik_spec.rb +++ b/spec/omniauth/strategies/publik_spec.rb @@ -85,8 +85,7 @@ describe "#callback_url" do before do - allow(strategy).to receive(:full_host).and_return("https://example.com") - allow(strategy).to receive(:script_name).and_return("/sub_uri") + allow(strategy).to receive_messages(full_host: "https://example.com", script_name: "/sub_uri") end it "is a combination of host, script name, and callback path" do