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

ArgumentError on old versions of Chrome #8

Open
qrush opened this issue Aug 2, 2019 · 3 comments
Open

ArgumentError on old versions of Chrome #8

qrush opened this issue Aug 2, 2019 · 3 comments

Comments

@qrush
Copy link

qrush commented Aug 2, 2019

We're using this gem and on the following Chrome 53 UA string:

Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/535.14.61 (KHTML, like Gecko) Chrome/53.5.0289.5916 Safari/534.43

We received the following error:

ArgumentError
53.5.0289 is not a valid SemVer Version (http://semver.org)

It seems that this is definitely an allowable version number. Could I suggest using Gem::Version to parse the version number instead? I also think this gem should define its own exception class if there's a true problem with parsing as well instead of just throwing an ArgumentError, which is very broad and could potentially mask lots of other issues.

@dsalahutdinov
Copy link
Collaborator

dsalahutdinov commented Aug 2, 2019

Hey @qrush , thank for the issue!
The sematic version is used here to match the current version with target version. As I know Gem::Version class do not allow to do it in that way.

I suppose, it would be better to fix the issue by changing the semver regexp here for allowing the browsers format

How do you think are you able to fix the issue by sending PR?

@alaz
Copy link

alaz commented Jan 12, 2020

Same error with UA Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

@calmyournerves
Copy link

SemVer doesn't allow leading zeros, so that change is probably not going to happen in the Semantic gem. And as some browsers don't use SemVer anyways, the current approach doesn't seem future proof. I had a quick look to change the logic to use Gem::Version or Gem::Dependency, but it seems tricky to cover all the current use cases.

Any other ideas?

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

No branches or pull requests

4 participants