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

Make client version comparable #68

Merged
merged 1 commit into from
Apr 18, 2022
Merged

Conversation

misdoro
Copy link
Contributor

@misdoro misdoro commented Jan 20, 2020

Allow comparing with string versions.
Matching versions with less precision will compare as true.

For example:

> user_agent = UserAgentParser.parse "Mozilla/5.0 (Linux; Android 7.0; SAMSUNG SM-G930T Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/5.0 Chrome/51.0.2704.106 Mobile Safari/537.36"
> user_agent.family
=> "Samsung Internet"
> user_agent.version
=> #<UserAgentParser::Version 5.0>
> user_agent.version >= "5"
=> true
> user_agent.version >= "5.1"
=> false

@misdoro misdoro force-pushed the version_more_or_less branch from ac48430 to 81c08a5 Compare January 20, 2020 19:06
@misdoro misdoro requested a review from wallin January 21, 2020 13:49
@misdoro misdoro force-pushed the version_more_or_less branch from 0a67972 to 324238b Compare May 4, 2021 14:33
@opti opti merged commit addec94 into ua-parser:main Apr 18, 2022
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.

4 participants