Skip to content

Commit 1aa3cd6

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

Some content is hidden

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

62 files changed

+53
-219
lines changed

.github/workflows/main.yml

+6-2
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"]
24+
ruby: ["3.1", "3.2", "3.3"]
2525
redis-version: [4, 5, 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

+2-2

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

test/rails7_dummy/config/coverband.rb

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
# frozen_string_literal: true
22

3-
require_relative "../../rails5_dummy/config/coverband"
3+
Coverband.configure do |config|
4+
# NOTE: we reuse this config in each of the fake rails projects
5+
# the below ensures the root is set to the correct fake project
6+
config.root = ::File.expand_path("../../../", __FILE__).to_s + "/rails#{Rails::VERSION::MAJOR}_dummy"
7+
config.store = Coverband::Adapters::RedisStore.new(Redis.new(db: 2, url: ENV["REDIS_URL"]), redis_namespace: "coverband_test") if defined? Redis
8+
config.ignore = %w[.erb$ .slim$]
9+
config.root_paths = []
10+
config.logger = Rails.logger
11+
config.verbose = true
12+
config.background_reporting_enabled = true
13+
config.track_routes = true
14+
config.use_oneshot_lines_coverage = true if ENV["ONESHOT"]
15+
end
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
# frozen_string_literal: true
22

3-
require_relative "../../rails5_dummy/config/coverband_missing_redis"
3+
Coverband.configure do |config|
4+
config.root = Dir.pwd
5+
config.store = Coverband::Adapters::RedisStore.new(Redis.new(db: 2, url: "redis://127.0.0.1:123"), redis_namespace: "coverband_test") if defined? Redis
6+
config.ignore = %w[vendor .erb$ .slim$]
7+
config.root_paths = []
8+
config.logger = Rails.logger
9+
config.verbose = true
10+
config.background_reporting_enabled = true
11+
config.track_gems = true
12+
config.gem_details = true
13+
config.use_oneshot_lines_coverage = true if ENV["ONESHOT"]
14+
end
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)