Giter Club home page Giter Club logo

Comments (5)

floere avatar floere commented on August 16, 2024

Hi Ian,

Thanks for the extensive issue report.

This is a bug that was not covered by a test case for the russian area (country code 7). We've fixed it in the latest release.

Returning the string that was passed in sounds good at first, but increases the complexity of expectations on what this method returns. For example, you can suddenly not be sure anymore, if the number has e.g. spaces in it, or a plus at the beginning etc. I'd rather have a user keep these assumptions and do a best effort formatting.

If you do not like my answer and would like to use Phony defensively (your choice entirely), then I suggest using the following code:

def formatted number
  Phony.formatted number rescue number
end

I would like to keep the options open for the user of Phony, on how to handle trouble.

A useful error is always good, I agree – however: If Phony knew what kind of problem it was in the domain of phone numbers, it could handle it already (which it already does in – if I am not gravely mistaken – all cases).

Alright – I'll close this issue since it's resolved from the latest version onwards. Feel free to add another issue if you find one. Or better yet, fix it yourself and send me a pull request. I think it's fun and also rewarding to have your name mentioned in a project that's used by quite a few big names out there.

Important: A quick FYI on the rules on my repositories: Issues without either "thanks" or "please" (or variations thereof) in them undergo a waiting period of 3 days.
2 exceptions:

  • You've been raised by wolves and can prove it by calling me and howling at the moon.
  • You pay me 200$ an hour. We're currently at about 20$.

Cheers,
Florian

from phony.

imoss avatar imoss commented on August 16, 2024

thanks! much appreciated. I will be sure to mind my manners next time :P

from phony.

floere avatar floere commented on August 16, 2024

:)
It's more about: I'm doing this in my free time – and basically the only thing that keeps me going is that it's of use to somebody other than me, and that people are grateful for it. So a "thanks" or "please" is much appreciated from time to time, to explain my quick note above. I hope you don't encounter any more problems. Cheers!

from phony.

imoss avatar imoss commented on August 16, 2024

Well believe me this gem is very much appreciated in the project I'm working on at the moment, trying to bring a legacy system up to speed that has phone numbers formatted in every way you could possibly imagine. It's really been nice to able to sanitize and strip away all the cruft and get everything standardized. Saved me many hours I would guess. I hope that helps :)

-Ian

from phony.

floere avatar floere commented on August 16, 2024

Hey Ian, that is great to hear! Many thanks for your kind words, glad it saved you time :)

from phony.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.