bowsersenior/itu_codes — pull request #11 by DavidToca (2013-04-19 20:05:14+00:00)
Title: Fix a bug and inlcuding a new method called north_american_area_code_for

I did 3 commits, I'll explain the changes made and the reason to do so.

Commit 1

I was having a lot of trouble to even run the test, in order to solve that for me and the futures contributors, I made the following changes:

1-Added require_relative as needed.
2-Especify ruby 1.9.3 in gemfile.

Commit 2

I notice that when you try to parse a number like this '1-*304-8879463', it returns '-*304-8879463' (without removing the non-numeric characters), even further, when you try to parse a number with special characters and things that shouldn't be there, it was keeping them, so I made the following changes:

1-Add clear in the input number in parse_number before start procesing it.
2-Make more tests to parse_number, checking the case when the number contains invalid characters.

Commit 3

This is a feature that I really need, and maybe others will find useful too, be able to take the area code out of the cellphone number of a north american phone. Changes made:

1- Create a method called north_american_area_code_for(some_number).
2- Create the test for north_american_area_code_for.

Please if you have any questions be free to ask in the comments, I have more bug fixes to pull, but I prefer to wait until you review and aprove these.

Cheers,
David T.