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

Allow library to be used with frozen-string-literals enabled. #56

Merged
merged 2 commits into from
Jun 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/simplecov-html/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module SimpleCov
module Formatter
class HTMLFormatter
VERSION = "0.10.1"
VERSION = "0.10.1".dup

def VERSION.to_a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, I think I'd rather think the definition of the method on the object itself then going the dup route :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I change things so VERSION returns an object with these methods, plus to_s that returns the full string? Or should VERSION just be a normal string, no monkey-patched methods?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, good question. I think I'd have just added a to_a(string) method as the easiest fix. Design wise I think an object would be best as it could also hold onto the individual parts internally. But it might be a bit of an overkill for this limited use case :D

Imo go with whatever you prefer, both are fine by me :) Thanks a lot! 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaning towards VERSION just being a standard string, and removing all the helper methods. They're not used anywhere in the code from what I could see, so the only downside is it might break things in other libraries… the odds of that, I would hope, are pretty small.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even better :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, in both repos 👍

split(".").map(&:to_i)
Expand Down