Skip to content

Commit daee97f

Browse files
committed
Fix version check load order issue
Checking the version causes an error when `simplecov-html` is loaded before `simplecov`: ``` require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "simplecov-html" gem "simplecov" end ``` ``` /home/user/code/simplecov-html/lib/simplecov-html.rb:10:in '<top (required)>': uninitialized constant SimpleCov::VERSION (NameError) major, minor, patch = SimpleCov::VERSION.scan(/\d+/).first(3).map(&:to_i) ^^^^^^^^^ from <internal:/home/user/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/rubygems/core_ext/kernel_require.rb>:37:in 'Kernel#require' ``` I don't think this check is even needed anymore but I'd just leave it in
1 parent 746dab5 commit daee97f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/simplecov-html.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
require "time"
88

99
# Ensure we are using a compatible version of SimpleCov
10+
require "simplecov/version"
1011
major, minor, patch = SimpleCov::VERSION.scan(/\d+/).first(3).map(&:to_i)
1112
if major < 0 || minor < 9 || patch < 0
1213
raise "The version of SimpleCov you are using is too old. " \

0 commit comments

Comments
 (0)