-
Notifications
You must be signed in to change notification settings - Fork 553
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
Allow library to be used with frozen-string-literals enabled. #590
Conversation
For the tests to pass, this requires the use of the latest RSpec commits, along with submitted patches to simplecov-html and test-unit: * simplecov-ruby/simplecov-html#56 * test-unit/test-unit#149
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Hello @pat thanks a lot and how are you doing? :D
That's great, thank you a lot! Although I guess I'll wait with running it in the test suite until all other libraries needed for this are released with fixes, but should file a follow up issue for this.
You seem to busy as a bunny supporting this in the ruby eco system, thanks a ton! 🎉
lib/simplecov/version.rb
Outdated
@@ -1,5 +1,5 @@ | |||
module SimpleCov | |||
version = "0.14.1" | |||
version = "0.14.1".dup | |||
|
|||
def version.to_a | |||
split(".").map(&:to_i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, whaaaaaat? I think I'd rather kill this code than introducing the .dup
🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not a fan either. Whatever you'd prefer for simplecov-ruby/simplecov-html#56, I'll do the same here as well.
Hullo @PragTob 👋 - and yes, I guess I have been busy patching all of the things! It's great to see that the latest |
Also, ensure it's always frozen, no matter which version or configuration of Ruby you're using.
Thanks a bunch @pat ! |
0.15.0 (2017-08-14) ([changes](simplecov-ruby/simplecov@v0.14.1...v0.15.0)) ======= ## Enhancements * Ability to use regex filters for removing files from the output. See [#589](simplecov-ruby/simplecov#589) (thanks @jsteel) ## Bugfixes * Fix merging race condition when running tests in parallel and merging them. See [#570](simplecov-ruby/simplecov#570) (thanks @jenseng) * Fix relevant lines for unloaded files - comments, skipped code etc. are correctly classigied as irrelevant. See [#605](simplecov-ruby/simplecov#605) (thanks @odlp) * Allow using simplecov with frozen-string-literals enabled. See [#590](simplecov-ruby/simplecov#590) (thanks @pat) * Make sure Array Filter can use all other filter types. See [#589](simplecov-ruby/simplecov#589) (thanks @jsteel) * Make sure file names use `Simplecov.root` as base avoiding using full absolute project paths. See [#589](simplecov-ruby/simplecov#589) (thanks @jsteel)
These changes ensure that all string literals can be frozen (as per the optional feature in MRI 2.3 and onwards).
I would recommend adding the following to your .travis.yml file to ensure regressions aren't introduced:
This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). However, at this point in time for the tests to pass, you'll need to use the latest RSpec commits, along with submitted patches to simplecov-html, test-unit, and parser (for rubocop):