phonelib 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +59 -75
- data/lib/phonelib/core.rb +2 -0
- data/lib/phonelib/phone.rb +17 -23
- data/lib/phonelib/version.rb +2 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +274 -0
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -1,137 +1,121 @@
|
|
1
|
-
|
1
|
+
== Phonelib
|
2
2
|
|
3
3
|
{<img src="https://travis-ci.org/daddyz/phonelib.png?branch=master" alt="Build Status" />}[http://travis-ci.org/daddyz/phonelib]
|
4
|
+
{<img src="https://badge.fury.io/rb/phonelib.png" alt="Gem Version" />}[http://badge.fury.io/rb/phonelib]
|
5
|
+
{<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/daddyz/phonelib]
|
4
6
|
|
5
|
-
Phonelib is a gem allowing you to validate phone number. All validations are based on
|
7
|
+
Phonelib is a gem allowing you to validate phone number. All validations are based on {Google libphonenumber}[http://code.google.com/p/libphonenumber/].
|
6
8
|
Currently it can make only basic validation and still not include all Google's library functions.
|
7
9
|
|
8
|
-
|
10
|
+
== Information
|
9
11
|
|
10
|
-
|
12
|
+
=== RDoc
|
11
13
|
|
12
14
|
RDoc documentation can be found here
|
13
|
-
http://rubydoc.info/
|
15
|
+
http://rubydoc.info/gems/phonelib/frames
|
14
16
|
|
15
|
-
|
17
|
+
=== Bug reports
|
16
18
|
|
17
19
|
If you discover a problem with Evercookie gem, let us know about it.
|
18
20
|
https://github.com/daddyz/phonelib/issues
|
19
21
|
|
20
|
-
|
22
|
+
=== Example application
|
21
23
|
|
22
24
|
You can see an example of phonelib model validation working in test/dummy application of this gem
|
23
25
|
|
24
|
-
|
26
|
+
== Getting started
|
25
27
|
|
26
28
|
Phonelib was written and tested on Rails >= 3.1. You can install it by adding in to your Gemfile with:
|
27
29
|
|
28
|
-
|
29
|
-
gem 'phonelib'
|
30
|
-
```
|
30
|
+
gem 'phonelib'
|
31
31
|
|
32
32
|
Run the bundle command to install it.
|
33
33
|
|
34
|
-
|
34
|
+
=== ActiveRecord Integration
|
35
35
|
|
36
36
|
This gem adds validator for active record.
|
37
37
|
Basic usage:
|
38
|
-
|
39
|
-
validates :attribute, phone: true
|
40
|
-
|
38
|
+
|
39
|
+
validates :attribute, phone: true
|
40
|
+
|
41
41
|
This will enable Phonelib validator for field "attribute". This validator checks that passed value is valid phone number.
|
42
42
|
Please note that passing blank value also fails.
|
43
43
|
|
44
44
|
Additional options:
|
45
|
-
```ruby
|
46
|
-
validates :attribute, phone: { possible: true, allow_blank: true }
|
47
|
-
```
|
48
|
-
`possible: true` - enables validation to check whether the passed number is a possible phone number (not strict check).
|
49
|
-
Refer to [Google libphonenumber](http://code.google.com/p/libphonenumber/) for more information on it.
|
50
45
|
|
51
|
-
|
46
|
+
validates :attribute, phone: { possible: true, allow_blank: true }
|
47
|
+
|
48
|
+
<tt>possible: true</tt> - enables validation to check whether the passed number is a possible phone number (not strict check).
|
49
|
+
Refer to {Google libphonenumber}[http://code.google.com/p/libphonenumber/] for more information on it.
|
50
|
+
|
51
|
+
<tt>allow_blank: true</tt> - when no value passed then validation passes
|
52
52
|
|
53
|
-
|
53
|
+
=== Basic usage
|
54
54
|
|
55
55
|
To check if phone number is valid simply run:
|
56
56
|
|
57
|
-
|
58
|
-
Phonelib.valid?('123456789') #returns true or false
|
59
|
-
```
|
57
|
+
Phonelib.valid?('123456789') # returns true or false
|
60
58
|
|
61
59
|
Additional methods:
|
62
60
|
|
63
|
-
|
64
|
-
Phonelib.
|
65
|
-
Phonelib.
|
66
|
-
Phonelib.
|
67
|
-
Phonelib.impossible? '123456789' # checks if passed value is impossible number
|
68
|
-
```
|
61
|
+
Phonelib.valid? '123456789' # checks if passed value is valid number
|
62
|
+
Phonelib.invalid? '123456789' # checks if passed value is invalid number
|
63
|
+
Phonelib.possible? '123456789' # checks if passed value is possible number
|
64
|
+
Phonelib.impossible? '123456789' # checks if passed value is impossible number
|
69
65
|
|
70
66
|
There is also option to check if provided phone is valid for specified country.
|
71
67
|
Country should be specified as two letters country code (like "US" for United States).
|
72
68
|
|
73
|
-
|
74
|
-
Phonelib.
|
75
|
-
Phonelib.invalid_for_country? '123456789', 'XX' # checks if passed value is invalid number for specified country
|
76
|
-
```
|
69
|
+
Phonelib.valid_for_country? '123456789', 'XX' # checks if passed value is valid number for specified country
|
70
|
+
Phonelib.invalid_for_country? '123456789', 'XX' # checks if passed value is invalid number for specified country
|
77
71
|
|
78
72
|
Additionally you can run:
|
79
73
|
|
80
|
-
|
81
|
-
phone = Phonelib.parse('123456789')
|
82
|
-
```
|
74
|
+
phone = Phonelib.parse('123456789')
|
83
75
|
|
84
|
-
Returned value is object of
|
76
|
+
Returned value is object of <tt>Phonelib::Phone</tt> class which have following methods:
|
85
77
|
|
86
|
-
|
87
|
-
|
88
|
-
phone.
|
89
|
-
phone.
|
90
|
-
phone.
|
91
|
-
phone.impossible?
|
78
|
+
# basic validation methods
|
79
|
+
phone.valid?
|
80
|
+
phone.invalid?
|
81
|
+
phone.possible?
|
82
|
+
phone.impossible?
|
92
83
|
|
93
|
-
# validations for countries
|
94
|
-
phone.valid_for_country? 'XX'
|
95
|
-
phone.invalid_for_country? 'XX'
|
96
|
-
```
|
84
|
+
# validations for countries
|
85
|
+
phone.valid_for_country? 'XX'
|
86
|
+
phone.invalid_for_country? 'XX'
|
97
87
|
|
98
88
|
You can also fetch matched valid phone types
|
99
89
|
|
100
|
-
|
101
|
-
phone.
|
102
|
-
phone.type # returns first element from array of all valid types
|
103
|
-
```
|
90
|
+
phone.types # returns array of all valid types
|
91
|
+
phone.type # returns first element from array of all valid types
|
104
92
|
|
105
93
|
Possible types:
|
106
|
-
*
|
107
|
-
*
|
108
|
-
*
|
109
|
-
*
|
110
|
-
*
|
111
|
-
*
|
112
|
-
*
|
113
|
-
*
|
114
|
-
*
|
115
|
-
*
|
116
|
-
*
|
94
|
+
* <tt>:premiumRate</tt> - Premium Rate
|
95
|
+
* <tt>:tollFree</tt> - Toll Free
|
96
|
+
* <tt>:sharedCost</tt> - Shared Cost
|
97
|
+
* <tt>:voip</tt> - VoIP
|
98
|
+
* <tt>:personalNumber</tt> - Personal Number
|
99
|
+
* <tt>:pager</tt> - Pager
|
100
|
+
* <tt>:uan</tt> - UAN
|
101
|
+
* <tt>:voicemail</tt> - VoiceMail
|
102
|
+
* <tt>:fixedLine</tt> - Fixed Line
|
103
|
+
* <tt>:mobile</tt> - Mobile
|
104
|
+
* <tt>:fixedOrMobile</tt> - Fixed Line or Mobile (if both mobile and fixed pattern matches)
|
117
105
|
|
118
106
|
Also you can fetch all matched countries
|
119
107
|
|
120
|
-
|
121
|
-
phone.
|
122
|
-
phone.country # returns first element from array of all matched countries
|
123
|
-
```
|
108
|
+
phone.countries # returns array of all matched countries
|
109
|
+
phone.country # returns first element from array of all matched countries
|
124
110
|
|
125
111
|
Phone class has following attributes
|
126
112
|
|
127
|
-
|
128
|
-
phone.
|
129
|
-
phone.
|
130
|
-
phone.national_number # phone number without country code
|
131
|
-
```
|
113
|
+
phone.original # string that was passed as phone number
|
114
|
+
phone.sanitized # sanitized phone number (only digits left)
|
115
|
+
phone.national_number # phone number without country code
|
132
116
|
|
133
|
-
|
117
|
+
=== How it works
|
134
118
|
|
135
119
|
Gem includes data from Google libphonenumber which has regex patterns for validations.
|
136
120
|
Valid patterns are more specific to phone type and country.
|
137
|
-
Possible patterns as usual are patterns with number of digits in number.
|
121
|
+
Possible patterns as usual are patterns with number of digits in number.
|
data/lib/phonelib/core.rb
CHANGED
@@ -4,6 +4,7 @@ module Phonelib
|
|
4
4
|
# variable will include hash with data for validation
|
5
5
|
@@phone_data = nil
|
6
6
|
|
7
|
+
# :stopdoc:
|
7
8
|
# gem constants definition
|
8
9
|
# constants for phone types
|
9
10
|
GENERAL = :generalDesc
|
@@ -43,6 +44,7 @@ module Phonelib
|
|
43
44
|
NOT_FOR_CHECK = [
|
44
45
|
:generalDesc, :emergency, :shortCode, :fixedLine, :mobile, :fixedOrMobile
|
45
46
|
]
|
47
|
+
# :startdoc:
|
46
48
|
|
47
49
|
# method for parsing phone number
|
48
50
|
# on first run fills @@phone_data with data present in yaml file
|
data/lib/phonelib/phone.rb
CHANGED
@@ -101,7 +101,6 @@ module Phonelib
|
|
101
101
|
|
102
102
|
# Returns all valid and possible phone number types for currently parsed
|
103
103
|
# phone for provided data hash.
|
104
|
-
# Forked from original Google libphonenumber library.
|
105
104
|
def get_all_number_types(number, data)
|
106
105
|
response = {valid: [], possible: []}
|
107
106
|
|
@@ -109,32 +108,27 @@ module Phonelib
|
|
109
108
|
return response unless number_valid_and_possible?(number,
|
110
109
|
data[Core::GENERAL])
|
111
110
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
111
|
+
if data[Core::FIXED_LINE] == data[Core::MOBILE]
|
112
|
+
same_fixed_and_mobile = true
|
113
|
+
additional_check = [ Core::FIXED_LINE ]
|
114
|
+
else
|
115
|
+
same_fixed_and_mobile = false
|
116
|
+
additional_check = [ Core::FIXED_LINE, Core::MOBILE ]
|
118
117
|
end
|
119
118
|
|
120
|
-
|
121
|
-
if data[
|
122
|
-
response[:valid] << Core::FIXED_OR_MOBILE
|
123
|
-
else
|
124
|
-
response[:valid] << Core::FIXED_LINE
|
125
|
-
end
|
126
|
-
elsif number_valid_and_possible?(number, data[Core::MOBILE])
|
127
|
-
response[:valid] << Core::MOBILE
|
128
|
-
end
|
119
|
+
(Core::TYPES.keys - Core::NOT_FOR_CHECK + additional_check).each do |type|
|
120
|
+
next if data[type].nil? || data[type].empty?
|
129
121
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
122
|
+
if number_possible?(number, data[type])
|
123
|
+
if same_fixed_and_mobile && same_types.include?(type)
|
124
|
+
put_type = Core::FIXED_OR_MOBILE
|
125
|
+
else
|
126
|
+
put_type = type
|
127
|
+
end
|
128
|
+
response[:possible] << put_type
|
129
|
+
response[:valid] << put_type if number_valid_and_possible?(number,
|
130
|
+
data[type])
|
135
131
|
end
|
136
|
-
elsif number_possible?(number, data[Core::MOBILE])
|
137
|
-
response[:possible] << Core::MOBILE
|
138
132
|
end
|
139
133
|
|
140
134
|
response
|
data/lib/phonelib/version.rb
CHANGED
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/test/dummy/log/test.log
CHANGED
@@ -4625,3 +4625,277 @@ Processing by PhonesController#update as HTML
|
|
4625
4625
|
Redirected to http://test.host/phones/450723037
|
4626
4626
|
Completed 302 Found in 6ms (ActiveRecord: 0.2ms)
|
4627
4627
|
[1m[35m (0.1ms)[0m rollback transaction
|
4628
|
+
Connecting to database specified by database.yml
|
4629
|
+
[1m[36m (0.5ms)[0m [1mbegin transaction[0m
|
4630
|
+
[1m[35mFixture Delete (0.9ms)[0m DELETE FROM "phones"
|
4631
|
+
[1m[36mFixture Insert (2.5ms)[0m [1mINSERT INTO "phones" ("number", "possible_number", "created_at", "updated_at", "id") VALUES ('972541234567', '972541234567', '2013-01-29 18:16:32', '2013-01-29 18:16:32', 450723037)[0m
|
4632
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "phones" ("number", "created_at", "updated_at", "id") VALUES ('wrong', '2013-01-29 18:16:32', '2013-01-29 18:16:32', 667262234)
|
4633
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "phones" ("number", "created_at", "updated_at", "id") VALUES ('972541234567', '2013-01-29 18:16:32', '2013-01-29 18:16:32', 512636273)[0m
|
4634
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "phones" ("possible_number", "created_at", "updated_at", "id") VALUES ('972541234567', '2013-01-29 18:16:32', '2013-01-29 18:16:32', 23760034)
|
4635
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "phones" ("number", "possible_number", "created_at", "updated_at", "id") VALUES ('972541234567', 'wrong', '2013-01-29 18:16:32', '2013-01-29 18:16:32', 703612349)[0m
|
4636
|
+
[1m[35m (1.3ms)[0m commit transaction
|
4637
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4638
|
+
[1m[35mPhone Load (0.4ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 512636273]]
|
4639
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
4640
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
4641
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4642
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4643
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
4644
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
4645
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4646
|
+
[1m[35m (0.0ms)[0m begin transaction
|
4647
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
4648
|
+
[1m[35mSQL (4.6ms)[0m INSERT INTO "phones" ("created_at", "number", "possible_number", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 29 Jan 2013 18:16:33 UTC +00:00], ["number", "972541234567"], ["possible_number", nil], ["updated_at", Tue, 29 Jan 2013 18:16:33 UTC +00:00]]
|
4649
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
4650
|
+
[1m[35m (0.8ms)[0m rollback transaction
|
4651
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4652
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
|
4653
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
4654
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
4655
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4656
|
+
[1m[35m (0.0ms)[0m begin transaction
|
4657
|
+
[1m[36mPhone Load (0.1ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", 23760034]]
|
4658
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
4659
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
4660
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4661
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4662
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 667262234]]
|
4663
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
4664
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
4665
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4666
|
+
[1m[35m (0.0ms)[0m begin transaction
|
4667
|
+
[1m[36mPhone Load (0.1ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", 703612349]]
|
4668
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
4669
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
4670
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4671
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4672
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4673
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4674
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4675
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4676
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4677
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4678
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4679
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4680
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4681
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4682
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4683
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4684
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4685
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4686
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4687
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4688
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4689
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4690
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4691
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4692
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4693
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4694
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4695
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4696
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4697
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4698
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4699
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4700
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4701
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4702
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4703
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4704
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
|
4705
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "phones" [0m
|
4706
|
+
Processing by PhonesController#create as HTML
|
4707
|
+
Parameters: {"phone"=>{"number"=>"972541234567"}}
|
4708
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
4709
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "phones" ("created_at", "number", "possible_number", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Tue, 29 Jan 2013 18:16:33 UTC +00:00], ["number", "972541234567"], ["possible_number", nil], ["updated_at", Tue, 29 Jan 2013 18:16:33 UTC +00:00]]
|
4710
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
4711
|
+
Redirected to http://test.host/phones/980190963
|
4712
|
+
Completed 302 Found in 8ms (ActiveRecord: 0.8ms)
|
4713
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "phones" [0m
|
4714
|
+
[1m[35m (0.9ms)[0m rollback transaction
|
4715
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4716
|
+
[1m[35mPhone Load (0.2ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
|
4717
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "phones" [0m
|
4718
|
+
Processing by PhonesController#destroy as HTML
|
4719
|
+
Parameters: {"id"=>"450723037"}
|
4720
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", "450723037"]]
|
4721
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
4722
|
+
[1m[35mSQL (0.4ms)[0m DELETE FROM "phones" WHERE "phones"."id" = ? [["id", 450723037]]
|
4723
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
4724
|
+
Redirected to http://test.host/phones
|
4725
|
+
Completed 302 Found in 5ms (ActiveRecord: 0.6ms)
|
4726
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "phones"
|
4727
|
+
[1m[36m (0.5ms)[0m [1mrollback transaction[0m
|
4728
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4729
|
+
[1m[36mPhone Load (0.1ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", 450723037]]
|
4730
|
+
Processing by PhonesController#edit as HTML
|
4731
|
+
Parameters: {"id"=>"450723037"}
|
4732
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", "450723037"]]
|
4733
|
+
Rendered phones/_form.html.erb (64.7ms)
|
4734
|
+
Completed 200 OK in 98ms (Views: 96.2ms | ActiveRecord: 0.1ms)
|
4735
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4736
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4737
|
+
[1m[36mPhone Load (0.1ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", 450723037]]
|
4738
|
+
Processing by PhonesController#index as HTML
|
4739
|
+
[1m[35mPhone Load (0.2ms)[0m SELECT "phones".* FROM "phones"
|
4740
|
+
Completed 200 OK in 14ms (Views: 12.0ms | ActiveRecord: 0.2ms)
|
4741
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4742
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4743
|
+
[1m[36mPhone Load (0.2ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", 450723037]]
|
4744
|
+
Processing by PhonesController#new as HTML
|
4745
|
+
Rendered phones/_form.html.erb (3.5ms)
|
4746
|
+
Completed 200 OK in 9ms (Views: 8.5ms | ActiveRecord: 0.0ms)
|
4747
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4748
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4749
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
|
4750
|
+
Processing by PhonesController#show as HTML
|
4751
|
+
Parameters: {"id"=>"450723037"}
|
4752
|
+
[1m[36mPhone Load (0.1ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", "450723037"]]
|
4753
|
+
Completed 200 OK in 8ms (Views: 5.7ms | ActiveRecord: 0.1ms)
|
4754
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4755
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4756
|
+
[1m[35mPhone Load (0.2ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
|
4757
|
+
Processing by PhonesController#update as HTML
|
4758
|
+
Parameters: {"phone"=>{"number"=>"972541234567"}, "id"=>"450723037"}
|
4759
|
+
[1m[36mPhone Load (0.1ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", "450723037"]]
|
4760
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
4761
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
4762
|
+
Redirected to http://test.host/phones/450723037
|
4763
|
+
Completed 302 Found in 7ms (ActiveRecord: 0.2ms)
|
4764
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4765
|
+
Connecting to database specified by database.yml
|
4766
|
+
[1m[36m (0.5ms)[0m [1mbegin transaction[0m
|
4767
|
+
[1m[35mFixture Delete (0.4ms)[0m DELETE FROM "phones"
|
4768
|
+
[1m[36mFixture Insert (0.3ms)[0m [1mINSERT INTO "phones" ("number", "possible_number", "created_at", "updated_at", "id") VALUES ('972541234567', '972541234567', '2013-01-30 07:23:21', '2013-01-30 07:23:21', 450723037)[0m
|
4769
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "phones" ("number", "created_at", "updated_at", "id") VALUES ('wrong', '2013-01-30 07:23:21', '2013-01-30 07:23:21', 667262234)
|
4770
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "phones" ("number", "created_at", "updated_at", "id") VALUES ('972541234567', '2013-01-30 07:23:21', '2013-01-30 07:23:21', 512636273)[0m
|
4771
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "phones" ("possible_number", "created_at", "updated_at", "id") VALUES ('972541234567', '2013-01-30 07:23:21', '2013-01-30 07:23:21', 23760034)
|
4772
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "phones" ("number", "possible_number", "created_at", "updated_at", "id") VALUES ('972541234567', 'wrong', '2013-01-30 07:23:21', '2013-01-30 07:23:21', 703612349)[0m
|
4773
|
+
[1m[35m (4.7ms)[0m commit transaction
|
4774
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4775
|
+
[1m[35mPhone Load (0.4ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 512636273]]
|
4776
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
4777
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
4778
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4779
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4780
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
4781
|
+
[1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
4782
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4783
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4784
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
4785
|
+
[1m[35mSQL (2.3ms)[0m INSERT INTO "phones" ("created_at", "number", "possible_number", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Wed, 30 Jan 2013 07:23:23 UTC +00:00], ["number", "972541234567"], ["possible_number", nil], ["updated_at", Wed, 30 Jan 2013 07:23:23 UTC +00:00]]
|
4786
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
4787
|
+
[1m[35m (2.9ms)[0m rollback transaction
|
4788
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4789
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
|
4790
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
4791
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
4792
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4793
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4794
|
+
[1m[36mPhone Load (0.2ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", 23760034]]
|
4795
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
4796
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
4797
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4798
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
4799
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 667262234]]
|
4800
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
4801
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
4802
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4803
|
+
[1m[35m (0.0ms)[0m begin transaction
|
4804
|
+
[1m[36mPhone Load (0.1ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", 703612349]]
|
4805
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
4806
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
4807
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4808
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4809
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4810
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4811
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4812
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4813
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4814
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4815
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4816
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4817
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4818
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4819
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4820
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4821
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4822
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4823
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4824
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4825
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4826
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4827
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4828
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4829
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4830
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4831
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4832
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4833
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4834
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4835
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4836
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4837
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4838
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4839
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4840
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4841
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
|
4842
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "phones" [0m
|
4843
|
+
Processing by PhonesController#create as HTML
|
4844
|
+
Parameters: {"phone"=>{"number"=>"972541234567"}}
|
4845
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
4846
|
+
[1m[36mSQL (0.7ms)[0m [1mINSERT INTO "phones" ("created_at", "number", "possible_number", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Wed, 30 Jan 2013 07:23:23 UTC +00:00], ["number", "972541234567"], ["possible_number", nil], ["updated_at", Wed, 30 Jan 2013 07:23:23 UTC +00:00]]
|
4847
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
4848
|
+
Redirected to http://test.host/phones/980190963
|
4849
|
+
Completed 302 Found in 10ms (ActiveRecord: 0.8ms)
|
4850
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "phones" [0m
|
4851
|
+
[1m[35m (2.3ms)[0m rollback transaction
|
4852
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4853
|
+
[1m[35mPhone Load (0.2ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
|
4854
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "phones" [0m
|
4855
|
+
Processing by PhonesController#destroy as HTML
|
4856
|
+
Parameters: {"id"=>"450723037"}
|
4857
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", "450723037"]]
|
4858
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
4859
|
+
[1m[35mSQL (0.4ms)[0m DELETE FROM "phones" WHERE "phones"."id" = ? [["id", 450723037]]
|
4860
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
4861
|
+
Redirected to http://test.host/phones
|
4862
|
+
Completed 302 Found in 4ms (ActiveRecord: 0.6ms)
|
4863
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "phones"
|
4864
|
+
[1m[36m (0.8ms)[0m [1mrollback transaction[0m
|
4865
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4866
|
+
[1m[36mPhone Load (0.1ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", 450723037]]
|
4867
|
+
Processing by PhonesController#edit as HTML
|
4868
|
+
Parameters: {"id"=>"450723037"}
|
4869
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", "450723037"]]
|
4870
|
+
Rendered phones/_form.html.erb (62.2ms)
|
4871
|
+
Completed 200 OK in 92ms (Views: 90.7ms | ActiveRecord: 0.1ms)
|
4872
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4873
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4874
|
+
[1m[36mPhone Load (0.2ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", 450723037]]
|
4875
|
+
Processing by PhonesController#index as HTML
|
4876
|
+
[1m[35mPhone Load (0.2ms)[0m SELECT "phones".* FROM "phones"
|
4877
|
+
Completed 200 OK in 13ms (Views: 11.2ms | ActiveRecord: 0.2ms)
|
4878
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
4879
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4880
|
+
[1m[36mPhone Load (0.2ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", 450723037]]
|
4881
|
+
Processing by PhonesController#new as HTML
|
4882
|
+
Rendered phones/_form.html.erb (3.6ms)
|
4883
|
+
Completed 200 OK in 11ms (Views: 9.9ms | ActiveRecord: 0.0ms)
|
4884
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4885
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4886
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
|
4887
|
+
Processing by PhonesController#show as HTML
|
4888
|
+
Parameters: {"id"=>"450723037"}
|
4889
|
+
[1m[36mPhone Load (0.1ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", "450723037"]]
|
4890
|
+
Completed 200 OK in 7ms (Views: 5.3ms | ActiveRecord: 0.1ms)
|
4891
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
4892
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4893
|
+
[1m[35mPhone Load (0.1ms)[0m SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
|
4894
|
+
Processing by PhonesController#update as HTML
|
4895
|
+
Parameters: {"phone"=>{"number"=>"972541234567"}, "id"=>"450723037"}
|
4896
|
+
[1m[36mPhone Load (0.1ms)[0m [1mSELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1[0m [["id", "450723037"]]
|
4897
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
4898
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
4899
|
+
Redirected to http://test.host/phones/450723037
|
4900
|
+
Completed 302 Found in 7ms (ActiveRecord: 0.2ms)
|
4901
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phonelib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -160,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
segments:
|
162
162
|
- 0
|
163
|
-
hash: -
|
163
|
+
hash: -1562647719027337657
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
none: false
|
166
166
|
requirements:
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
version: '0'
|
170
170
|
segments:
|
171
171
|
- 0
|
172
|
-
hash: -
|
172
|
+
hash: -1562647719027337657
|
173
173
|
requirements: []
|
174
174
|
rubyforge_project:
|
175
175
|
rubygems_version: 1.8.24
|