floere/phony

View on GitHub
history.textile

Summary

Maintainability
Test Coverage
h2. Version 2.20.15

* Pakistan (#531)

h2. Version 2.20.14

* Pakistan (#528)

h2. Version 2.20.13

* Madagascar (#524)

h2. Version 2.20.12

* Luxembourg (#521)

h2. Version 2.20.11

* Vietnam (#519)

h2. Version 2.20.10

* Mozambique (#517)

h2. Version 2.20.9

* Italy (#516)

h2. Version 2.20.8

* Brazil (#512)

h2. Version 2.20.7

* Laos (#510)

h2. Version 2.20.6

* Mauritius (#509)

h2. Version 2.20.5

* Norfolk Island (#508)

h2. Version 2.20.4

* Kiribati (#507)

h2. Version 2.20.3

* Burkina Faso (#506)

h2. Version 2.20.2

* Italy (#505)

h2. Version 2.20.1

* Zambia (#503)

h2. Version 2.20.0

* ccc option for plausible? (#479)

h2. Version 2.19.15

* Italy

h2. Version 2.19.14

* Colombia (#501)

h2. Version 2.19.13

* Japan (#499)

h2. Version 2.19.12

* Italy (#498)

h2. Version 2.19.11

* Samoa (#497)

h2. Version 2.19.10

* Italy, Libya (#495)

h2. Version 2.19.9

* Belgium (#494)

h2. Version 2.19.8

* Madagascar (#493)

h2. Version 2.19.7

* Zambia (#491)

h2. Version 2.19.6

* Add plausible? check_length: false option for testing.

h2. Version 2.19.5

* International Freephone Service (#489)
* Shared-Cost Service

h2. Version 2.19.4

* Switzerland voice mail and Taiwan tollfree (#488)

h2. Version 2.19.3

* Fix for NDC false issue (#487)

h2. Version 2.19.2

* Zambia (#486)

h2. Version 2.19.1

* Japan (#485)

h2. Version 2.19.0

* Trunk codes will by default only be removed when working with international numbers.

h2. Version 2.18.23

* Japan (revert #453, see #457)

h2. Version 2.18.22

* Rwanda (#483)

h2. Version 2.18.21

* Serbia (#482)

h2. Version 2.18.20

* Serbia (#480)

h2. Version 2.18.19

* Côté d'Ivoire (#478)

h2. Version 2.18.18

* Nigeria (#475)

h2. Version 2.18.17

* Vietnam (#474)

h2. Version 2.18.16

* Gabon (#470)
* Ireland (#471)

h2. Version 2.18.15

* Cambodia (#469)

h2. Version 2.18.14

* Philippines (#464)
* China (#465)

h2. Version 2.18.13

* China (#462)

h2. Version 2.18.12

* Remove an issue with the DSL code in Ruby 2.7 (#452 and #454).

h2. Version 2.18.11

* Japan (#453)

h2. Version 2.18.10

* Nigeria (#451)

h2. Version 2.18.9

* San Marino (#449)

h2. Version 2.18.8

* Austria (#448)

h2. Version 2.18.7

* Germany (#447)

h2. Version 2.18.6

* Argentina (#444)

h2. Version 2.18.5

* Argentina (#443)

h2. Version 2.18.4

* Egypt (#442)

h2. Version 2.18.3

* Germany (E-Plus has NDC 1577)

h2. Version 2.18.2

* Philippines (#438)

h2. Version 2.18.1

* Freeze Strings where useful.

h2. Version 2.18.0

* Add @Phony::Config.load@ as an option to only load part of the CCs of the library. See the README for details.

h2. Version 2.17.3

* Israel (#437)

h2. Version 2.17.2

* Ireland (#433 and #434)

h2. Version 2.17.1

* Hong Kong (#432)

h2. Version 2.17.0

* Fix issue reported in #428 where a missing local part caused an error.

h2. Version 2.16.11

* Malaysia (#427)

h2. Version 2.16.10

* Russia & Ukraine (#420)
* Vietnam (#423)
* Japan (#424)
* Germany (#425)

h2. Version 2.16.9

* Vietnam (#421)

h2. Version 2.16.8

* PNG (#419)

h2. Version 2.16.7

* UAE (#418)

h2. Version 2.16.6

* Bulgaria (#17)
* Malaysia (#414)
* UAE (#416)

h2. Version 2.16.5

* Bulgaria (#407)
* Kosovo (#410)
* Peru (#411)

h2. Version 2.16.4

* Madagascar (#399)
* New Zealand (#401)
* South Korea (#402)
* Remove dependency on #blank? (#403)
* Satellite phone support (#404, #405)

h2. Version 2.16.3

* Improvements for Austria (#397)

h2. Version 2.16.2

* Improvements for Sweden (#396)

h2. Version 2.16.1

* Improvements for Indonesia (#393, #394)

h2. Version 2.16.0

* The Phony class methods normalize/normalize!/split/split!/format/format! all raise variants of ArgumentErrors now (#385)

h2. Version 2.15.49

* Improvements for New Zealand (#391)
* Improvements for Cambodia (#389)

h2. Version 2.15.48

* Improvements for Singapore (#388)

h2. Version 2.15.47

* Improvements for Somalia (#383)

h2. Version 2.15.46

* Improvements for Slovakia (#381)

h2. Version 2.15.45

* Improvements for Macao (#378)
* Improvements for Zambia (#375)
* Improvements for Croatia (#375).
* Improvements for Cambodia (#370).

h2. Version 2.15.44

* Improvements for Cambodia (#372).
* Improvements for Somalia (#371).

h2. Version 2.15.43

* Improvements for Somalia (#369).
* Improvements for Congo (#368).
* Improvements for Poland (#367)

h2. Version 2.15.42

* Improvements for Saudi Arabia (#366).
* Improvements for Belgium (#365)

h2. Version 2.15.41

* Improvements for error messages (#362).
* Improvements for Russia (#363)

h2. Version 2.15.40

* Improvements for Hungary (#359).
* Improvements for Italy (#360)

h2. Version 2.15.39

* Improvements for Belgium (#353).
* Improvements for Travis (#355, #356)
* Improvements for UAE (#357).

h2. Version 2.15.38

* Improvements for Austria (#352).

h2. Version 2.15.37

* Improvements for Austria (#351).

h2. Version 2.15.36

* Improvements for Switzerland (#348).

h2. Version 2.15.35

* Improvements for Russia (#347).

h2. Version 2.15.34

* Improvements for Brazil (#345).

h2. Version 2.15.33

* Improvements for Bosnia and Herzegowina (#343).

h2. Version 2.15.32

* Improvements for Vietnam (#341).

h2. Version 2.15.31

* Improvements for Australia (Discussion in #339).

h2. Version 2.15.30

* Improvements for Equador (#337).
* Improvements for Indonesia (#338).
* Improvements for Albania (#340).

h2. Version 2.15.29

* Improvements for Finland (#335).

h2. Version 2.15.28

* Improvements for Sweden (#331).
* Improvements for UAE (#332).

h2. Version 2.15.27

* Improvements for Brazil (#327).
* Improvements for Austria (#328).

h2. Version 2.15.26

* Improvements for Austria (#325).

h2. Version 2.15.24/25

* Improvements for Brazil (#323).

h2. Version 2.15.23

* Improvements for Ukraine (#322).

h2. Version 2.15.22

* Improvements for Mauritius, Cameroon, Guinea-Bissau and Dem. Rep. Congo (#321).

h2. Version 2.15.21

* Improvements for Sweden (#318).

h2. Version 2.15.20

* Improvements for Serbia (#317).

h2. Version 2.15.19

* Improvements for Indonesia (#316).

h2. Version 2.15.18

* Improvements for Sweden (#313).
* Improvements for Austria (#314).

h2. Version 2.15.17

* Improvements for Luxembourg (#311).
* Improvements for The Netherlands (#312).

h2. Version 2.15.16

* Improvements for Macao (#308).

h2. Version 2.15.15

* Improvements for Belgium (#302).

h2. Version 2.15.14

* Improvements for Saudi Arabia (#301).

h2. Version 2.15.13

* Improvements for Serbia (#300).

h2. Version 2.15.12

* Improvements for Romania (#299).

h2. Version 2.15.11

* Improvements for Australia (#298).

h2. Version 2.15.10

* Improvements for Belgium (#296).

h2. Version 2.15.9

* Improvements for Austria (#295).

h2. Version 2.15.8

* Improvements for Macedonia (#293).

h2. Version 2.15.7

* Improvements for Sweden (#292).

h2. Version 2.15.6

* Improvements for Australia (#291).

h2. Version 2.15.5

* Improvements for Brazil (#289).

h2. Version 2.15.4

* Improvements for Thailand (#286).

h2. Version 2.15.3

* Improvements for Austria (#283).

h2. Version 2.15.2

* Improvements for Finland (#282).

h2. Version 2.15.1

* Improvements for Belgium (#279).

h2. Version 2.15.0

* Trunk code will only return digits on @#format@ (#277).

h2. Version 2.14.15

* Improvements for Myanmar (#275).

h2. Version 2.14.14

* Improvements for Cambodia (#271).

h2. Version 2.14.13

* Improvements for China (#269).

h2. Version 2.14.12

* Improvements for Cambodia (#268).

h2. Version 2.14.11

* Improvements for Zimbabwe (#267).

h2. Version 2.14.10

* Improvements for the French territories (#265).

h2. Version 2.14.9

* Improvements for El Salvador (#264).

h2. Version 2.14.8

* Improvements for Ireland (#263).

h2. Version 2.14.7

* Improvements for Sweden (#262).

h2. Version 2.14.6

* Improvements for Big Sochi and Primorsky Krai (#234).

h2. Version 2.14.5

* Improvements for Finland (#260).

h2. Version 2.14.4

* Maintenance release (#259).

h2. Version 2.14.3

* Improvements for Cambodia (#254).

h2. Version 2.14.2

* Improvements for Brazil (#256).

h2. Version 2.14.1

* Improvements for Japan (#253).

h2. Version 2.14.0

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

h2. Version 2.13.0

* Add @trunk@ interpolation to @Phony#format@ option @format@.

h2. Version 2.12.14

* Improvements for Belgium (#251).

h2. Version 2.12.13

* Improvements for Zambia (#248).

h2. Version 2.12.12

* Improvements for Austria (#246).

h2. Version 2.12.11

* Improvements for Côte d'Ivoire (#244).

h2. Version 2.12.10

* Improvements for Nigeria (#243).

h2. Version 2.12.9

* Fixes #242 (and improves) by removing only @(0@ instead of @(0)@.

h2. Version 2.12.8

* Improvements for Italy (#241).

h2. Version 2.12.7

* Improvements for Japan (#239).

h2. Version 2.12.6

* Improvements for Japan (#239).

h2. Version 2.12.5

* Improvements for Romania (#238).

h2. Version 2.12.4

* Improvements for Italy (#237).

h2. Version 2.12.3

* Improvements for Italy, Egypt (#235, #236).

h2. Version 2.12.2

* Fix for NANP (see #232).

h2. Version 2.12.1

* Improvements for NANP (thanks, see #231).

h2. Version 2.12.0

* Add experimental trunk option to @format@.
  @Phony.format('14152223333', :format => :national, :trunk => false).should eql '415 222 3333'@

h2. Version 2.11.1

* Fix for Thailand (thanks, see #225, #228).

h2. Version 2.11.0

* Fix for national number formatting (thanks, see #227).

h2. Version 2.10.5

* Improvements for Nigeria (thanks, see #226).

h2. Version 2.10.4

* Improvements for Belgium (thanks, see #224).

h2. Version 2.10.3

* Improvements for French Polynesia (thanks, see #223).

h2. Version 2.10.2

* Improvements for Cambodian and Italian numbers (thanks, see #222).

h2. Version 2.10.1

* Improvements for Swedish numbers (thanks, see #217).

h2. Version 2.10.0

* Add default format, space, and local space options to country. See e.g. Russia for a default local_space.

h2. Version 2.9.1

* Improvements for Russian numbers (thanks, see #215).

h2. Version 2.9.0

* Add String to @Phony.format@. Usage:
  @Phony.format('71234567890', :format => '+%{cc} (%{ndc}) %{local}').should eql '+7 (123) 45 67890'@
* Add @:local_spaces@ option to @Phony.format@. Usage:
  Phony.format('41441231212', :local_spaces => '-').should eql '+41 44 123-12-12'

h2. Version 2.8.9

* Improvements for Saudi Arabian numbers (thanks, see #212).

h2. Version 2.8.8

* Improvements for Portuguese numbers (thanks, see #210).

h2. Version 2.8.7

* Various improvements (thanks, see #207).

h2. Version 2.8.6

* Improvements for Mexican numbers (thanks, see #206).

h2. Version 2.8.5

* Improvements for German 0800 numbers (thanks, see #205).

h2. Version 2.8.4

* Improvements for Slovenia, Austria, Italia, and Estonia (thanks, see #201, #202, #203, #204).

h2. Version 2.8.3

* Further improvements for the UK (thanks, see #198).
* Improvements for the Netherlands (thanks, see #199).
* What's with these "The" country name countries…

h2. Version 2.8.2

* Improvements for the UK (thanks, see #196).

h2. Version 2.8.1

* Improvements for Guinea (thanks, see #195 and #197).

h2. Version 2.8.0

* Trunk code can have a delimiter added (e.g. US: '1%s'), which will be replaced by a delimiter character.

h2. Version 2.7.1

* Improvements for Brazil (thanks, see #192).

h2. Version 2.7.0

* Normalize (remove) the trunk code by default.

h2. Version 2.6.0

* Add possibility to add limited whitespace formatting to trunk code.

h2. Version 2.5.4

* Improvements for German mobile/service numbers (thanks, see #189).

h2. Version 2.5.3

* Improve trunk handling for Cambodian numbers (thanks, see #187).

h2. Version 2.5.2

* Trunk handling for Cambodian numbers (thanks, see #186).

h2. Version 2.5.1

* Trunk handling for German numbers (thanks, see #185).

h2. Version 2.5.0

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

h2. Version 2.4.3

* Fix for Dutch numbers (thanks, see #184).

h2. Version 2.4.2

* Fix for Malaysia (thanks, see #183).

h2. Version 2.4.1

* Fix for Serbia (thanks, see #181).

h2. Version 2.4.0

* Rewrites the trunk code handling.

h2. Version 2.3.0

* Introduces the reserved DSL. If reserved, any operation on a number fails.

h2. Version 2.2.16

* Fixes for Spain and Austria (Thanks, see #176, #177).

h2. Version 2.2.15

* Fix for The Netherlands (Thanks, see #175).

h2. Version 2.2.14

* Fix for Croatia (Thanks, see #167).

h2. Version 2.2.13

* Fix for Reunion and Mayotte numbers (Thanks, see #163).

h2. Version 2.2.12

* Fix for Kiwi numbers (Thanks, see #162).

h2. Version 2.2.11

* Fix for Indonesian numbers (Thanks, see #161).

h2. Version 2.2.10

* Fix for Indonesian numbers (Thanks, see #160).

h2. Version 2.2.9

* Fix for Jakarta numbers (Thanks, see #159).

h2. Version 2.2.8

* Fix for Spanish numbers (Thanks, see #158).

h2. Version 2.2.7

* Fix for German numbers (Thanks, see #156).

h2. Version 2.2.6

* Fix for German numbers (Thanks, see #154).

h2. Version 2.2.5

* Best effort in case of invalid Italy number (Thanks, see #152).

h2. Version 2.2.4

* Fixed trunk code replacement (Thanks, see #151).

h2. Version 2.2.3

* Improvements for Aruba (Thanks @weppos, see #141).

h2. Version 2.2.2

* Improvements for Austria.

h2. Version 2.2.1

* Fix for Austria's 663 numbers (Thanks @weppos, see #139).

h2. Version 2.2.0

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

h2. Version 2.1.4

* Fixes for the Netherlands (Thanks @aeden, see #135).

h2. Version 2.1.3

* Updates for Brazil and Serbia (see #129 and #132).

h2. Version 2.1.2

* Fix Belgian numbers (closes #130).

h2. Version 2.1.1

* Fix for case where number already had a country code: @jp = Phony["81"]; p jp.normalize "+81 80 1234 5634" # => "818012345634"@

h2. Version 2.1.0

* Experimental syntax suggested in #104 added. E.g. @jp = Phony["81"]; p jp.normalize "08012345678" # => "818012345678"@

h2. Version 2.0.3

* Improve Italian numbers.

h2. Version 2.0.2

* Improve German numbers.

h2. Version 2.0.1

* Moved trunk codes to where they belong. Handle "(0)" in numbers.

h2. Version 2.0.0

* Many improvements and API changes.

h2. Version 1.9.0

* Fixes an issue with eg. Phony#normalize("+972") returning not just "972", but Phony internals (thanks @taf2)!

h2. Version 1.8.7

* Indonesia (thanks @rjhaveri)!

h2. Version 1.8.6

* Zambia and mobile numbers for Kenya (thanks @rjhaveri)!

h2. Version 1.8.5

* Fixes Brazil (thanks @knorrium)!
* Fixes Estonia (thanks @kritik)!

h2. Version 1.8.4

* Rwanda (thanks @rjhaveri)!

h2. Version 1.8.3

* Cambodia (thanks @dwilkie)!

h2. Version 1.8.2

* jcfischer: Gibraltar, Malta, Cyprus, Estonia, Monaco

h2. Version 1.8.1

* Morocco & Sudan (thanks @jcfischer)!

h2. Version 1.8.0

* Countries are now plausibility checked less harshly.

h2. Version 1.7.12

* Luxembourg & Nigeria (thanks @jcfischer)!

h2. Version 1.7.11

* Many improvements to UK numbers (thanks @g1smd)!

h2. Version 1.7.10

* More improvements to UK numbers.

h2. Version 1.7.9

* Many improvements to UK numbers (thanks @g1smd)!

h2. Version 1.7.8

* Closes "https://github.com/floere/phony/issues/53":https://github.com/floere/phony/issues/53. Countries who don't have NDCs are now also plausible.

h2. Version 1.7.7

* Russia, added catchall in last rule and group in regexp.

h2. Version 1.7.6

* Russia, Kazakhstan, Abhasia *and* South Osetia (thanks glebm)!

h2. Version 1.7.5

* 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 return @false@).

h2. Version 1.7.4

* Fix for issue #45. Irish phone numbers with unrecognized NDCs are now formatted better when using @:national@ formatting (thanks theirishpenguin!).

h2. Version 1.7.3

* Fix for issue #44. @Phony.plausible?('353')@ now returns false (on any number, if the NDC is missing, thanks theirishpenguin!).

h2. Version 1.7.2

* Fix for issue #42. @CountryCodes#clean@ is not destructive anymore, while @CountryCodes#clean!@ is.

h2. Version 1.7.1

* Polish number support much improved (thanks filiptepper!).

h2. Version 1.7.0

* 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, and @nil@ if not.

h2. Version 1.6.8

* Vietnam! (Closes "issue #39":https://github.com/floere/phony/issues/39)

h2. Version 1.6.7

* Improvements to the experimental @plausible?(number, hints = {})@ feature. It is now possible to give the hints @cc@ and @ndc@ a regexp, as in @Phony.plausible?("1-434-123-1234", cc: /1|7/, ndc: /4(34|35)/)@.

h2. Version 1.6.6

* Experimental @plausible?@ feature. Checks if the given number is a plausible number. Returns @false@ if 100% not plausible, @true@ if probably true.

h2. Version 1.6.5

* Ghana (thanks jschwertfeger!).

h2. Version 1.6.4

* Fix for Ireland's VoIP numbers.

h2. Version 1.6.3

* Ireland, thanks to stevenyan! (Closes "pull request #36":https://github.com/floere/phony/pull/36)

h2. Version 1.6.1/1.6.2

* Closes https://github.com/floere/phony/issues/32, normalizing numbers with a double zero at the beginning. Aka the "James Bond" release.

h2. Version 1.6.0

* 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 if @split(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.

h2. Version 1.5.2

* Fix for argentine republic's numbers (with input by vilcsak, thanks!).

h2. Version 1.5.1

* Fix for korean service codes incorrectly formatting korean mobile numbers (by vilcsak, thanks!).

h2. Version 1.5.0

* Raises when nil is handed into @#normalize@, @#split@, or @#format@ – to fail fast and hard. Please handle e.g. using @number && Phony.normalize(number)@, or @number && Phony.format(number)@.

h2. Version 1.4.5

* Fix for digits being cut off at the end of a greek mobile number (by vilcsak, thanks!).

h2. Version 1.4.4

* Singapore, Thailand.

h2. Version 1.4.3

* Fix for digits being cut off at the end of a number (by mrchucho, thanks!).

h2. Version 1.4.2

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

h2. Version 1.4.1

* Moved @lib/countries.rb@ -> @lib/phony/countries.rb@ (Thanks trans!).

h2. Version 1.4.0

* Changed @Phony.formatted@ to @Phony.format@. The old method can still be used. (Thanks trans!)

h2. Version 1.3.5

* Lithuania. Croatia.

h2. Version 1.3.4

* Slovakia.

h2. Version 1.3.3

* Australia.

h2. Version 1.3.2

* Fix. In certain cases, the Phony DSL clashed with existing DSLs.

h2. Version 1.3.1

* Finland.

h2. Version 1.3.0

* Easy DSL for defining countries (easier for you to improve phony :) ).
* Mexico.
* Cuba.
* Tunisia.

h2. Version 1.2.11

* Denmark, Norway. Skøl!

h2. Version 1.2.10

* The UK. Thanks yet again to kbingman! (Closes "pull request 16":https://github.com/floere/phony/pull/16)

h2. Version 1.2.9

* Clashing mobile numbers with Liège in Belgium fixed.

h2. Version 1.2.8

* Fix by glebm, thanks! Italian number handling did produce errors in Ruby 1.8. Closes "issue 13":https://github.com/floere/phony/issues#issue/13.

h2. Version 1.2.7

* Italian numbers are correctly normalized: Phony.normalize('+390909709511').should == '390909709511' (Zero in front of area code is not removed, closes "issue 12":https://github.com/floere/phony/issues#issue/12)

h2. Version 1.2.6

* Italy.

h2. Version 1.2.5

* Portugal. Polish landline (not mobile).

h2. Version 1.2.4

* Malaysia.

h2. Version 1.2.3

* South Korea.

h2. Version 1.2.2

* China.

h2. Version 1.2.1

* Turkey.

h2. Version 1.2.0

* Removed dependency on active support.

h2. Version 1.1.9

* Made the gem substantially smaller.

h2. Version 1.1.8

* Adds german 5-digits code formatting (Thanks ledermann!).

h2. Version 1.1.7

* Afghanistan. Venezuela.

h2. Version 1.1.6

* German 180, 181 numbers (Thanks kbingman and jcfischer!).

h2. Version 1.1.5

* Peru. Brasil. Chile.

h2. Version 1.1.3

* Romania.

h2. Version 1.1.2

* Sweden. Russia.

h2. Version 1.1.1

* The Netherlands (Thanks alloy and manfred!).

h2. Version 1.1.0

* German IVPNs. Poland. Greece. Egypt. Italy. Vanity number handling. Austria. Lots of code structure.

h2. Version 1.0.1

* Descriptions and dependencies changed.

h2. Version 1.0.0

* First release! Lots of countries.