Skip to content

Commit 9c9f1ea

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 edcb62b commit 9c9f1ea

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
@@ -6,6 +6,7 @@
66
require "time"
77

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

0 commit comments

Comments
 (0)