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

More robust version checking #232

Merged
merged 1 commit into from
Dec 13, 2016

Conversation

rudle
Copy link
Collaborator

@rudle rudle commented Dec 13, 2016

We only care about the major version, so we filter out extraneous information.

Fixes #230

I'm not super happy with the ruby regexp API. Any tips to clean up this code would be welcomed.

@ggilder

We only care about the major version, so we filter out extraneous information.
@rudle rudle merged commit 07513d0 into square:master Dec 13, 2016
@rudle rudle deleted the rudle.fix-tmux-version-check branch December 13, 2016 23:04
@ggilder
Copy link

ggilder commented Dec 13, 2016

👍

@ggilder
Copy link

ggilder commented Dec 13, 2016

Idea to simplify: get rid of the regex code. Gem::Dependency already handles this:

Gem::Dependency.new('', '>= 2.1').match?('', '2.2a')
#=> true

So the implementation could just be

def version_match?(requirement, version)
  Gem::Dependency.new('', requirement).match?('', version)
end

@rudle
Copy link
Collaborator Author

rudle commented Dec 13, 2016

PRs welcome

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.

None yet

2 participants