Code Monkey home page Code Monkey logo

phoney's People

Contributors

dball avatar g1smd avatar haberbyte avatar smudge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

phoney's Issues

UK data, +44.

https://github.com/habermann24/phoney/blob/master/lib/data/regions.yml

This entry for +44 (in both gb and uk):

  • { :type: 0, :min: 13873, :max: 13873, :total_digits: 9, :areacode_length: 5, :areacode_offset: 0, :format: :"XXXXX XXXXXXX XXXX XXXX" }

should be replaced with this:

  • { :type: 0, :min: 13873, :max: 13873, :total_digits: 10, :areacode_length: 5, :areacode_offset: 0, :format: :"XXXXX XXXXX" }

This line is missing from the data:

  • { :type: 0, :min: 19467, :max: 19467, :total_digits: 10, :areacode_length: 5, :areacode_offset: 0, :format: :"XXXXX XXXXX" }

The gb/uk data also does not appear to cater for 9-digit numbers beginning 500 or 800, nor for 7-digit numbers beginning 800 1111 or 845 46 47x.

Numbers in gb/uk beginning 500 are always 9 digits long. Numbers beginning 800 can be 7, 9 or 10 digits long. Numbers beginning 845 can be 7 or 10 digits long. All other numbers beginning 2, 3, 5, 7, 8, 9 are always 10 digits long.

There's also 40 areas in gb/uk where some numbers beginning 1xxx have only 9 digits, not the usual 10 (i.e. there is a mix of 9 and 10 digit numbers within the same area). One area code beginning 16977 also has some 9 digit numbers (those beginning 16977 2xxx and 16977 3xxx) while the rest of the numbers within the area have 10 digits.

http://www.aa-asterisk.org.uk/index.php/Number_format
http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers

I'm also one of the contributors to Google's libphonenumber project.

phoney 0.1.1 require phoney! Clean instalation issue

$ gem install phoney
ERROR: Error installing phoney:
phoney requires phoney (>= 0)

$ gem install phoney -v '=0.1.0'
Fetching: phoney-0.1.0.gem (100%)
Successfully installed phoney-0.1.0
1 gem installed

$ gem install phoney
Successfully installed phoney-0.1.1
1 gem installed

Where is the country data in a human readable format?

I had intended to update the phone number patterns for GB/UK in /lib/data/regions.yml with some recent changes, but the file has been deleted.

I understand the project uses data in the binary file /lib/data/regions.bin now, but where does the data within that file come from?

I believe the data is possibly converted to the binary format using a utility, but I cannot find an editable file with the source data. Is it in a separate project?

+7 (495) 937-46-85

> PhoneNumber.new('+74959374685').to_s
   RuntimeError: Must enter number

Should be: +7 (495) 937-46-85

"PhoneNumber" is not distinctive enough.

Consider using a more distinctive name to reduce chance of conflicts in the top-level namespace. (Maybe "Phoney::PhoneNumber" or just "Phoney")

I'd hate to have to fork phoney just because my app already has a "PhoneNumber" concept that I want in the global namespace.

Missing dialout_prefixes causes problem in currently released gem 0.1.3,

You can reproduce it by

pn=PhoneNumber.new('1234567',:na)

undefined method each' for nil:NilClass /bundle/ruby/2.0.0/gems/phoney-0.1.3/lib/phoney/parser.rb:187:inget_dialout_prefix'
/bundle/ruby/2.0.0/gems/phoney-0.1.3/lib/phoney/parser.rb:26:in parse_to_parts' /bundle/ruby/2.0.0/gems/phoney-0.1.3/lib/phoney/base.rb:43:ininitialize'

I noticed the entire project is under a complete rewrite and the issue seems to be resolved. Just wondering when you plan to release another new version?

Thanks,
Dan

uninitialized constant Phoney

Version

$ gem list phoney --details

*** LOCAL GEMS ***

phoney (0.1.3)
    Author: Jan Habermann
    Homepage: http://github.com/habermann24/phoney
    Installed at: /Users/craibuc/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0

    Ruby library that formats phone numbers.

IRB

irb(main):001:0> require 'phoney'
=> true
irb(main):002:0> pn = Phoney.new("+17041234567")
NameError: uninitialized constant Phoney
    from (irb):4
    from /Users/xxx/.rbenv/versions/2.2.2/bin/irb:11:in `<main>'

+44 (0) 870 165 1420

>> PhoneNumber.new("+4408701651420").to_s
=> "+44 08701651420"

Should be "+44 (0) 870 165 1420"

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.