From 12233f400f79bf6ce37fc03ccb7cc0b7cf963575 Mon Sep 17 00:00:00 2001 From: Henrique Medeiros Date: Tue, 14 Oct 2025 11:50:58 -0300 Subject: [PATCH 1/6] Add changelog to report ruby 3.4 compatibility --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5af544c..4cbe885 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [FEATURE: Add Skunk HTML Report](https://github.com/fastruby/skunk/pull/123) * [FEATURE: Add Skunk::Config class](https://github.com/fastruby/skunk/pull/123) +* [FEATURE: Add Ruby 3.4 compatibility](https://github.com/fastruby/skunk/pull/124) ## v0.5.4 / 2025-05-05 [(commits)](https://github.com/fastruby/skunk/compare/v0.5.3...v0.5.4) From c90921fa94e94b969599a06c1fb6f360278e19be Mon Sep 17 00:00:00 2001 From: Henrique Medeiros Date: Tue, 14 Oct 2025 10:30:42 -0300 Subject: [PATCH 2/6] Add ruby 3.4 CI and gem base64 listed --- .github/workflows/main.yml | 4 ++-- skunk.gemspec | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65d20da..7f98f8e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ubuntu] - ruby-version: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"] + ruby-version: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4"] steps: - uses: actions/checkout@v2 - name: Setup Ruby ${{ matrix.ruby-version }} @@ -19,6 +19,6 @@ jobs: bundler-cache: true - name: Build and run tests run: | - gem install bundler -v 2.4.6 + gem install bundler -v 2.4.22 bundle install --jobs 4 --retry 3 bundle exec rake diff --git a/skunk.gemspec b/skunk.gemspec index 732e68b..21524bc 100644 --- a/skunk.gemspec +++ b/skunk.gemspec @@ -38,6 +38,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] + spec.add_dependency "base64" spec.add_dependency "rubycritic", ">= 4.5.2", "< 5.0" spec.add_dependency "terminal-table", "~> 3.0" From cc48f1b5c021051706555115380515f89c41d78f Mon Sep 17 00:00:00 2001 From: Henrique Medeiros Date: Wed, 15 Oct 2025 08:07:31 -0300 Subject: [PATCH 3/6] base64 gemspec constraint --- skunk.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skunk.gemspec b/skunk.gemspec index 21524bc..15d9cf4 100644 --- a/skunk.gemspec +++ b/skunk.gemspec @@ -38,7 +38,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "base64" + spec.add_dependency "base64", "~> 0.3.0" spec.add_dependency "rubycritic", ">= 4.5.2", "< 5.0" spec.add_dependency "terminal-table", "~> 3.0" From c1d9e7b09cbeb3ef51cf5768f9e420a023791f5a Mon Sep 17 00:00:00 2001 From: Henrique Medeiros Date: Fri, 17 Oct 2025 08:14:26 -0300 Subject: [PATCH 4/6] Removing VCR gem --- Gemfile | 1 - skunk.gemspec | 3 +- test/lib/skunk/application_test.rb | 9 +++-- test/samples/vcr/skunk-fyi.yml | 59 ------------------------------ test/test_helper.rb | 7 +--- 5 files changed, 8 insertions(+), 71 deletions(-) delete mode 100644 test/samples/vcr/skunk-fyi.yml diff --git a/Gemfile b/Gemfile index 6412983..52aa166 100644 --- a/Gemfile +++ b/Gemfile @@ -9,4 +9,3 @@ gemspec gem "reek", "~> 6.1" gem "rubocop", "~> 1.48" -gem "vcr", "~> 6.1.0" diff --git a/skunk.gemspec b/skunk.gemspec index 15d9cf4..f68c820 100644 --- a/skunk.gemspec +++ b/skunk.gemspec @@ -38,7 +38,6 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "base64", "~> 0.3.0" spec.add_dependency "rubycritic", ">= 4.5.2", "< 5.0" spec.add_dependency "terminal-table", "~> 3.0" @@ -53,5 +52,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "rubocop" spec.add_development_dependency "simplecov", "~> 0.18" spec.add_development_dependency "simplecov-console", "0.5.0" - spec.add_development_dependency "webmock", "~> 3.10.0" + spec.add_development_dependency "webmock", "~> 3.20.0" end diff --git a/test/lib/skunk/application_test.rb b/test/lib/skunk/application_test.rb index 41e369f..4f24063 100644 --- a/test/lib/skunk/application_test.rb +++ b/test/lib/skunk/application_test.rb @@ -75,9 +75,12 @@ end around do |example| - VCR.use_cassette "skunk-fyi" do - example.call - end + stub_request(:post, "https://skunk.fastruby.io/reports").to_return( + status: 200, + body: '{"id":"j"}', + headers: { "Content-Type" => "application/json" } + ) + example.call end it "share report to default server" do diff --git a/test/samples/vcr/skunk-fyi.yml b/test/samples/vcr/skunk-fyi.yml deleted file mode 100644 index e022369..0000000 --- a/test/samples/vcr/skunk-fyi.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://skunk.fastruby.io/reports - body: - encoding: UTF-8 - string: '{"entries":[{"file":"samples/rubycritic/analysed_module.rb","skunk_score":0.59,"churn_times_cost":0.59,"churn":1,"cost":0.59,"coverage":100.0}],"summary":{"total_skunk_score":0.59,"analysed_modules_count":1,"skunk_score_average":0.59,"skunk_version":"0.4.2","worst_skunk_score":{"file":"samples/rubycritic/analysed_module.rb","skunk_score":0.59}},"options":{"compare":"false"}}' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby - Host: - - skunk.fastruby.io - response: - status: - code: 200 - message: OK - headers: - Server: - - Cowboy - Date: - - Wed, 18 Nov 2020 20:48:58 GMT - Connection: - - keep-alive - X-Frame-Options: - - SAMEORIGIN - X-Xss-Protection: - - 1; mode=block - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - strict-origin-when-cross-origin - Content-Type: - - application/json; charset=utf-8 - Etag: - - W/"510d9374d13d569167428b81cfd4cf0e" - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - b66077d1-4f4c-47a6-8e12-1a6c65898933 - X-Runtime: - - '0.141992' - Transfer-Encoding: - - chunked - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"id":"j"}' - recorded_at: Wed, 18 Nov 2020 20:48:58 GMT -recorded_with: VCR 6.0.0 diff --git a/test/test_helper.rb b/test/test_helper.rb index 838c098..52b16ad 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -26,7 +26,6 @@ require "minitest/around/spec" require "minitest/stub_any_instance" require "webmock/minitest" -require "vcr" require "skunk/rubycritic/analysed_module" @@ -53,8 +52,4 @@ def capture_output_streams $stderr = STDERR end -VCR.configure do |config| - config.hook_into :webmock - config.allow_http_connections_when_no_cassette = false - config.cassette_library_dir = "test/samples/vcr" -end +WebMock.disable_net_connect!(allow_localhost: true) From b8574f9c6704b1031b68b51f52fed681fd99195e Mon Sep 17 00:00:00 2001 From: Henrique Medeiros Date: Fri, 17 Oct 2025 08:20:33 -0300 Subject: [PATCH 5/6] Rubocop regen todo file --- .rubocop_todo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f0b68db..e101f19 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2025-10-09 00:04:06 UTC using RuboCop version 1.81.1. +# on 2025-10-17 11:20:00 UTC using RuboCop version 1.81.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -40,7 +40,7 @@ Metrics/AbcSize: # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. # AllowedMethods: refine Metrics/BlockLength: - Max: 79 + Max: 82 # Offense count: 2 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. From c63f0244ee1cc4b76dd4a822872dc26a67e132c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20V=C3=A1squez?= Date: Fri, 17 Oct 2025 08:41:44 -0600 Subject: [PATCH 6/6] Remove WebMock net connection restriction in test_helper.rb --- test/test_helper.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 52b16ad..1b63517 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -51,5 +51,3 @@ def capture_output_streams $stdout = STDOUT $stderr = STDERR end - -WebMock.disable_net_connect!(allow_localhost: true)