Skip to content

Commit dd01a33

Browse files
committed
Drop support for older rubies, rails and redis
1 parent 204d2d8 commit dd01a33

14 files changed

+24
-36
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

.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
Original file line numberDiff line numberDiff line change
@@ -399,14 +399,14 @@ Outputs:
399399

400400
# Prerequisites
401401

402-
- Coverband 3.0.X+ requires Ruby 2.3+
403-
- Coverband currently requires Redis for production usage
402+
- Ruby 3.1+
403+
- Coverband currently requires Redis 6.0+ for production usage
404404

405405
### Ruby and Rails Version Support
406406

407407
We will match Heroku & Ruby's support lifetime, supporting the last 3 major Ruby releases. For details see [supported runtimes](https://devcenter.heroku.com/articles/ruby-support#supported-runtimes).
408408

409-
For Rails, we will follow the policy of the [Rails team maintenance policy](https://guides.rubyonrails.org/maintenance_policy.html). We officially support the last two major release versions, while providing minimal support (major bugs / security fixes) for an additional version. This means at the moment we primarily target Rails 6.x, 5.x, and will try to keep current functionality working for Rails 4.x but may release new features that do not work on that target.
409+
For Rails, we will follow the policy of the [Rails team maintenance policy](https://guides.rubyonrails.org/maintenance_policy.html). We officially support the last two major release versions, while providing minimal support (major bugs / security fixes) for an additional version. At the moment we primarily target Rails 7.0+.
410410

411411
### JRuby Support
412412

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/test_helper.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
original_verbosity = $VERBOSE
66
$VERBOSE = nil
77

8-
if ENV["SKIP_SIMPLECOV"] || BigDecimal(RUBY_VERSION[0, 3]) >= BigDecimal("3.1")
9-
$SKIP_SIMPLECOV = true
10-
end
8+
$SKIP_SIMPLECOV = true
119

1210
require "rubygems"
1311

0 commit comments

Comments
 (0)