From 2aee6a50e9db99e137c3411a472d339145141afb Mon Sep 17 00:00:00 2001 From: Cevado Date: Sun, 15 Jan 2017 15:35:02 -0200 Subject: [PATCH 1/2] update do elixir 1.4 with no warnings --- lib/helpers/area.ex | 16 ++++++++-------- lib/helpers/country.ex | 20 ++++++++++---------- lib/phone/br/ac.ex | 2 +- lib/phone/br/al.ex | 2 +- lib/phone/br/am.ex | 2 +- lib/phone/br/ap.ex | 2 +- lib/phone/br/ba.ex | 2 +- lib/phone/br/ce.ex | 2 +- lib/phone/br/df.ex | 2 +- lib/phone/br/es.ex | 2 +- lib/phone/br/go.ex | 2 +- lib/phone/br/ma.ex | 2 +- lib/phone/br/mg.ex | 2 +- lib/phone/br/ms.ex | 2 +- lib/phone/br/mt.ex | 2 +- lib/phone/br/pa.ex | 2 +- lib/phone/br/pb.ex | 2 +- lib/phone/br/pe.ex | 2 +- lib/phone/br/pi.ex | 2 +- lib/phone/br/pr.ex | 2 +- lib/phone/br/rj.ex | 2 +- lib/phone/br/rn.ex | 2 +- lib/phone/br/ro.ex | 2 +- lib/phone/br/rr.ex | 2 +- lib/phone/br/rs.ex | 2 +- lib/phone/br/sc.ex | 2 +- lib/phone/br/se.ex | 2 +- lib/phone/br/sp.ex | 2 +- lib/phone/br/to.ex | 2 +- lib/phone/nanp/ca/ab.ex | 2 +- lib/phone/nanp/ca/bc.ex | 2 +- lib/phone/nanp/ca/mb.ex | 2 +- lib/phone/nanp/ca/nb.ex | 2 +- lib/phone/nanp/ca/nl.ex | 2 +- lib/phone/nanp/ca/ns_pe.ex | 2 +- lib/phone/nanp/ca/on.ex | 2 +- lib/phone/nanp/ca/qc.ex | 2 +- lib/phone/nanp/ca/sk.ex | 2 +- lib/phone/nanp/ca/territory.ex | 2 +- lib/phone/nanp/us/ak.ex | 2 +- lib/phone/nanp/us/al.ex | 2 +- lib/phone/nanp/us/ar.ex | 2 +- lib/phone/nanp/us/az.ex | 2 +- lib/phone/nanp/us/ca.ex | 2 +- lib/phone/nanp/us/co.ex | 2 +- lib/phone/nanp/us/ct.ex | 2 +- lib/phone/nanp/us/dc.ex | 2 +- lib/phone/nanp/us/de.ex | 2 +- lib/phone/nanp/us/fl.ex | 2 +- lib/phone/nanp/us/ga.ex | 2 +- lib/phone/nanp/us/hi.ex | 2 +- lib/phone/nanp/us/ia.ex | 2 +- lib/phone/nanp/us/id.ex | 2 +- lib/phone/nanp/us/il.ex | 2 +- lib/phone/nanp/us/in.ex | 2 +- lib/phone/nanp/us/ks.ex | 2 +- lib/phone/nanp/us/ky.ex | 2 +- lib/phone/nanp/us/la.ex | 2 +- lib/phone/nanp/us/ma.ex | 2 +- lib/phone/nanp/us/md.ex | 2 +- lib/phone/nanp/us/me.ex | 2 +- lib/phone/nanp/us/mi.ex | 2 +- lib/phone/nanp/us/mn.ex | 2 +- lib/phone/nanp/us/mo.ex | 2 +- lib/phone/nanp/us/ms.ex | 2 +- lib/phone/nanp/us/mt.ex | 2 +- lib/phone/nanp/us/nc.ex | 2 +- lib/phone/nanp/us/nd.ex | 2 +- lib/phone/nanp/us/ne.ex | 2 +- lib/phone/nanp/us/nh.ex | 2 +- lib/phone/nanp/us/nj.ex | 2 +- lib/phone/nanp/us/nm.ex | 2 +- lib/phone/nanp/us/nv.ex | 2 +- lib/phone/nanp/us/ny.ex | 2 +- lib/phone/nanp/us/oh.ex | 2 +- lib/phone/nanp/us/ok.ex | 2 +- lib/phone/nanp/us/or.ex | 2 +- lib/phone/nanp/us/pa.ex | 2 +- lib/phone/nanp/us/ri.ex | 2 +- lib/phone/nanp/us/sc.ex | 2 +- lib/phone/nanp/us/sd.ex | 2 +- lib/phone/nanp/us/tn.ex | 2 +- lib/phone/nanp/us/tx.ex | 2 +- lib/phone/nanp/us/ut.ex | 2 +- lib/phone/nanp/us/va.ex | 2 +- lib/phone/nanp/us/vt.ex | 2 +- lib/phone/nanp/us/wa.ex | 2 +- lib/phone/nanp/us/wi.ex | 2 +- lib/phone/nanp/us/wv.ex | 2 +- lib/phone/nanp/us/wy.ex | 2 +- mix.exs | 12 ++++++------ 91 files changed, 112 insertions(+), 112 deletions(-) diff --git a/lib/helpers/area.ex b/lib/helpers/area.ex index 0dd3910..042d6b1 100644 --- a/lib/helpers/area.ex +++ b/lib/helpers/area.ex @@ -16,7 +16,7 @@ defmodule Helper.Area do defmacro builder do quote do def match?(number) do - Regex.match?(regex, number) + Regex.match?(regex(), number) end def builder(number) do @@ -29,18 +29,18 @@ defmodule Helper.Area do |> Enum.reverse |> Module.concat - [[_, code, area, number]] = Regex.scan(regex, number) + [[_, code, area, number]] = Regex.scan(regex(), number) %{ - country: country.country, - a2: country.a2, - a3: country.a3, + country: country.country(), + a2: country.a2(), + a3: country.a3(), international_code: code, number: number, area_code: area, - area_name: area_name, - area_type: area_type, - area_abbreviation: area_abbreviation + area_name: area_name(), + area_type: area_type(), + area_abbreviation: area_abbreviation() } end diff --git a/lib/helpers/country.ex b/lib/helpers/country.ex index e75cf42..2fcebda 100644 --- a/lib/helpers/country.ex +++ b/lib/helpers/country.ex @@ -16,16 +16,16 @@ defmodule Helper.Country do defp regex_matcher do quote do def match?(number) do - Regex.match?(regex, number) + Regex.match?(regex(), number) end def builder(number) do - [[_, code, area, number]] = Regex.scan(regex,number) + [[_, code, area, number]] = Regex.scan(regex(), number) %{ - country: country, - a2: a2, - a3: a3, + country: country(), + a2: a2(), + a3: a3(), international_code: code, area_code: area, number: number @@ -53,13 +53,13 @@ defmodule Helper.Country do defp modules_matcher do quote do def match?(number) do - ms = Enum.filter(modules, fn m -> m.match?(number) end) + ms = Enum.filter(modules(), fn m -> m.match?(number) end) length(ms) > 0 end def build(number) do if match?(number) do - [module] = Enum.filter(modules, fn m -> m.match?(number) end) + [module] = Enum.filter(modules(), fn m -> m.match?(number) end) module.build(number) else {:error, "Not a valid phone number."} @@ -68,7 +68,7 @@ defmodule Helper.Country do def build!(number) do if match?(number) do - [module] = Enum.filter(modules, fn m -> m.match?(number) end) + [module] = Enum.filter(modules(), fn m -> m.match?(number) end) module.build!(number) else raise ArgumentError, message: "Not a valid phone number." @@ -79,8 +79,8 @@ defmodule Helper.Country do defmacro match(matcher) do case matcher do - :regex -> regex_matcher - :modules -> modules_matcher + :regex -> regex_matcher() + :modules -> modules_matcher() true -> raise ArgumentError, "You can only match against :regex or :modules, passed #{inspect matcher}" end diff --git a/lib/phone/br/ac.ex b/lib/phone/br/ac.ex index 95e5662..ecec612 100644 --- a/lib/phone/br/ac.ex +++ b/lib/phone/br/ac.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.AC do field :area_name, "Acre" field :area_type, "state" field :area_abbreviation, "AC" - builder + builder() end diff --git a/lib/phone/br/al.ex b/lib/phone/br/al.ex index 0ae7fe7..927bc36 100644 --- a/lib/phone/br/al.ex +++ b/lib/phone/br/al.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.AL do field :area_name, "Alagoas" field :area_type, "state" field :area_abbreviation, "AL" - builder + builder() end diff --git a/lib/phone/br/am.ex b/lib/phone/br/am.ex index c4e41d7..8329de0 100644 --- a/lib/phone/br/am.ex +++ b/lib/phone/br/am.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.AM do field :area_name, "Amazonas" field :area_type, "state" field :area_abbreviation, "AM" - builder + builder() end diff --git a/lib/phone/br/ap.ex b/lib/phone/br/ap.ex index e56c40a..2d8fe83 100644 --- a/lib/phone/br/ap.ex +++ b/lib/phone/br/ap.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.AP do field :area_name, "Amapá" field :area_type, "state" field :area_abbreviation, "AP" - builder + builder() end diff --git a/lib/phone/br/ba.ex b/lib/phone/br/ba.ex index c1aa806..acaa434 100644 --- a/lib/phone/br/ba.ex +++ b/lib/phone/br/ba.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.BA do field :area_name, "Bahia" field :area_type, "state" field :area_abbreviation, "BA" - builder + builder() end diff --git a/lib/phone/br/ce.ex b/lib/phone/br/ce.ex index 3d9aad7..4474e04 100644 --- a/lib/phone/br/ce.ex +++ b/lib/phone/br/ce.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.CE do field :area_name, "Ceará" field :area_type, "state" field :area_abbreviation, "CE" - builder + builder() end diff --git a/lib/phone/br/df.ex b/lib/phone/br/df.ex index 546504e..e5c905b 100644 --- a/lib/phone/br/df.ex +++ b/lib/phone/br/df.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.DF do field :area_name, "Distrito Federal" field :area_type, "district" field :area_abbreviation, "DF" - builder + builder() end diff --git a/lib/phone/br/es.ex b/lib/phone/br/es.ex index 8067437..26963bb 100644 --- a/lib/phone/br/es.ex +++ b/lib/phone/br/es.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.ES do field :area_name, "Espírito Santo" field :area_type, "state" field :area_abbreviation, "ES" - builder + builder() end diff --git a/lib/phone/br/go.ex b/lib/phone/br/go.ex index 03044d8..523f7e8 100644 --- a/lib/phone/br/go.ex +++ b/lib/phone/br/go.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.GO do field :area_name, "Goiás" field :area_type, "state" field :area_abbreviation, "GO" - builder + builder() end diff --git a/lib/phone/br/ma.ex b/lib/phone/br/ma.ex index 6cd8ef4..9038243 100644 --- a/lib/phone/br/ma.ex +++ b/lib/phone/br/ma.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.MA do field :area_name, "Maranhão" field :area_type, "state" field :area_abbreviation, "MA" - builder + builder() end diff --git a/lib/phone/br/mg.ex b/lib/phone/br/mg.ex index 1e5a6d4..07b7c36 100644 --- a/lib/phone/br/mg.ex +++ b/lib/phone/br/mg.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.MG do field :area_name, "Minas Gerais" field :area_type, "state" field :area_abbreviation, "MG" - builder + builder() end diff --git a/lib/phone/br/ms.ex b/lib/phone/br/ms.ex index 1881504..ea6711e 100644 --- a/lib/phone/br/ms.ex +++ b/lib/phone/br/ms.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.MS do field :area_name, "Mato Grosso do Sul" field :area_type, "state" field :area_abbreviation, "MS" - builder + builder() end diff --git a/lib/phone/br/mt.ex b/lib/phone/br/mt.ex index 1118f4e..1f13c2d 100644 --- a/lib/phone/br/mt.ex +++ b/lib/phone/br/mt.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.MT do field :area_name, "Mato Grosso" field :area_type, "state" field :area_abbreviation, "MT" - builder + builder() end diff --git a/lib/phone/br/pa.ex b/lib/phone/br/pa.ex index d04c527..279ecec 100644 --- a/lib/phone/br/pa.ex +++ b/lib/phone/br/pa.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.PA do field :area_name, "Pará" field :area_type, "state" field :area_abbreviation, "PA" - builder + builder() end diff --git a/lib/phone/br/pb.ex b/lib/phone/br/pb.ex index a2f38b0..e64ea9e 100644 --- a/lib/phone/br/pb.ex +++ b/lib/phone/br/pb.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.PB do field :area_name, "Paraíba" field :area_type, "state" field :area_abbreviation, "PB" - builder + builder() end diff --git a/lib/phone/br/pe.ex b/lib/phone/br/pe.ex index 9b44a74..679c272 100644 --- a/lib/phone/br/pe.ex +++ b/lib/phone/br/pe.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.PE do field :area_name, "Pernambuco" field :area_type, "state" field :area_abbreviation, "PE" - builder + builder() end diff --git a/lib/phone/br/pi.ex b/lib/phone/br/pi.ex index 62919f7..83afe12 100644 --- a/lib/phone/br/pi.ex +++ b/lib/phone/br/pi.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.PI do field :area_name, "Piauí" field :area_type, "state" field :area_abbreviation, "PI" - builder + builder() end diff --git a/lib/phone/br/pr.ex b/lib/phone/br/pr.ex index a2f95bd..b9f3ae0 100644 --- a/lib/phone/br/pr.ex +++ b/lib/phone/br/pr.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.PR do field :area_name, "Paraná" field :area_type, "state" field :area_abbreviation, "PR" - builder + builder() end diff --git a/lib/phone/br/rj.ex b/lib/phone/br/rj.ex index fb7e1ce..e4f516c 100644 --- a/lib/phone/br/rj.ex +++ b/lib/phone/br/rj.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.RJ do field :area_name, "Rio de Janeiro" field :area_type, "state" field :area_abbreviation, "RJ" - builder + builder() end diff --git a/lib/phone/br/rn.ex b/lib/phone/br/rn.ex index f1cfd0b..8579be4 100644 --- a/lib/phone/br/rn.ex +++ b/lib/phone/br/rn.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.RN do field :area_name, "Rio Grande do Norte" field :area_type, "state" field :area_abbreviation, "RN" - builder + builder() end diff --git a/lib/phone/br/ro.ex b/lib/phone/br/ro.ex index 9ae3d0c..39d2495 100644 --- a/lib/phone/br/ro.ex +++ b/lib/phone/br/ro.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.RO do field :area_name, "Rondônia" field :area_type, "state" field :area_abbreviation, "RO" - builder + builder() end diff --git a/lib/phone/br/rr.ex b/lib/phone/br/rr.ex index aebdd50..f809c60 100644 --- a/lib/phone/br/rr.ex +++ b/lib/phone/br/rr.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.RR do field :area_name, "Roraima" field :area_type, "state" field :area_abbreviation, "RR" - builder + builder() end diff --git a/lib/phone/br/rs.ex b/lib/phone/br/rs.ex index aa93ff3..9580a59 100644 --- a/lib/phone/br/rs.ex +++ b/lib/phone/br/rs.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.RS do field :area_name, "Rio Grande do Sul" field :area_type, "state" field :area_abbreviation, "RS" - builder + builder() end diff --git a/lib/phone/br/sc.ex b/lib/phone/br/sc.ex index 1b491b4..995926d 100644 --- a/lib/phone/br/sc.ex +++ b/lib/phone/br/sc.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.SC do field :area_name, "Santa Catarina" field :area_type, "state" field :area_abbreviation, "SC" - builder + builder() end diff --git a/lib/phone/br/se.ex b/lib/phone/br/se.ex index 088b0b1..b6915e3 100644 --- a/lib/phone/br/se.ex +++ b/lib/phone/br/se.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.SE do field :area_name, "Sergipe" field :area_type, "state" field :area_abbreviation, "SE" - builder + builder() end diff --git a/lib/phone/br/sp.ex b/lib/phone/br/sp.ex index 2758130..89e4a15 100644 --- a/lib/phone/br/sp.ex +++ b/lib/phone/br/sp.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.SP do field :area_name, "São Paulo" field :area_type, "state" field :area_abbreviation, "SP" - builder + builder() end diff --git a/lib/phone/br/to.ex b/lib/phone/br/to.ex index 15da4f4..c74aaf1 100644 --- a/lib/phone/br/to.ex +++ b/lib/phone/br/to.ex @@ -4,5 +4,5 @@ defmodule Phone.BR.TO do field :area_name, "Tocantins" field :area_type, "state" field :area_abbreviation, "TO" - builder + builder() end diff --git a/lib/phone/nanp/ca/ab.ex b/lib/phone/nanp/ca/ab.ex index 1bb2e6b..2b35238 100644 --- a/lib/phone/nanp/ca/ab.ex +++ b/lib/phone/nanp/ca/ab.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.CA.AB do field :area_name, "Alberta" field :area_type, "province" field :area_abbreviation, "AB" - builder + builder() end diff --git a/lib/phone/nanp/ca/bc.ex b/lib/phone/nanp/ca/bc.ex index 55a59be..4dcb025 100644 --- a/lib/phone/nanp/ca/bc.ex +++ b/lib/phone/nanp/ca/bc.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.CA.BC do field :area_name, "British Columbia" field :area_type, "province" field :area_abbreviation, "BC" - builder + builder() end diff --git a/lib/phone/nanp/ca/mb.ex b/lib/phone/nanp/ca/mb.ex index 9e96847..19072b4 100644 --- a/lib/phone/nanp/ca/mb.ex +++ b/lib/phone/nanp/ca/mb.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.CA.MB do field :area_name, "Manitoba" field :area_type, "province" field :area_abbreviation, "MB" - builder + builder() end diff --git a/lib/phone/nanp/ca/nb.ex b/lib/phone/nanp/ca/nb.ex index e99659d..25c4219 100644 --- a/lib/phone/nanp/ca/nb.ex +++ b/lib/phone/nanp/ca/nb.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.CA.NB do field :area_name, "New Brunswick" field :area_type, "province" field :area_abbreviation, "NB" - builder + builder() end diff --git a/lib/phone/nanp/ca/nl.ex b/lib/phone/nanp/ca/nl.ex index 16ce80d..0d8137d 100644 --- a/lib/phone/nanp/ca/nl.ex +++ b/lib/phone/nanp/ca/nl.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.CA.NL do field :area_name, "Newfoundland and Labrador" field :area_type, "province" field :area_abbreviation, "NL" - builder + builder() end diff --git a/lib/phone/nanp/ca/ns_pe.ex b/lib/phone/nanp/ca/ns_pe.ex index 209afc1..3f964b6 100644 --- a/lib/phone/nanp/ca/ns_pe.ex +++ b/lib/phone/nanp/ca/ns_pe.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.CA.NS_PE do field :area_name, ["Nova Scotia","Prince Edward Island"] field :area_type, "provinces" field :area_abbreviation, ["NS","PE"] - builder + builder() end diff --git a/lib/phone/nanp/ca/on.ex b/lib/phone/nanp/ca/on.ex index db1bd42..0612670 100644 --- a/lib/phone/nanp/ca/on.ex +++ b/lib/phone/nanp/ca/on.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.CA.ON do field :area_name, "Ontario" field :area_type, "province" field :area_abbreviation, "ON" - builder + builder() end diff --git a/lib/phone/nanp/ca/qc.ex b/lib/phone/nanp/ca/qc.ex index 0f72be7..e94a6d0 100644 --- a/lib/phone/nanp/ca/qc.ex +++ b/lib/phone/nanp/ca/qc.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.CA.QC do field :area_name, "Quebec" field :area_type, "province" field :area_abbreviation, "QC" - builder + builder() end diff --git a/lib/phone/nanp/ca/sk.ex b/lib/phone/nanp/ca/sk.ex index f103cff..6baf2cf 100644 --- a/lib/phone/nanp/ca/sk.ex +++ b/lib/phone/nanp/ca/sk.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.CA.SK do field :area_name, "Saskatchewan" field :area_type, "province" field :area_abbreviation, "SK" - builder + builder() end diff --git a/lib/phone/nanp/ca/territory.ex b/lib/phone/nanp/ca/territory.ex index ae57611..5967a32 100644 --- a/lib/phone/nanp/ca/territory.ex +++ b/lib/phone/nanp/ca/territory.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.CA.Territory do field :area_name, ["Northwest Territories", "Nunavut", "Yukon"] field :area_type, "territories" field :area_abbreviation, ["NT","NU","YT"] - builder + builder() end diff --git a/lib/phone/nanp/us/ak.ex b/lib/phone/nanp/us/ak.ex index a9c1b36..6a1a006 100644 --- a/lib/phone/nanp/us/ak.ex +++ b/lib/phone/nanp/us/ak.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.AK do field :area_name, "Alaska" field :area_type, "state" field :area_abbreviation, "AK" - builder + builder() end diff --git a/lib/phone/nanp/us/al.ex b/lib/phone/nanp/us/al.ex index c9a7092..9ed55e6 100644 --- a/lib/phone/nanp/us/al.ex +++ b/lib/phone/nanp/us/al.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.AL do field :area_name, "Alabama" field :area_type, "state" field :area_abbreviation, "AL" - builder + builder() end diff --git a/lib/phone/nanp/us/ar.ex b/lib/phone/nanp/us/ar.ex index fd61eff..7587e02 100644 --- a/lib/phone/nanp/us/ar.ex +++ b/lib/phone/nanp/us/ar.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.AR do field :area_name, "Arkansas" field :area_type, "state" field :area_abbreviation, "AR" - builder + builder() end diff --git a/lib/phone/nanp/us/az.ex b/lib/phone/nanp/us/az.ex index 89f89a1..b7864f7 100644 --- a/lib/phone/nanp/us/az.ex +++ b/lib/phone/nanp/us/az.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.AZ do field :area_name, "Arizona" field :area_type, "state" field :area_abbreviation, "AZ" - builder + builder() end diff --git a/lib/phone/nanp/us/ca.ex b/lib/phone/nanp/us/ca.ex index ebb0a2c..34ec70f 100644 --- a/lib/phone/nanp/us/ca.ex +++ b/lib/phone/nanp/us/ca.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.CA do field :area_name, "California" field :area_type, "state" field :area_abbreviation, "CA" - builder + builder() end diff --git a/lib/phone/nanp/us/co.ex b/lib/phone/nanp/us/co.ex index 811920e..eb70e8a 100644 --- a/lib/phone/nanp/us/co.ex +++ b/lib/phone/nanp/us/co.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.CO do field :area_name, "Colorado" field :area_type, "state" field :area_abbreviation, "CO" - builder + builder() end diff --git a/lib/phone/nanp/us/ct.ex b/lib/phone/nanp/us/ct.ex index afe7b29..7f34101 100644 --- a/lib/phone/nanp/us/ct.ex +++ b/lib/phone/nanp/us/ct.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.CT do field :area_name, "Connecticut" field :area_type, "state" field :area_abbreviation, "CT" - builder + builder() end diff --git a/lib/phone/nanp/us/dc.ex b/lib/phone/nanp/us/dc.ex index b5e4639..7123dee 100644 --- a/lib/phone/nanp/us/dc.ex +++ b/lib/phone/nanp/us/dc.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.DC do field :area_name, "Washington, D.C." field :area_type, "state" field :area_abbreviation, "DC" - builder + builder() end diff --git a/lib/phone/nanp/us/de.ex b/lib/phone/nanp/us/de.ex index 1eeb682..2291111 100644 --- a/lib/phone/nanp/us/de.ex +++ b/lib/phone/nanp/us/de.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.DE do field :area_name, "Delaware" field :area_type, "state" field :area_abbreviation, "DE" - builder + builder() end diff --git a/lib/phone/nanp/us/fl.ex b/lib/phone/nanp/us/fl.ex index b655385..30dec0c 100644 --- a/lib/phone/nanp/us/fl.ex +++ b/lib/phone/nanp/us/fl.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.FL do field :area_name, "Florida" field :area_type, "state" field :area_abbreviation, "FL" - builder + builder() end diff --git a/lib/phone/nanp/us/ga.ex b/lib/phone/nanp/us/ga.ex index 9d9f5f1..bb50a63 100644 --- a/lib/phone/nanp/us/ga.ex +++ b/lib/phone/nanp/us/ga.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.GA do field :area_name, "Georgia" field :area_type, "state" field :area_abbreviation, "GA" - builder + builder() end diff --git a/lib/phone/nanp/us/hi.ex b/lib/phone/nanp/us/hi.ex index 7d93496..1bddfe1 100644 --- a/lib/phone/nanp/us/hi.ex +++ b/lib/phone/nanp/us/hi.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.HI do field :area_name, "Hawaii" field :area_type, "state" field :area_abbreviation, "HI" - builder + builder() end diff --git a/lib/phone/nanp/us/ia.ex b/lib/phone/nanp/us/ia.ex index 4de37ea..abc6804 100644 --- a/lib/phone/nanp/us/ia.ex +++ b/lib/phone/nanp/us/ia.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.IA do field :area_name, "Iowa" field :area_type, "state" field :area_abbreviation, "IA" - builder + builder() end diff --git a/lib/phone/nanp/us/id.ex b/lib/phone/nanp/us/id.ex index 946db4d..11e8df6 100644 --- a/lib/phone/nanp/us/id.ex +++ b/lib/phone/nanp/us/id.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.ID do field :area_name, "Idaho" field :area_type, "state" field :area_abbreviation, "ID" - builder + builder() end diff --git a/lib/phone/nanp/us/il.ex b/lib/phone/nanp/us/il.ex index 513b302..72869df 100644 --- a/lib/phone/nanp/us/il.ex +++ b/lib/phone/nanp/us/il.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.IL do field :area_name, "Illinois" field :area_type, "state" field :area_abbreviation, "IL" - builder + builder() end diff --git a/lib/phone/nanp/us/in.ex b/lib/phone/nanp/us/in.ex index 87159b7..1a5c32c 100644 --- a/lib/phone/nanp/us/in.ex +++ b/lib/phone/nanp/us/in.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.IN do field :area_name, "Indiana" field :area_type, "state" field :area_abbreviation, "IN" - builder + builder() end diff --git a/lib/phone/nanp/us/ks.ex b/lib/phone/nanp/us/ks.ex index 076b1db..0746f6b 100644 --- a/lib/phone/nanp/us/ks.ex +++ b/lib/phone/nanp/us/ks.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.KS do field :area_name, "Kansas" field :area_type, "state" field :area_abbreviation, "KS" - builder + builder() end diff --git a/lib/phone/nanp/us/ky.ex b/lib/phone/nanp/us/ky.ex index 932adab..b89e2f5 100644 --- a/lib/phone/nanp/us/ky.ex +++ b/lib/phone/nanp/us/ky.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.KY do field :area_name, "Kentucky" field :area_type, "state" field :area_abbreviation, "KY" - builder + builder() end diff --git a/lib/phone/nanp/us/la.ex b/lib/phone/nanp/us/la.ex index 859e5ed..a33ea78 100644 --- a/lib/phone/nanp/us/la.ex +++ b/lib/phone/nanp/us/la.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.LA do field :area_name, "Louisiana" field :area_type, "state" field :area_abbreviation, "LA" - builder + builder() end diff --git a/lib/phone/nanp/us/ma.ex b/lib/phone/nanp/us/ma.ex index 32d9fb3..e5d149e 100644 --- a/lib/phone/nanp/us/ma.ex +++ b/lib/phone/nanp/us/ma.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.MA do field :area_name, "Massachusetts" field :area_type, "state" field :area_abbreviation, "MA" - builder + builder() end diff --git a/lib/phone/nanp/us/md.ex b/lib/phone/nanp/us/md.ex index ca12c41..11e91e9 100644 --- a/lib/phone/nanp/us/md.ex +++ b/lib/phone/nanp/us/md.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.MD do field :area_name, "Maryland" field :area_type, "state" field :area_abbreviation, "MD" - builder + builder() end diff --git a/lib/phone/nanp/us/me.ex b/lib/phone/nanp/us/me.ex index b8a9924..8111d9a 100644 --- a/lib/phone/nanp/us/me.ex +++ b/lib/phone/nanp/us/me.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.ME do field :area_name, "Maine" field :area_type, "state" field :area_abbreviation, "ME" - builder + builder() end diff --git a/lib/phone/nanp/us/mi.ex b/lib/phone/nanp/us/mi.ex index 264ab22..44604cd 100644 --- a/lib/phone/nanp/us/mi.ex +++ b/lib/phone/nanp/us/mi.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.MI do field :area_name, "Michigan" field :area_type, "state" field :area_abbreviation, "MI" - builder + builder() end diff --git a/lib/phone/nanp/us/mn.ex b/lib/phone/nanp/us/mn.ex index 6f997bb..56cdcbf 100644 --- a/lib/phone/nanp/us/mn.ex +++ b/lib/phone/nanp/us/mn.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.MN do field :area_name, "Minnesota" field :area_type, "state" field :area_abbreviation, "MN" - builder + builder() end diff --git a/lib/phone/nanp/us/mo.ex b/lib/phone/nanp/us/mo.ex index aa282f3..cbf4b0f 100644 --- a/lib/phone/nanp/us/mo.ex +++ b/lib/phone/nanp/us/mo.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.MO do field :area_name, "Missouri" field :area_type, "state" field :area_abbreviation, "MO" - builder + builder() end diff --git a/lib/phone/nanp/us/ms.ex b/lib/phone/nanp/us/ms.ex index 2c572cd..8bab8eb 100644 --- a/lib/phone/nanp/us/ms.ex +++ b/lib/phone/nanp/us/ms.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.MS do field :area_name, "Mississippi" field :area_type, "state" field :area_abbreviation, "MS" - builder + builder() end diff --git a/lib/phone/nanp/us/mt.ex b/lib/phone/nanp/us/mt.ex index 517fa2c..f10b18e 100644 --- a/lib/phone/nanp/us/mt.ex +++ b/lib/phone/nanp/us/mt.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.MT do field :area_name, "Montana" field :area_type, "state" field :area_abbreviation, "MT" - builder + builder() end diff --git a/lib/phone/nanp/us/nc.ex b/lib/phone/nanp/us/nc.ex index 19430d4..ec7476c 100644 --- a/lib/phone/nanp/us/nc.ex +++ b/lib/phone/nanp/us/nc.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.NC do field :area_name, "North Carolina" field :area_type, "state" field :area_abbreviation, "NC" - builder + builder() end diff --git a/lib/phone/nanp/us/nd.ex b/lib/phone/nanp/us/nd.ex index 5402c78..ba22a9d 100644 --- a/lib/phone/nanp/us/nd.ex +++ b/lib/phone/nanp/us/nd.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.ND do field :area_name, "North Dakota" field :area_type, "state" field :area_abbreviation, "ND" - builder + builder() end diff --git a/lib/phone/nanp/us/ne.ex b/lib/phone/nanp/us/ne.ex index a546063..8f28733 100644 --- a/lib/phone/nanp/us/ne.ex +++ b/lib/phone/nanp/us/ne.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.NE do field :area_name, "Nebraska" field :area_type, "state" field :area_abbreviation, "NE" - builder + builder() end diff --git a/lib/phone/nanp/us/nh.ex b/lib/phone/nanp/us/nh.ex index 0867eea..a68b944 100644 --- a/lib/phone/nanp/us/nh.ex +++ b/lib/phone/nanp/us/nh.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.NH do field :area_name, "New Hampshire" field :area_type, "state" field :area_abbreviation, "NH" - builder + builder() end diff --git a/lib/phone/nanp/us/nj.ex b/lib/phone/nanp/us/nj.ex index 91a1c87..76930fd 100644 --- a/lib/phone/nanp/us/nj.ex +++ b/lib/phone/nanp/us/nj.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.NJ do field :area_name, "New Jersey" field :area_type, "state" field :area_abbreviation, "NJ" - builder + builder() end diff --git a/lib/phone/nanp/us/nm.ex b/lib/phone/nanp/us/nm.ex index ce82013..0b6db3b 100644 --- a/lib/phone/nanp/us/nm.ex +++ b/lib/phone/nanp/us/nm.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.NM do field :area_name, "New Mexico" field :area_type, "state" field :area_abbreviation, "NM" - builder + builder() end diff --git a/lib/phone/nanp/us/nv.ex b/lib/phone/nanp/us/nv.ex index cea3fda..de7f4b4 100644 --- a/lib/phone/nanp/us/nv.ex +++ b/lib/phone/nanp/us/nv.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.NV do field :area_name, "Nevada" field :area_type, "state" field :area_abbreviation, "NV" - builder + builder() end diff --git a/lib/phone/nanp/us/ny.ex b/lib/phone/nanp/us/ny.ex index eb52dc0..cd60b8d 100644 --- a/lib/phone/nanp/us/ny.ex +++ b/lib/phone/nanp/us/ny.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.NY do field :area_name, "New York" field :area_type, "state" field :area_abbreviation, "NY" - builder + builder() end diff --git a/lib/phone/nanp/us/oh.ex b/lib/phone/nanp/us/oh.ex index dbd340d..6f3306d 100644 --- a/lib/phone/nanp/us/oh.ex +++ b/lib/phone/nanp/us/oh.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.OH do field :area_name, "Ohio" field :area_type, "state" field :area_abbreviation, "OH" - builder + builder() end diff --git a/lib/phone/nanp/us/ok.ex b/lib/phone/nanp/us/ok.ex index da4a8c4..01732b0 100644 --- a/lib/phone/nanp/us/ok.ex +++ b/lib/phone/nanp/us/ok.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.OK do field :area_name, "Oklahoma" field :area_type, "state" field :area_abbreviation, "OK" - builder + builder() end diff --git a/lib/phone/nanp/us/or.ex b/lib/phone/nanp/us/or.ex index b2deda1..70c7d25 100644 --- a/lib/phone/nanp/us/or.ex +++ b/lib/phone/nanp/us/or.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.OR do field :area_name, "Oregon" field :area_type, "state" field :area_abbreviation, "OR" - builder + builder() end diff --git a/lib/phone/nanp/us/pa.ex b/lib/phone/nanp/us/pa.ex index cbf59a5..79a4eed 100644 --- a/lib/phone/nanp/us/pa.ex +++ b/lib/phone/nanp/us/pa.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.PA do field :area_name, "Pennsylvania" field :area_type, "state" field :area_abbreviation, "PA" - builder + builder() end diff --git a/lib/phone/nanp/us/ri.ex b/lib/phone/nanp/us/ri.ex index 076ec54..b7ec0db 100644 --- a/lib/phone/nanp/us/ri.ex +++ b/lib/phone/nanp/us/ri.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.RI do field :area_name, "Rhode Island" field :area_type, "state" field :area_abbreviation, "RI" - builder + builder() end diff --git a/lib/phone/nanp/us/sc.ex b/lib/phone/nanp/us/sc.ex index fa8fff9..c4ff68d 100644 --- a/lib/phone/nanp/us/sc.ex +++ b/lib/phone/nanp/us/sc.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.SC do field :area_name, "South Carolina" field :area_type, "state" field :area_abbreviation, "SC" - builder + builder() end diff --git a/lib/phone/nanp/us/sd.ex b/lib/phone/nanp/us/sd.ex index c7dcf96..044db01 100644 --- a/lib/phone/nanp/us/sd.ex +++ b/lib/phone/nanp/us/sd.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.SD do field :area_name, "South Dakota" field :area_type, "state" field :area_abbreviation, "SD" - builder + builder() end diff --git a/lib/phone/nanp/us/tn.ex b/lib/phone/nanp/us/tn.ex index bd85f35..85f1ae7 100644 --- a/lib/phone/nanp/us/tn.ex +++ b/lib/phone/nanp/us/tn.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.TN do field :area_name, "Tennessee" field :area_type, "state" field :area_abbreviation, "TN" - builder + builder() end diff --git a/lib/phone/nanp/us/tx.ex b/lib/phone/nanp/us/tx.ex index 523f7e7..23b2a98 100644 --- a/lib/phone/nanp/us/tx.ex +++ b/lib/phone/nanp/us/tx.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.TX do field :area_name, "Texas" field :area_type, "state" field :area_abbreviation, "TX" - builder + builder() end diff --git a/lib/phone/nanp/us/ut.ex b/lib/phone/nanp/us/ut.ex index 9f8e590..d7e0879 100644 --- a/lib/phone/nanp/us/ut.ex +++ b/lib/phone/nanp/us/ut.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.UT do field :area_name, "Utah" field :area_type, "state" field :area_abbreviation, "UT" - builder + builder() end diff --git a/lib/phone/nanp/us/va.ex b/lib/phone/nanp/us/va.ex index 34c0b8e..9b8bcb6 100644 --- a/lib/phone/nanp/us/va.ex +++ b/lib/phone/nanp/us/va.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.VA do field :area_name, "Virginia" field :area_type, "state" field :area_abbreviation, "VA" - builder + builder() end diff --git a/lib/phone/nanp/us/vt.ex b/lib/phone/nanp/us/vt.ex index fbe540d..c95abc4 100644 --- a/lib/phone/nanp/us/vt.ex +++ b/lib/phone/nanp/us/vt.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.VT do field :area_name, "Vermont" field :area_type, "state" field :area_abbreviation, "VT" - builder + builder() end diff --git a/lib/phone/nanp/us/wa.ex b/lib/phone/nanp/us/wa.ex index 2d912d2..2b29cd6 100644 --- a/lib/phone/nanp/us/wa.ex +++ b/lib/phone/nanp/us/wa.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.WA do field :area_name, "Washington" field :area_type, "state" field :area_abbreviation, "WA" - builder + builder() end diff --git a/lib/phone/nanp/us/wi.ex b/lib/phone/nanp/us/wi.ex index 7688eed..3cee255 100644 --- a/lib/phone/nanp/us/wi.ex +++ b/lib/phone/nanp/us/wi.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.WI do field :area_name, "Wisconsin" field :area_type, "state" field :area_abbreviation, "WI" - builder + builder() end diff --git a/lib/phone/nanp/us/wv.ex b/lib/phone/nanp/us/wv.ex index 6ba9b18..977b027 100644 --- a/lib/phone/nanp/us/wv.ex +++ b/lib/phone/nanp/us/wv.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.WV do field :area_name, "West Virginia" field :area_type, "state" field :area_abbreviation, "WV" - builder + builder() end diff --git a/lib/phone/nanp/us/wy.ex b/lib/phone/nanp/us/wy.ex index 5489890..6ed1c9a 100644 --- a/lib/phone/nanp/us/wy.ex +++ b/lib/phone/nanp/us/wy.ex @@ -4,5 +4,5 @@ defmodule Phone.NANP.US.WY do field :area_name, "Wyoming" field :area_type, "state" field :area_abbreviation, "WY" - builder + builder() end diff --git a/mix.exs b/mix.exs index 7a82815..e203232 100644 --- a/mix.exs +++ b/mix.exs @@ -7,19 +7,19 @@ defmodule Phonex.Mixfile do elixir: ">= 1.1.0", build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, - description: description, - package: package, + description: description(), + package: package(), source_url: "https://github.com/fcevado/phone", - test_coverage: coverage, - deps: deps] + test_coverage: coverage(), + deps: deps()] end defp package do [ - files: files, + files: files(), maintainers: ["Flávio Moreira Vieira"], licenses: ["Apache 2.0"], - links: links + links: links() ] end From 800a12858ef658581bb446be81d2d27cd3633fb7 Mon Sep 17 00:00:00 2001 From: Cevado Date: Sun, 15 Jan 2017 15:40:19 -0200 Subject: [PATCH 2/2] update to 0.3.10 --- .travis.yml | 1 + CHANGELOG.md | 4 ++++ README.md | 1 - lib/phone.ex | 2 +- mix.exs | 8 ++++---- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index dcd8f71..4b87dd5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: elixir elixir: - 1.2.6 - 1.3.2 + - 1.4.0 otp_release: - 18.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bc3d26..9483477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ #Changelog +##v0.3.10: + * Correct number validation for Norway. + * Correct Ireland area codes validation. + ##v0.3.9: * Add and correct various area codes for NANP. * Better test coverage for NANP numbers. diff --git a/README.md b/README.md index 690ca7f..28d9fda 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Phone [![Build Status](https://travis-ci.org/fcevado/phone.svg?branch=master)](https://travis-ci.org/fcevado/phone) [![Coverage Status](https://coveralls.io/repos/github/fcevado/phone/badge.svg?branch=master)](https://coveralls.io/github/fcevado/phone?branch=master) -[![Ebert](https://ebertapp.io/github/fcevado/phone.svg)](https://ebertapp.io/github/fcevado/phone.svg) [![Phone version](https://img.shields.io/hexpm/v/phone.svg)](https://hex.pm/packages/phone) [![Inline docs](http://inch-ci.org/github/fcevado/phone.svg?branch=master)](http://inch-ci.org/github/fcevado/phone) [![Hex.pm](https://img.shields.io/hexpm/dt/phone.svg)](https://hex.pm/packages/phone) diff --git a/lib/phone.ex b/lib/phone.ex index 09006a9..f01cde5 100644 --- a/lib/phone.ex +++ b/lib/phone.ex @@ -109,6 +109,6 @@ defmodule Phone do @spec parse(pos_integer, Atom.t) :: {:ok, Map.t} @spec parse!(String.t, Atom.t) :: Map.t @spec parse!(pos_integer, Atom.t) :: Map.t - country_parser + country_parser() end diff --git a/mix.exs b/mix.exs index e203232..d2fb6df 100644 --- a/mix.exs +++ b/mix.exs @@ -3,7 +3,7 @@ defmodule Phonex.Mixfile do def project do [app: :phone, - version: "0.3.9", + version: "0.3.10", elixir: ">= 1.1.0", build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, @@ -55,10 +55,10 @@ defmodule Phonex.Mixfile do defp deps do [ - {:coverex, "1.4.10", only: :test}, - {:credo, "0.5.2", only: :dev}, + {:coverex, "1.4.11", only: :test}, + {:credo, "0.5.3", only: :dev}, {:earmark, "1.0.3", only: :dev}, - {:ex_doc, "0.14.3", only: :dev}, + {:ex_doc, "0.14.5", only: :dev}, {:inch_ex, "0.5.5", only: :docs} ] end