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

Commit

Permalink
BUGFIX discard extra whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
chris committed Jul 29, 2013
1 parent ca0e315 commit 224ceb9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
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)

* BUGFIX discard extra whitespace when splitting phone numbers

**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

0 comments on commit 224ceb9

Please sign in to comment.