phonie 3.1.5 → 3.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +6 -0
- data/lib/phonie/country.rb +3 -3
- data/lib/phonie/data/phone_countries.yml +2 -3
- data/lib/phonie/phone.rb +3 -3
- data/lib/phonie/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbb6d7902284f4bf12daeb9345220012cc06a8f7
|
4
|
+
data.tar.gz: 14f485bc407de6904c6c69c1a225ac3ed6af18b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f536a324f1137921560cc4f44dfa7225ff16a60bb694768e15f537632c00a4568d36a245c52229a27909a063529d5c4d57317ca8d551bd6412ced2b860cf2e6
|
7
|
+
data.tar.gz: ce2f2c947262935e1d7c9526fd246ec20336bb040974ffcd6c0dd364d441872852e2174c7f4d3ded3faf97bdbce0ea5a801fa9f15bfd03bdb089577c540ec5d6
|
data/Changelog.md
CHANGED
data/lib/phonie/country.rb
CHANGED
@@ -6,7 +6,7 @@ module Phonie
|
|
6
6
|
extend Forwardable
|
7
7
|
|
8
8
|
attr_reader :name, :country_code, :char_2_code, :iso_3166_code, :parser
|
9
|
-
|
9
|
+
|
10
10
|
def initialize(params)
|
11
11
|
@name = params[:name]
|
12
12
|
@country_code = params[:country_code]
|
@@ -17,12 +17,12 @@ module Phonie
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def_delegators :parser, :is_mobile?, :possible_valid_number?,
|
20
|
-
|
20
|
+
:is_valid_number?, :parse
|
21
21
|
|
22
22
|
def self.all
|
23
23
|
@@all ||= begin
|
24
24
|
YAML.load_file(Phonie.configuration.data_file_path).collect do |country_params|
|
25
|
-
|
25
|
+
Country.new(country_params)
|
26
26
|
end.select {|country| country.valid? }
|
27
27
|
end
|
28
28
|
end
|
@@ -811,8 +811,7 @@
|
|
811
811
|
:iso_3166_code: NZ
|
812
812
|
:name: New Zealand
|
813
813
|
:international_dialing_prefix: '00'
|
814
|
-
:area_code:
|
815
|
-
- 234679
|
814
|
+
:area_code: '[234679]'
|
816
815
|
:local_number_format: \d{7,9}
|
817
816
|
:mobile_format: 2\d{7,9}
|
818
817
|
:number_format: \d{8,10}
|
@@ -1189,7 +1188,7 @@
|
|
1189
1188
|
:char_2_code: '0'
|
1190
1189
|
:iso_3166_code: IL
|
1191
1190
|
:name: Israel
|
1192
|
-
:international_dialing_prefix: '00'
|
1191
|
+
:international_dialing_prefix: '00|012|013|014|015|018|019'
|
1193
1192
|
:area_code: '[2-46-9]|5\d'
|
1194
1193
|
:local_number_format: \d{7}
|
1195
1194
|
:mobile_format: 5\d{8}
|
data/lib/phonie/phone.rb
CHANGED
@@ -123,7 +123,7 @@ module Phonie
|
|
123
123
|
|
124
124
|
def normalize_args(args)
|
125
125
|
hash = if args.first.respond_to?(:key?)
|
126
|
-
|
126
|
+
args.first
|
127
127
|
else
|
128
128
|
{}.tap do |h|
|
129
129
|
h[:number] = args[0] if args.length > 0
|
@@ -131,7 +131,7 @@ module Phonie
|
|
131
131
|
h[:country_code] = args[2] if args.length > 2
|
132
132
|
h[:extension] = args[3] if args.length > 3
|
133
133
|
h[:country] = args[4] if args.length > 4
|
134
|
-
|
134
|
+
end
|
135
135
|
end
|
136
136
|
|
137
137
|
defaults.merge(hash)
|
@@ -139,7 +139,7 @@ module Phonie
|
|
139
139
|
|
140
140
|
def validate
|
141
141
|
[:country_code, :area_code, :number].each do |field|
|
142
|
-
|
142
|
+
errors[field] = ["can't be blank"] if send(field).to_s == ''
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
data/lib/phonie/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phonie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomislav Car
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-
|
15
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activemodel
|