From 118cc598b2115bba54fc71e2ff8c7181ede24c93 Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Wed, 28 Jun 2023 22:43:55 -0400 Subject: [PATCH 1/6] Test with more modern rubies Configure GitHub Actions to test with more rubies: - "3.0" - "3.1" - "3.2" --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93766f7..a3cee0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: [ubuntu, macos] - ruby: [2.3, 2.4, 2.5, 2.6, 2.7, truffleruby, truffleruby-head] + ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "truffleruby", "truffleruby-head"] runs-on: ${{ matrix.os }}-latest steps: - uses: actions/checkout@v2 From 004cd59bb277945eb2bd004914c06e6dda69a087 Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Sat, 16 Mar 2024 10:53:33 -0400 Subject: [PATCH 2/6] Drop support for ancient rubies --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a3cee0e..2693fac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: [ubuntu, macos] - ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "truffleruby", "truffleruby-head"] + ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "truffleruby", "truffleruby-head"] runs-on: ${{ matrix.os }}-latest steps: - uses: actions/checkout@v2 From 7d36c8fb77320920e94b21954d8b8298a286a3fa Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Sat, 16 Mar 2024 11:05:07 -0400 Subject: [PATCH 3/6] Change reference to Sexp object More modern versions of sexp_processor need to be supported. --- lib/churn/location_mapping.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/churn/location_mapping.rb b/lib/churn/location_mapping.rb index 91305c1..ec0828b 100644 --- a/lib/churn/location_mapping.rb +++ b/lib/churn/location_mapping.rb @@ -30,7 +30,7 @@ def process_class(exp) start_line = exp.line last_line = deep_last_line(exp) name = name if name.is_a?(Symbol) - name = name.values.value if name.is_a?(Sexp) #deals with cases like class Test::Unit::TestCase + name = name.to_a.last if name.is_a?(Sexp) #deals with cases like class Test::Unit::TestCase @current_class = name @klasses_collection[name.to_s] = [] unless @klasses_collection.include?(name) @klasses_collection[name.to_s] << (start_line..last_line) From 3463ced21bc1b2367c93dd64c354f485831bf496 Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Sat, 16 Mar 2024 11:12:47 -0400 Subject: [PATCH 4/6] Bump dependencies to use more modern versions --- churn.gemspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/churn.gemspec b/churn.gemspec index ab680d7..5aa03ee 100644 --- a/churn.gemspec +++ b/churn.gemspec @@ -23,16 +23,16 @@ Gem::Specification.new do |s| s.add_runtime_dependency "main", ">= 0" # TODO: How to replace chronic, or just have less verbose time support s.add_runtime_dependency "chronic", ">= 0.2.3" - s.add_runtime_dependency "sexp_processor", "~> 4.1" + s.add_runtime_dependency "sexp_processor", "~> 4.17" s.add_runtime_dependency "ruby_parser", "~> 3.0" # TODO: Just have clean output and drop hirb s.add_runtime_dependency "hirb", ">= 0" s.add_development_dependency 'pry-byebug' - s.add_development_dependency "minitest", "~> 5.3" + s.add_development_dependency "minitest", "~> 5.22" s.add_development_dependency "test_construct", "~> 2.0.0" s.add_development_dependency "rake", ">= 0" - s.add_development_dependency "mocha", "~> 1.1.0" + s.add_development_dependency "mocha", "~> 2.1.0" s.add_development_dependency "simplecov", ">= 0" s.add_development_dependency "yard", "~> 0.9.20" # NOTE: we haven't been updating the man file, and ronn was used to do that... clean up From 8aea73a57b37a0501ef64799b2cb5bd80727ab3c Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Sat, 16 Mar 2024 11:13:04 -0400 Subject: [PATCH 5/6] Change the way we require mocha/minitest --- test/data/test_helper.rb | 2 +- test/test_helper.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/data/test_helper.rb b/test/data/test_helper.rb index 19aeee9..02df6c7 100644 --- a/test/data/test_helper.rb +++ b/test/data/test_helper.rb @@ -2,7 +2,7 @@ require 'minitest/autorun' require 'shoulda' require 'test_construct' -require 'mocha/mini_test' +require 'mocha/minitest' $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) diff --git a/test/test_helper.rb b/test/test_helper.rb index 3655b81..d4f3e19 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -3,7 +3,7 @@ require 'minitest/autorun' #require 'shoulda' require 'test_construct' -require 'mocha/mini_test' +require 'mocha/minitest' SimpleCov.start do add_filter 'specs/ruby/1.9.1/gems/' @@ -14,7 +14,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'churn/calculator' -Mocha::Configuration.prevent(:stubbing_non_existent_method) +# Mocha::Configuration.prevent(:stubbing_non_existent_method) class Minitest::Test include TestConstruct::Helpers From 5b6b327f264d2423c1f9628ee8d54443e6b2430e Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Sat, 16 Mar 2024 11:19:29 -0400 Subject: [PATCH 6/6] This call is no longer needed --- test/test_helper.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index d4f3e19..b2b59e1 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -14,7 +14,6 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'churn/calculator' -# Mocha::Configuration.prevent(:stubbing_non_existent_method) class Minitest::Test include TestConstruct::Helpers