- Trunk code can have a delimiter added (e.g. US: ‘1%s’), which will be replaced by a delimiter character.
- Improvements for Brazil (thanks, see #192).
- Normalize (remove) the trunk code by default.
- Add possibility to add limited whitespace formatting to trunk code.
- Improvements for German mobile/service numbers (thanks, see #189).
- Improve trunk handling for Cambodian numbers (thanks, see #187).
- Trunk handling for Cambodian numbers (thanks, see #186).
- Trunk handling for German numbers (thanks, see #185).
- Adds a lot of trunk code prefixes for about 30 countries. This will impact on national formatting and normalizing. Please provide feedback on this change – best with pull requests/issues with spec examples.
- Fix for Dutch numbers (thanks, see #184).
- Fix for Malaysia (thanks, see #183).
- Fix for Serbia (thanks, see #181).
- Rewrites the trunk code handling.
- Introduces the reserved DSL. If reserved, any operation on a number fails.
- Fixes for Spain and Austria (Thanks, see #176, #177).
- Fix for The Netherlands (Thanks, see #175).
- Fix for Croatia (Thanks, see #167).
- Fix for Reunion and Mayotte numbers (Thanks, see #163).
- Fix for Kiwi numbers (Thanks, see #162).
- Fix for Indonesian numbers (Thanks, see #161).
- Fix for Indonesian numbers (Thanks, see #160).
- Fix for Jakarta numbers (Thanks, see #159).
- Fix for Spanish numbers (Thanks, see #158).
- Fix for German numbers (Thanks, see #156).
- Fix for German numbers (Thanks, see #154).
- Best effort in case of invalid Italy number (Thanks, see #152).
- Fixed trunk code replacement (Thanks, see #151).
- Improvements for Aruba (Thanks @weppos, see #141).
- Improvements for Austria.
- Fix for Austria’s 663 numbers (Thanks @weppos, see #139).
- Countries cannot normalize full numbers anymore. So `Phony[“81”].normalize(“+81 80 1234 5634”).should == ‘818012345634’` will not work anymore. Instead `Phony[“81”].normalize(“80 1234 5678”)` will result in `‘80 1234 5634’`, so can only be used to normalize that country’s national numbers.
- Fixes for Italy (Thanks @weppos, see #138).
- Fixes for the Netherlands (Thanks @aeden, see #135).
- Updates for Brazil and Serbia (see #129 and #132).
- Fix Belgian numbers (closes #130).
- Fix for case where number already had a country code:
jp = Phony["81"]; p jp.normalize "+81 80 1234 5634" # => "818012345634"
- Experimental syntax suggested in #104 added. E.g.
jp = Phony["81"]; p jp.normalize "08012345678" # => "818012345678"
- Improve Italian numbers.
- Improve German numbers.
- Moved trunk codes to where they belong. Handle “(0)” in numbers.
- Many improvements and API changes.
- Fixes an issue with eg. Phony#normalize(“+972”) returning not just “972”, but Phony internals (thanks @taf2)!
- Indonesia (thanks @rjhaveri)!
- Zambia and mobile numbers for Kenya (thanks @rjhaveri)!
- Fixes Brazil (thanks @knorrium)!
- Fixes Estonia (thanks @kritik)!
- Rwanda (thanks @rjhaveri)!
- Cambodia (thanks @dwilkie)!
- jcfischer: Gibraltar, Malta, Cyprus, Estonia, Monaco
- Morocco & Sudan (thanks @jcfischer)!
- Countries are now plausibility checked less harshly.
- Luxembourg & Nigeria (thanks @jcfischer)!
- Many improvements to UK numbers (thanks @g1smd)!
- More improvements to UK numbers.
- Many improvements to UK numbers (thanks @g1smd)!
- Closes floere#53. Countries who don’t have NDCs are now also plausible.
- Russia, added catchall in last rule and group in regexp.
- Russia, Kazakhstan, Abhasia and South Osetia (thanks glebm)!
- Fix for issue #47. If a number contains a rest (CC + NDC + rest) size that is in the range of
1..2
, it is not considered plausible (ie.plausible?
will returnfalse
).
- Fix for issue #45. Irish phone numbers with unrecognized NDCs are now formatted better when using
:national
formatting (thanks theirishpenguin!).
- Fix for issue #44.
Phony.plausible?('353')
now returns false (on any number, if the NDC is missing, thanks theirishpenguin!).
- Fix for issue #42.
CountryCodes#clean
is not destructive anymore, whileCountryCodes#clean!
is.
- Polish number support much improved (thanks filiptepper!).
- Specifiable whether a zero is added in front of the NDC when formatting with format
:national
. Example: The US adds none, while Vietnam or Switzerland have one. - Internal #split method is now more consistent. If there is no NDC, it will return nil. Also, it will return a
"0"
in front of the NDC if a country needs that prefix, andnil
if not.
- Vietnam! (Closes issue #39)
- Improvements to the experimental
plausible?(number, hints = {})
feature. It is now possible to give the hintscc
andndc
a regexp, as inPhony.plausible?("1-434-123-1234", cc: /1|7/, ndc: /4(34|35)/)
.
- Experimental
plausible?
feature. Checks if the given number is a plausible number. Returnsfalse
if 100% not plausible,true
if probably true.
- Ghana (thanks jschwertfeger!).
- Fix for Ireland’s VoIP numbers.
- Ireland, thanks to stevenyan! (Closes pull request #36)
- Closes floere#32, normalizing numbers with a double zero at the beginning. Aka the “James Bond” release.
- Phony’s API is now much more lenient by always rendering 10 more numbers. If
split(3, 4)
is defined in the DSL, it actually behaves as ifsplit(3, 4 + 10)
was defined, allowing for irregularities in a country’s scheme that Phony did not cover yet. - The above change also allows for call-through numbers into offices etc.
- Fix for argentine republic’s numbers (with input by vilcsak, thanks!).
- Fix for korean service codes incorrectly formatting korean mobile numbers (by vilcsak, thanks!).
- Raises when nil is handed into
#normalize
,#split
, or#format
– to fail fast and hard. Please handle e.g. usingnumber && Phony.normalize(number)
, ornumber && Phony.format(number)
.
- Fix for digits being cut off at the end of a greek mobile number (by vilcsak, thanks!).
- Singapore, Thailand.
- Fix for digits being cut off at the end of a number (by mrchucho, thanks!).
- Exposing
Phony::CountryCodes.instance.international_absolute_format
,Phony::CountryCodes.instance.international_relative_format
,Phony::CountryCodes.instance.national_format
(writer & reader) so people can set their special ndc formats. Especially if they use Phony for just one country. (Thanks sarwagya for the inspiration!)
- Moved
lib/countries.rb
→lib/phony/countries.rb
(Thanks trans!).
- Changed
Phony.formatted
toPhony.format
. The old method can still be used. (Thanks trans!)
- Lithuania. Croatia.
- Slovakia.
- Australia.
- Fix. In certain cases, the Phony DSL clashed with existing DSLs.
- Finland.
- Easy DSL for defining countries (easier for you to improve phony :) ).
- Mexico.
- Cuba.
- Tunisia.
- Denmark, Norway. Skøl!
- The UK. Thanks yet again to kbingman! (Closes pull request 16)
- Clashing mobile numbers with Liège in Belgium fixed.
- Fix by glebm, thanks! Italian number handling did produce errors in Ruby 1.8. Closes issue 13.
- Italian numbers are correctly normalized: Phony.normalize(‘+390909709511’).should == ‘390909709511’ (Zero in front of area code is not removed, closes issue 12)
- Italy.
- Portugal. Polish landline (not mobile).
- Malaysia.
- South Korea.
- China.
- Turkey.
- Removed dependency on active support.
- Made the gem substantially smaller.
- Adds german 5-digits code formatting (Thanks ledermann!).
- Afghanistan. Venezuela.
- German 180, 181 numbers (Thanks kbingman and jcfischer!).
- Peru. Brasil. Chile.
- Romania.
- Sweden. Russia.
- The Netherlands (Thanks alloy and manfred!).
- German IVPNs. Poland. Greece. Egypt. Italy. Vanity number handling. Austria. Lots of code structure.
- Descriptions and dependencies changed.
- First release! Lots of countries.