Skip to content
This repository was archived by the owner on Jun 10, 2018. It is now read-only.

Fix formatting issue so you don't need to gsub #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ GlobalPhone is heavily inspired by Andreas Gal's [PhoneNumber.js](https://github

### Version History

**1.0.2** (Unreleased)

* Fix formatting issue so you don't need to gsub

**1.0.1** (May 29, 2013)

* GlobalPhone::Number#to_s returns the E.164 international string.
Expand Down
2 changes: 1 addition & 1 deletion lib/global_phone/number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Number
VALID_ALPHA_CHARS = /[a-zA-Z]/
LEADING_PLUS_CHARS = /^\++/
NON_DIALABLE_CHARS = /[^,#+\*\d]/
SPLIT_FIRST_GROUP = /^(\d+)(.*)$/
SPLIT_FIRST_GROUP = /^(\d+)\W*(.*)$/

def self.normalize(string)
string.to_s.
Expand Down
2 changes: 1 addition & 1 deletion test/edge_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class EdgeTest < TestCase
# We don't include those formats in our database, so we fall
# back to the closest match.
number = context.parse("1520123456", "IE")
assert_equal "1520 123 456", number.national_format
assert_equal "1520 123 456", number.national_format
end
end
end