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
version: add empty? method #7846
Conversation
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.
Looks good to me!
Actually: missed this. I'm OK with this rare case but in general: we should not be adding Homebrew/brew code to support |
Though adding I don't think I'm properly understanding your meaning, so please correct me if I'm not grasping it. My intention isn't to debate your point here but simply to make sure I'm understanding you correctly, so I don't go against your expressed guideline. If " The refactoring mentioned above ( Sorry if I've misunderstood your meaning here and needlessly volunteered this information. |
Yup, knew this and it's great 👏 👍. Just making the point that, for future changes like this, it'd probably be best to make them in homebrew-livecheck and then port them over when it's merged in. |
Thanks for explaining. That makes total sense to me and I've already been planning to take that approach in some upcoming changes. The final PR for the I discussed this with Nanda not too long ago and decided that we should just include any changes that need to be added into the |
brew style
with your changes locally?brew tests
with your changes locally?In livecheck, we currently have some code that compares a given
Version
to an empty version like this:It was suggested that we could refactor this to the following instead:
The goal here is to check if a
Version
is empty, so I figured it would be ideal if we could just doversion.empty?
. If this isn't an appropriate addition, I'm fine with closing this but I thought there may be some value here (i.e., not having to allocate an extra string just to useempty?
).Otherwise, if there are more appropriate locations for the code additions in
version.rb
andversion_spec.rb
, please let me know and I'll update this.Edit: I had originally added both
blank?
andempty?
methods but I learned that if you addempty?
you automatically getblank?
for free, so I updated this accordingly.