Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version check load order issue #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Earlopain
Copy link
Contributor

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant