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

"999" can no longer be normalized #219

Closed
baxter opened this issue Jan 16, 2015 · 6 comments
Closed

"999" can no longer be normalized #219

baxter opened this issue Jan 16, 2015 · 6 comments

Comments

@baxter
Copy link
Contributor

@baxter baxter commented Jan 16, 2015

Hi there, I'm not sure if this is a bug or not. The emergency number '999' seems to behave differently to the emergency number '911' when passed through normalize.

> ruby -e 'require "./lib/phony"; puts Phony.normalize("911")'
911
> ruby -e 'require "./lib/phony"; puts Phony.normalize("999")'
/Users/baxter/Code/phony/lib/phony.rb:102:in `rescue in normalize!': Phony could not normalize the given number. Is it a phone number? (Phony::NormalizationError)
    from /Users/baxter/Code/phony/lib/phony.rb:100:in `normalize!'
    from /Users/baxter/Code/phony/lib/phony.rb:97:in `normalize'
    from -e:1:in `<main>'

Running this through git bisect, it appears that this is the first commit where this fails: 9b4234a

Is this a bug or is it expected behaviour?

Thanks very much,

Paul.

@floere
Copy link
Owner

@floere floere commented Jan 16, 2015

Phony handles only international numbers. See the README for more info. Cheers!

On Fri, Jan 16, 2015 at 3:11 PM, Paul Boxley notifications@github.com
wrote:

Hi there, I'm not sure if this is a bug or not. The emergency number '999' seems to behave differently to the emergency number '911' when passed through normalize.

> ruby -e 'require "./lib/phony"; puts Phony.normalize("911")'
911
> ruby -e 'require "./lib/phony"; puts Phony.normalize("999")'
/Users/baxter/Code/phony/lib/phony.rb:102:in `rescue in normalize!': Phony could not normalize the given number. Is it a phone number? (Phony::NormalizationError)
  from /Users/baxter/Code/phony/lib/phony.rb:100:in `normalize!'
  from /Users/baxter/Code/phony/lib/phony.rb:97:in `normalize'
  from -e:1:in `<main>'

Running this through git bisect, it appears that this is the first commit where this fails: 9b4234a
Thanks very much,

Paul.

Reply to this email directly or view it on GitHub:
#219

@baxter
Copy link
Contributor Author

@baxter baxter commented Jan 16, 2015

Ok @floere, thanks for your response :)

Just out of interest, does this mean the behaviour for "911" is going to change as well?

@floere
Copy link
Owner

@floere floere commented Jan 16, 2015

What Phony does if you give it "911" is that it checks first which country it is, and then gives the remaining number to that country to split. 91 is India, so it hands the 1 to India. So a number like 911 is always handled however the country handles it. Cheers!

On Fri, Jan 16, 2015 at 3:28 PM, Paul Boxley notifications@github.com
wrote:

Ok @floere, thanks for your response :)

Just out of interest, does this mean the behaviour for "911" is going to change as well?

Reply to this email directly or view it on GitHub:
#219 (comment)

@floere
Copy link
Owner

@floere floere commented Jan 16, 2015

That's a "possibly, yes".

On Fri, Jan 16, 2015 at 3:28 PM, Paul Boxley notifications@github.com
wrote:

Ok @floere, thanks for your response :)

Just out of interest, does this mean the behaviour for "911" is going to change as well?

Reply to this email directly or view it on GitHub:
#219 (comment)

@floere floere closed this Jan 23, 2015
@baxter
Copy link
Contributor Author

@baxter baxter commented Jan 25, 2015

That makes perfect sense, thanks very much @floere 😄

@floere
Copy link
Owner

@floere floere commented Jan 25, 2015

My pleasure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.