Skip to content

Commit 5ef4d19

Browse files
committed
Drop support for older rubies, rails and redis
1 parent 08806db commit 5ef4d19

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+57
-223
lines changed

.github/workflows/main.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ jobs:
1919
# truffleruby,
2020
# truffleruby-head,
2121
# removing jruby again to flaky
22-
gemfile: [ Gemfile.rails6.0, Gemfile.rails6.1, Gemfile.rails7.0, Gemfile.rails7.1 ]
22+
gemfile: [ Gemfile.rails7.0, Gemfile.rails7.1, Gemfile.rails7.2, Gemfile.rails8.0 ]
2323
# need to add support for multiple gemfiles
24-
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"]
25-
redis-version: [4, 5, 6, 7]
24+
ruby: ["3.1", "3.2", "3.3"]
25+
redis-version: [6, 7]
26+
exclude:
27+
# Rails 8 requires ruby 3.2+.
28+
- gemfile: 'rails_8.0'
29+
ruby: '3.1'
2630
runs-on: ${{ matrix.os }}-latest
2731
steps:
2832
- uses: actions/checkout@v4

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ temp_results
2424
.env
2525
log/
2626
test/unique_files
27-
test/rails5_dummy/tmp
27+
test/rails7_dummy/tmp

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ require: standard
22

33
inherit_gem:
44
standard:
5-
- config/ruby-2.7.yml
5+
- config/ruby-3.1.yml

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source "https://rubygems.org"
44

55
# Specify your gem's dependencies in coverband.gemspec
66
gemspec
7-
gem "rails", "~>7"
7+
gem "rails" # latest
88
gem "haml"
99
gem "slim"
1010
gem "webrick"

Gemfile.rails6.1

-10
This file was deleted.

Gemfile.rails7 Gemfile.rails7.2

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
44

55
# Specify your gem's dependencies in coverband.gemspec
66
gemspec
7-
gem 'rails', '~>7'
7+
gem 'rails', '~>7.2.0'
88
gem "haml"
99
gem "slim"
10-
gem "webrick"
10+
gem "webrick"

Gemfile.rails6.0 Gemfile.rails8.0

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# frozen_string_literal: true
22

3-
source "https://rubygems.org"
3+
source 'https://rubygems.org'
44

55
# Specify your gem's dependencies in coverband.gemspec
66
gemspec
7-
gem "rails", "~>6.0.0"
7+
gem 'rails', '~>8.0.0'
88
gem "haml"
99
gem "slim"
1010
gem "webrick"

README.md

+3-3

coverband.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
2020
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
2121
spec.require_paths = %w[lib]
2222

23-
spec.required_ruby_version = ">= 2.7"
23+
spec.required_ruby_version = ">= 3.1"
2424

