- Remove an issue with the DSL code in Ruby 2.7 (#452 and #454).
- Japan (#453)
- Nigeria (#451)
- San Marino (#449)
- Austria (#448)
- Germany (#447)
- Argentina (#444)
- Argentina (#443)
- Egypt (#442)
- Germany (E-Plus has NDC 1577)
- Philippines (#438)
- Freeze Strings where useful.
- Add
Phony::Config.load
as an option to only load part of the CCs of the library. See the README for details.
- Israel (#437)
- Ireland (#433 and #434)
- Hong Kong (#432)
- Fix issue reported in #428 where a missing local part caused an error.
- Malaysia (#427)
- Russia & Ukraine (#420)
- Vietnam (#423)
- Japan (#424)
- Germany (#425)
- Vietnam (#421)
- PNG (#419)
- UAE (#418)
- Bulgaria (#17)
- Malaysia (#414)
- UAE (#416)
- Bulgaria (#407)
- Kosovo (#410)
- Peru (#411)
- Madagascar (#399)
- New Zealand (#401)
- South Korea (#402)
- Remove dependency on #blank? (#403)
- Satellite phone support (#404, #405)
- Improvements for Austria (#397)
- Improvements for Sweden (#396)
- Improvements for Indonesia (#393, #394)
- The Phony class methods normalize/normalize/format/format! all raise variants of ArgumentErrors now (#385)
- Improvements for New Zealand (#391)
- Improvements for Cambodia (#389)
- Improvements for Singapore (#388)
- Improvements for Somalia (#383)
- Improvements for Slovakia (#381)
- Improvements for Macao (#378)
- Improvements for Zambia (#375)
- Improvements for Croatia (#375).
- Improvements for Cambodia (#370).
- Improvements for Cambodia (#372).
- Improvements for Somalia (#371).
- Improvements for Somalia (#369).
- Improvements for Congo (#368).
- Improvements for Poland (#367)
- Improvements for Saudi Arabia (#366).
- Improvements for Belgium (#365)
- Improvements for error messages (#362).
- Improvements for Russia (#363)
- Improvements for Hungary (#359).
- Improvements for Italy (#360)
- Improvements for Belgium (#353).
- Improvements for Travis (#355, #356)
- Improvements for UAE (#357).
- Improvements for Austria (#352).
- Improvements for Austria (#351).
- Improvements for Switzerland (#348).
- Improvements for Russia (#347).
- Improvements for Brazil (#345).
- Improvements for Bosnia and Herzegowina (#343).
- Improvements for Vietnam (#341).
- Improvements for Australia (Discussion in #339).
- Improvements for Equador (#337).
- Improvements for Indonesia (#338).
- Improvements for Albania (#340).
- Improvements for Finland (#335).
- Improvements for Sweden (#331).
- Improvements for UAE (#332).
- Improvements for Brazil (#327).
- Improvements for Austria (#328).
- Improvements for Austria (#325).
- Improvements for Brazil (#323).
- Improvements for Ukraine (#322).
- Improvements for Mauritius, Cameroon, Guinea-Bissau and Dem. Rep. Congo (#321).
- Improvements for Sweden (#318).
- Improvements for Serbia (#317).
- Improvements for Indonesia (#316).
- Improvements for Sweden (#313).
- Improvements for Austria (#314).
- Improvements for Luxembourg (#311).
- Improvements for The Netherlands (#312).
- Improvements for Macao (#308).
- Improvements for Belgium (#302).
- Improvements for Saudi Arabia (#301).
- Improvements for Serbia (#300).
- Improvements for Romania (#299).
- Improvements for Australia (#298).
- Improvements for Belgium (#296).
- Improvements for Austria (#295).
- Improvements for Macedonia (#293).
- Improvements for Sweden (#292).
- Improvements for Australia (#291).
- Improvements for Brazil (#289).
- Improvements for Thailand (#286).
- Improvements for Austria (#283).
- Improvements for Finland (#282).
- Improvements for Belgium (#279).
- Trunk code will only return digits on
#format
(#277).
- Improvements for Myanmar (#275).
- Improvements for Cambodia (#271).
- Improvements for China (#269).
- Improvements for Cambodia (#268).
- Improvements for Zimbabwe (#267).
- Improvements for the French territories (#265).
- Improvements for El Salvador (#264).
- Improvements for Ireland (#263).
- Improvements for Sweden (#262).
- Improvements for Big Sochi and Primorsky Krai (#234).
- Improvements for Finland (#260).
- Maintenance release (#259).
- Improvements for Cambodia (#254).
- Improvements for Brazil (#256).
- Improvements for Japan (#253).
- Major change to formatting NANP numbers (including the US): NDC is now by default wrapped in parentheses, and the local part of the number is separated by dashes.
- Add
trunk
interpolation toPhony#format
optionformat
.
- Improvements for Belgium (#251).
- Improvements for Zambia (#248).
- Improvements for Austria (#246).
- Improvements for Côte d’Ivoire (#244).
- Improvements for Nigeria (#243).
- Fixes #242 (and improves) by removing only
(0
instead of(0)
.
- Improvements for Italy (#241).
- Improvements for Japan (#239).
- Improvements for Japan (#239).
- Improvements for Romania (#238).
- Improvements for Italy (#237).
- Improvements for Italy, Egypt (#235, #236).
- Fix for NANP (see #232).
- Improvements for NANP (thanks, see #231).
- Add experimental trunk option to
format
.
Phony.format('14152223333', :format => :national, :trunk => false).should eql '415 222 3333'
- Fix for Thailand (thanks, see #225, #228).
- Fix for national number formatting (thanks, see #227).
- Improvements for Nigeria (thanks, see #226).
- Improvements for Belgium (thanks, see #224).
- Improvements for French Polynesia (thanks, see #223).
- Improvements for Cambodian and Italian numbers (thanks, see #222).
- Improvements for Swedish numbers (thanks, see #217).
- Add default format, space, and local space options to country. See e.g. Russia for a default local_space.
- Improvements for Russian numbers (thanks, see #215).
- Add String to
Phony.format
. Usage:
Phony.format('71234567890', :format => '+%{cc} (%{ndc}) %{local}').should eql '+7 (123) 45 67890'
- Add
:local_spaces
option toPhony.format
. Usage:
Phony.format(‘41441231212’, :local_spaces => ‘-’).should eql ‘+41 44 123-12-12’
- Improvements for Saudi Arabian numbers (thanks, see #212).
- Improvements for Portuguese numbers (thanks, see #210).
- Various improvements (thanks, see #207).
- Improvements for Mexican numbers (thanks, see #206).
- Improvements for German 0800 numbers (thanks, see #205).
- Improvements for Slovenia, Austria, Italia, and Estonia (thanks, see #201, #202, #203, #204).
- Further improvements for the UK (thanks, see #198).
- Improvements for the Netherlands (thanks, see #199).
- What’s with these “The” country name countries…
- Improvements for the UK (thanks, see #196).
- Improvements for Guinea (thanks, see #195 and #197).
- 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.