phonelib 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/data/PhoneNumberMetaData.xml +45 -39
- data/data/phone_data.yml +1058 -1058
- data/lib/phonelib/phone.rb +5 -1
- data/lib/phonelib/version.rb +1 -1
- data/lib/tasks/phonelib_tasks.rake +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +28 -16
- data/test/dummy/log/test.log +4499 -1193
- data/test/phonelib_test.rb +5 -0
- metadata +121 -114
data/lib/phonelib/phone.rb
CHANGED
@@ -163,7 +163,11 @@ module Phonelib
|
|
163
163
|
# Gets matched number formating rule or default one
|
164
164
|
def get_number_format(format_data)
|
165
165
|
if format_data
|
166
|
-
format_data.find
|
166
|
+
format_data.find do |format|
|
167
|
+
(format[:leadingDigits].nil? \
|
168
|
+
|| /^#{format[:leadingDigits]}/ =~ @national_number) \
|
169
|
+
&& /^#{format[:pattern]}$/ =~ @national_number
|
170
|
+
end
|
167
171
|
else
|
168
172
|
Core::DEFAULT_NUMBER_FORMAT
|
169
173
|
end
|
data/lib/phonelib/version.rb
CHANGED
Binary file
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -1,19 +1,31 @@
|
|
1
1
|
Connecting to database specified by database.yml
|
2
|
-
[1m[36m (0.
|
3
|
-
[1m[35m (
|
4
|
-
[1m[36m (
|
5
|
-
[1m[35m (
|
6
|
-
|
7
|
-
[1m[
|
8
|
-
[1m[
|
9
|
-
[1m[
|
2
|
+
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
3
|
+
[1m[35m (7.4ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
4
|
+
[1m[36m (2.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
5
|
+
[1m[35m (0.1ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
6
|
+
Migrating to CreatePhones (20130121173847)
|
7
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
8
|
+
[1m[35m (0.8ms)[0m CREATE TABLE "phones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
9
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20130121173847')[0m
|
10
|
+
[1m[35m (4.1ms)[0m commit transaction
|
11
|
+
Migrating to AddPossibleNumberToPhone (20130122075331)
|
12
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
13
|
+
[1m[35m (0.6ms)[0m ALTER TABLE "phones" ADD "possible_number" varchar(255)
|
14
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20130122075331')[0m
|
15
|
+
[1m[35m (2.7ms)[0m commit transaction
|
16
|
+
[1m[36m (0.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
10
17
|
Connecting to database specified by database.yml
|
11
|
-
[1m[36m (0.
|
12
|
-
[1m[35m (
|
13
|
-
[1m[36m (3.
|
14
|
-
[1m[35m (
|
15
|
-
[1m[36m (
|
16
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
17
|
-
[1m[36m (1.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20130122075331')[0m
|
18
|
-
[1m[35m (4.9ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20130121173847')
|
18
|
+
[1m[36m (0.7ms)[0m [1mselect sqlite_version(*)[0m
|
19
|
+
[1m[35m (5.1ms)[0m DROP TABLE "phones"
|
20
|
+
[1m[36m (3.3ms)[0m [1mCREATE TABLE "phones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "possible_number" varchar(255)) [0m
|
21
|
+
[1m[35m (0.2ms)[0m SELECT version FROM "schema_migrations"
|
22
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
19
23
|
Connecting to database specified by database.yml
|
24
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
25
|
+
[1m[35m (0.3ms)[0m select sqlite_version(*)
|
26
|
+
[1m[36m (5.1ms)[0m [1mCREATE TABLE "phones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "possible_number" varchar(255)) [0m
|
27
|
+
[1m[35m (2.3ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
28
|
+
[1m[36m (3.4ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
29
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
30
|
+
[1m[36m (2.4ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20130122075331')[0m
|
31
|
+
[1m[35m (3.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20130121173847')
|