2525
spec.metadata = {
2626
"homepage_uri" => "https://github.com/danmayer/coverband",

lib/coverband/adapters/hash_redis_store.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ def initialize(redis, opts = {})
2525
@save_report_batch_size = opts[:save_report_batch_size] || 100
2626
@format_version = REDIS_STORAGE_FORMAT_VERSION
2727
@redis = redis
28-
raise "HashRedisStore requires redis >= 2.6.0" unless supported?
28+
raise "HashRedisStore requires redis >= 6.0.0" unless supported?
2929

3030
@ttl = opts[:ttl]
3131
@relative_file_converter = opts[:relative_file_converter] || Utils::RelativeFileConverter
3232
end
3333

3434
def supported?
35-
Gem::Version.new(@redis.info["redis_version"]) >= Gem::Version.new("2.6.0")
35+
Gem::Version.new(@redis.info["redis_version"]) >= Gem::Version.new("6.0.0")
3636
rescue Redis::CannotConnectError => e
3737
Coverband.configuration.logger.info "Redis is not available (#{e}), Coverband not configured"
3838
Coverband.configuration.logger.info "If this is a setup task like assets:precompile feel free to ignore"

lib/coverband/collectors/abstract_tracker.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def save_report
109109

110110
# This is the basic rails version supported, if there is something more unique over ride in subclass
111111
def self.supported_version?
112-
defined?(Rails) && defined?(Rails::VERSION) && Rails::VERSION::STRING.split(".").first.to_i >= 5
112+
defined?(Rails::VERSION) && Rails::VERSION::STRING.split(".").first.to_i >= 7
113113
end
114114

115115
def route

lib/coverband/collectors/route_tracker.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class RouteTracker < AbstractTracker
1313
TITLE = "Routes"
1414

1515
def initialize(options = {})
16-
if Rails&.respond_to?(:version) && Gem::Version.new(Rails.version) >= Gem::Version.new("6.0.0") && Gem::Version.new(Rails.version) < Gem::Version.new("7.1.0")
16+
if Rails&.respond_to?(:version) && Gem::Version.new(Rails.version) < Gem::Version.new("7.1.0")
1717
require_relative "../utils/rails6_ext"
1818
end
1919

@@ -52,7 +52,7 @@ def track_key(payload)
5252
end
5353

5454
def self.supported_version?
55-
defined?(Rails) && defined?(Rails::VERSION) && Rails::VERSION::STRING.split(".").first.to_i >= 6
55+
defined?(Rails) && defined?(Rails::VERSION) && Rails::VERSION::STRING.split(".").first.to_i >= 7
5656
end
5757

5858
def unused_keys(used_keys = nil)

lib/coverband/collectors/view_tracker_service.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def save_report
2424
end
2525

2626
def self.supported_version?
27-
defined?(Rails) && defined?(Rails::VERSION) && Rails::VERSION::STRING.split(".").first.to_i >= 4
27+
defined?(Rails::VERSION) && Rails::VERSION::STRING.split(".").first.to_i >= 7
2828
end
2929

3030
private

test/coverband/collectors/coverage_test.rb

-4
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,12 @@ def teardown
7878
end
7979

8080
test "using coverage state idle with ruby >= 3.1.0" do
81-
return unless Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.1.0")
82-
8381
::Coverage.expects(:state).returns(:idle)
8482
::Coverage.expects(:start).with(oneshot_lines: false)
8583
Coverband::Collectors::Coverage.send(:new)
8684
end
8785

8886
test "using coverage state suspended with ruby >= 3.1.0" do
89-
return unless Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.1.0")
90-
9187
::Coverage.expects(:state).returns(:suspended).at_least_once
9288
::Coverage.expects(:resume)
9389
Coverband::Collectors::Coverage.send(:new)

test/rails4_dummy/config/application.rb

-15
This file was deleted.

test/rails4_dummy/config/coverband.rb

-3
This file was deleted.

test/rails4_dummy/config/coverband_missing_redis.rb

-3
This file was deleted.

test/rails5_dummy/Rakefile

-6
This file was deleted.

test/rails5_dummy/app/controllers/dummy_controller.rb

-5
This file was deleted.

test/rails5_dummy/app/controllers/dummy_view_controller.rb

-16
This file was deleted.

test/rails5_dummy/app/views/dummy_view/show.html.erb

-5
This file was deleted.

test/rails5_dummy/app/views/dummy_view/show_haml.html.haml

-4
This file was deleted.

test/rails5_dummy/app/views/dummy_view/show_slim.html.slim

-4
This file was deleted.

test/rails5_dummy/config.ru

-3
This file was deleted.

test/rails5_dummy/config/application.rb

-14
This file was deleted.

test/rails5_dummy/config/coverband.rb

-15
This file was deleted.

test/rails5_dummy/config/coverband_missing_redis.rb

-14
This file was deleted.

test/rails5_dummy/config/environment.rb

-2
This file was deleted.

test/rails5_dummy/config/routes.rb

-7
This file was deleted.

test/rails5_dummy/tmp/.keep

Whitespace-only changes.

test/rails6_dummy/Rakefile

-6
This file was deleted.

test/rails6_dummy/app/controllers/dummy_controller.rb

-5
This file was deleted.

test/rails6_dummy/app/controllers/dummy_view_controller.rb

-16
This file was deleted.

test/rails6_dummy/app/views/dummy_view/show.html.erb

-5
This file was deleted.

test/rails6_dummy/app/views/dummy_view/show_haml.html.haml

-4
This file was deleted.

test/rails6_dummy/app/views/dummy_view/show_slim.html.slim

-4
This file was deleted.

test/rails6_dummy/config.ru

-4
This file was deleted.

test/rails6_dummy/config/boot.rb

-3
This file was deleted.

test/rails6_dummy/config/coverband.rb

-3
This file was deleted.

test/rails6_dummy/config/coverband_missing_redis.rb

-3
This file was deleted.

test/rails6_dummy/config/environment.rb

-5
This file was deleted.

test/rails6_dummy/config/routes.rb

-7
This file was deleted.

test/rails6_dummy/config/secrets.yml

-3
This file was deleted.

test/rails6_dummy/tmp/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)