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

Changed bahavior upgrading from 0.8.0 to 0.8.1 #303

Open
tilo opened this issue Mar 23, 2024 · 6 comments
Open

Changed bahavior upgrading from 0.8.0 to 0.8.1 #303

tilo opened this issue Mar 23, 2024 · 6 comments

Comments

@tilo
Copy link

tilo commented Mar 23, 2024

looks like the API for PhoneLib changed from version 0.8.0 to 0.8.1

before you could do this:

phone = Phonelib.parse(phone_number, ["US", "CA"])

now you have to do this:

phone = nil
phone ||= Phonelib.parse(phone_number, "US")
phone ||= Phonelib.parse(phone_number, "CA")
  • such a change in behavior should be caught by failing tests in PhoneLib
    -> there was no test coverage
  • any change in behavior should rev-up more than just the last digit of the version
    -> see https://semver.org/
@tilo
Copy link
Author

tilo commented Jun 27, 2024

@daddyz did you see this?

@daddyz
Copy link
Owner

daddyz commented Jul 17, 2024

@tilo interesting undocumented behavior. I never saw that method being used like that, it's not documented and not tested. I tried it locally on 0.8.9 and it works. Can you specify your ruby version?

@tilo
Copy link
Author

tilo commented Jul 17, 2024

@tilo interesting undocumented behavior. I never saw that method being used like that, it's not documented and not tested. I tried it locally on 0.8.9 and it works. Can you specify your ruby version?

@daddyz we're using Ruby 3.2.2

@daddyz
Copy link
Owner

daddyz commented Jul 17, 2024

@tilo can you test latest version?

@daddyz
Copy link
Owner

daddyz commented Jul 17, 2024

regardless, there is a configuration option that allows several countries:

Phonelib.default_country = ['US', 'CA']
phone = Phonelib.parse(phone_number)

daddyz added a commit that referenced this issue Jul 17, 2024
@daddyz
Copy link
Owner

daddyz commented Jul 17, 2024

@tilo check version 0.9.1, I saw this happening for possible numbers only, with valid numbers it was working properly

daddyz added a commit that referenced this issue Jul 17, 2024
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

2 participants