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

Expose parse_os, parse_device and parse_ua #108

Merged
merged 3 commits into from
Apr 13, 2023

Conversation

daniel-statsig
Copy link
Contributor

@daniel-statsig daniel-statsig commented Apr 4, 2023

I have a use case where I only care about individual parts of the UserAgent. I am looking for performance gains and noticed that multiple regexes are done and the results are not being used.

If it is possible, would you mind exposes these functions as public?

My code that uses the parser is here (https://github.com/statsig-io/ruby-sdk/blob/main/lib/evaluator.rb#L453-L461). I hope this better illustrates what I am attempting to do.

@daniel-statsig
Copy link
Contributor Author

These are actually public in the uap-java library too https://github.com/ua-parser/uap-java/blob/master/src/main/java/ua_parser/Parser.java#L89-L99

Copy link
Collaborator

@opti opti left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution!
Would you mind adding some specs as well to those methods you've made public?

lib/user_agent_parser/parser.rb Show resolved Hide resolved
@daniel-statsig
Copy link
Contributor Author

@opti, I have addressed your feedback. Thank you

@opti opti merged commit 654a3a9 into ua-parser:main Apr 13, 2023
@opti
Copy link
Collaborator

opti commented Apr 13, 2023

Thank you @daniel-statsig, new version v2.15.0 is now released.

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.

2 participants