phonelib 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,137 +1,121 @@
1
- ## Phonelib
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 [Google libphonenumber](http://code.google.com/p/libphonenumber/).
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
- ## Information
10
+ == Information
9
11
 
10
- ### RDoc
12
+ === RDoc
11
13
 
12
14
  RDoc documentation can be found here
13
- http://rubydoc.info/github/daddyz/phonelib/master/frames
15
+ http://rubydoc.info/gems/phonelib/frames
14
16
 
15
- ### Bug reports
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
- ### Example application
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
- ## Getting started
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
- ```ruby
29
- gem 'phonelib'
30
- ```
30
+ gem 'phonelib'
31
31
 
32
32
  Run the bundle command to install it.
33
33
 
34
- ### ActiveRecord Integration
34
+ === ActiveRecord Integration
35
35
 
36
36
  This gem adds validator for active record.
37
37
  Basic usage:
38
- ```ruby
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
- `allow_blank: true` - when no value passed then validation passes
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
- ### Basic usage
53
+ === Basic usage
54
54
 
55
55
  To check if phone number is valid simply run:
56
56
 
57
- ```ruby
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
- ```ruby
64
- Phonelib.valid? '123456789' # checks if passed value is valid number
65
- Phonelib.invalid? '123456789' # checks if passed value is invalid number
66
- Phonelib.possible? '123456789' # checks if passed value is possible number
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
- ```ruby
74
- Phonelib.valid_for_country? '123456789', 'XX' # checks if passed value is valid number for specified country
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
- ```ruby
81
- phone = Phonelib.parse('123456789')
82
- ```
74
+ phone = Phonelib.parse('123456789')
83
75
 
84
- Returned value is object of `Phonelib::Phone` class which have following methods:
76
+ Returned value is object of <tt>Phonelib::Phone</tt> class which have following methods:
85
77
 
86
- ```ruby
87
- # basic validation methods
88
- phone.valid?
89
- phone.invalid?
90
- phone.possible?
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
- ```ruby
101
- phone.types # returns array of all valid types
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
- * `:premiumRate` - Premium Rate
107
- * `:tollFree` - Toll Free
108
- * `:sharedCost` - Shared Cost
109
- * `:voip` - VoIP
110
- * `:personalNumber` - Personal Number
111
- * `:pager` - Pager
112
- * `:uan` - UAN
113
- * `:voicemail` - VoiceMail
114
- * `:fixedLine` - Fixed Line
115
- * `:mobile` - Mobile
116
- * `:fixedOrMobile` - Fixed Line or Mobile (if both mobile and fixed pattern matches)
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
- ```ruby
121
- phone.countries # returns array of all matched countries
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
- ```ruby
128
- phone.original # string that was passed as phone number
129
- phone.sanitized # sanitized phone number (only digits left)
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
- ### How it works
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
@@ -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
- (Core::TYPES.keys - Core::NOT_FOR_CHECK).each do |type|
113
- next if data[type].nil? || data[type].empty?
114
-
115
- response[:valid] << type if number_valid_and_possible?(number,
116
- data[type])
117
- response[:possible] << type if number_possible?(number, data[type])
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
- if number_valid_and_possible?(number, data[Core::FIXED_LINE])
121
- if data[Core::FIXED_LINE] == data[Core::MOBILE]
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
- if number_possible?(number, data[Core::FIXED_LINE])
131
- if data[Core::FIXED_LINE] == data[Core::MOBILE]
132
- response[:possible] << Core::FIXED_OR_MOBILE
133
- else
134
- response[:possible] << Core::FIXED_LINE
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
@@ -1,3 +1,4 @@
1
1
  module Phonelib
2
- VERSION = "0.0.1"
2
+ # :nodoc:
3
+ VERSION = "0.0.2"
3
4
  end
Binary file
@@ -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
   (0.1ms) rollback transaction
4628
+ Connecting to database specified by database.yml
4629
+  (0.5ms) begin transaction
4630
+ Fixture Delete (0.9ms) DELETE FROM "phones"
4631
+ Fixture Insert (2.5ms) INSERT 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)
4632
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.1ms) INSERT INTO "phones" ("number", "created_at", "updated_at", "id") VALUES ('972541234567', '2013-01-29 18:16:32', '2013-01-29 18:16:32', 512636273)
4634
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.1ms) INSERT 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)
4636
+  (1.3ms) commit transaction
4637
+  (0.1ms) begin transaction
4638
+ Phone Load (0.4ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 512636273]]
4639
+  (0.1ms) SAVEPOINT active_record_1
4640
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4641
+  (0.1ms) rollback transaction
4642
+  (0.1ms) begin transaction
4643
+  (0.0ms) SAVEPOINT active_record_1
4644
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
4645
+  (0.1ms) rollback transaction
4646
+  (0.0ms) begin transaction
4647
+  (0.0ms) SAVEPOINT active_record_1
4648
+ SQL (4.6ms) 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
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4650
+  (0.8ms) rollback transaction
4651
+  (0.1ms) begin transaction
4652
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4653
+  (0.1ms) SAVEPOINT active_record_1
4654
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4655
+  (0.1ms) rollback transaction
4656
+  (0.0ms) begin transaction
4657
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 23760034]]
4658
+  (0.0ms) SAVEPOINT active_record_1
4659
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
4660
+  (0.1ms) rollback transaction
4661
+  (0.0ms) begin transaction
4662
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 667262234]]
4663
+  (0.1ms) SAVEPOINT active_record_1
4664
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
4665
+  (0.1ms) rollback transaction
4666
+  (0.0ms) begin transaction
4667
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 703612349]]
4668
+  (0.0ms) SAVEPOINT active_record_1
4669
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
4670
+  (0.1ms) rollback transaction
4671
+  (0.1ms) begin transaction
4672
+  (0.1ms) rollback transaction
4673
+  (0.1ms) begin transaction
4674
+  (0.1ms) rollback transaction
4675
+  (0.1ms) begin transaction
4676
+  (0.1ms) rollback transaction
4677
+  (0.0ms) begin transaction
4678
+  (0.0ms) rollback transaction
4679
+  (0.0ms) begin transaction
4680
+  (0.0ms) rollback transaction
4681
+  (0.0ms) begin transaction
4682
+  (0.0ms) rollback transaction
4683
+  (0.0ms) begin transaction
4684
+  (0.0ms) rollback transaction
4685
+  (0.0ms) begin transaction
4686
+  (0.1ms) rollback transaction
4687
+  (0.1ms) begin transaction
4688
+  (0.1ms) rollback transaction
4689
+  (0.1ms) begin transaction
4690
+  (0.1ms) rollback transaction
4691
+  (0.1ms) begin transaction
4692
+  (0.0ms) rollback transaction
4693
+  (0.1ms) begin transaction
4694
+  (0.1ms) rollback transaction
4695
+  (0.0ms) begin transaction
4696
+  (0.0ms) rollback transaction
4697
+  (0.0ms) begin transaction
4698
+  (0.0ms) rollback transaction
4699
+  (0.0ms) begin transaction
4700
+  (0.0ms) rollback transaction
4701
+  (0.1ms) begin transaction
4702
+  (0.0ms) rollback transaction
4703
+  (0.1ms) begin transaction
4704
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4705
+  (0.1ms) SELECT COUNT(*) FROM "phones" 
4706
+ Processing by PhonesController#create as HTML
4707
+ Parameters: {"phone"=>{"number"=>"972541234567"}}
4708
+  (0.1ms) SAVEPOINT active_record_1
4709
+ SQL (0.6ms) 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]]
4710
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4711
+ Redirected to http://test.host/phones/980190963
4712
+ Completed 302 Found in 8ms (ActiveRecord: 0.8ms)
4713
+  (0.1ms) SELECT COUNT(*) FROM "phones" 
4714
+  (0.9ms) rollback transaction
4715
+  (0.1ms) begin transaction
4716
+ Phone Load (0.2ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4717
+  (0.1ms) SELECT COUNT(*) FROM "phones" 
4718
+ Processing by PhonesController#destroy as HTML
4719
+ Parameters: {"id"=>"450723037"}
4720
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", "450723037"]]
4721
+  (0.1ms) SAVEPOINT active_record_1
4722
+ SQL (0.4ms) DELETE FROM "phones" WHERE "phones"."id" = ? [["id", 450723037]]
4723
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4724
+ Redirected to http://test.host/phones
4725
+ Completed 302 Found in 5ms (ActiveRecord: 0.6ms)
4726
+  (0.1ms) SELECT COUNT(*) FROM "phones"
4727
+  (0.5ms) rollback transaction
4728
+  (0.1ms) begin transaction
4729
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4730
+ Processing by PhonesController#edit as HTML
4731
+ Parameters: {"id"=>"450723037"}
4732
+ Phone Load (0.1ms) 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
+  (0.1ms) rollback transaction
4736
+  (0.1ms) begin transaction
4737
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4738
+ Processing by PhonesController#index as HTML
4739
+ Phone Load (0.2ms) SELECT "phones".* FROM "phones"
4740
+ Completed 200 OK in 14ms (Views: 12.0ms | ActiveRecord: 0.2ms)
4741
+  (0.1ms) rollback transaction
4742
+  (0.1ms) begin transaction
4743
+ Phone Load (0.2ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["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
+  (0.1ms) rollback transaction
4748
+  (0.1ms) begin transaction
4749
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4750
+ Processing by PhonesController#show as HTML
4751
+ Parameters: {"id"=>"450723037"}
4752
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", "450723037"]]
4753
+ Completed 200 OK in 8ms (Views: 5.7ms | ActiveRecord: 0.1ms)
4754
+  (0.1ms) rollback transaction
4755
+  (0.1ms) begin transaction
4756
+ Phone Load (0.2ms) 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
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", "450723037"]]
4760
+  (0.1ms) SAVEPOINT active_record_1
4761
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4762
+ Redirected to http://test.host/phones/450723037
4763
+ Completed 302 Found in 7ms (ActiveRecord: 0.2ms)
4764
+  (0.1ms) rollback transaction
4765
+ Connecting to database specified by database.yml
4766
+  (0.5ms) begin transaction
4767
+ Fixture Delete (0.4ms) DELETE FROM "phones"
4768
+ Fixture Insert (0.3ms) INSERT 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)
4769
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.1ms) INSERT INTO "phones" ("number", "created_at", "updated_at", "id") VALUES ('972541234567', '2013-01-30 07:23:21', '2013-01-30 07:23:21', 512636273)
4771
+ Fixture Insert (0.1ms) 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
+ Fixture Insert (0.1ms) INSERT 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)
4773
+  (4.7ms) commit transaction
4774
+  (0.1ms) begin transaction
4775
+ Phone Load (0.4ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 512636273]]
4776
+  (0.1ms) SAVEPOINT active_record_1
4777
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4778
+  (0.1ms) rollback transaction
4779
+  (0.1ms) begin transaction
4780
+  (0.1ms) SAVEPOINT active_record_1
4781
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
4782
+  (0.1ms) rollback transaction
4783
+  (0.1ms) begin transaction
4784
+  (0.0ms) SAVEPOINT active_record_1
4785
+ SQL (2.3ms) 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
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4787
+  (2.9ms) rollback transaction
4788
+  (0.1ms) begin transaction
4789
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4790
+  (0.1ms) SAVEPOINT active_record_1
4791
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4792
+  (0.1ms) rollback transaction
4793
+  (0.1ms) begin transaction
4794
+ Phone Load (0.2ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 23760034]]
4795
+  (0.1ms) SAVEPOINT active_record_1
4796
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
4797
+  (0.1ms) rollback transaction
4798
+  (0.2ms) begin transaction
4799
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 667262234]]
4800
+  (0.1ms) SAVEPOINT active_record_1
4801
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
4802
+  (0.1ms) rollback transaction
4803
+  (0.0ms) begin transaction
4804
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 703612349]]
4805
+  (0.0ms) SAVEPOINT active_record_1
4806
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
4807
+  (0.1ms) rollback transaction
4808
+  (0.1ms) begin transaction
4809
+  (0.1ms) rollback transaction
4810
+  (0.0ms) begin transaction
4811
+  (0.0ms) rollback transaction
4812
+  (0.0ms) begin transaction
4813
+  (0.0ms) rollback transaction
4814
+  (0.1ms) begin transaction
4815
+  (0.0ms) rollback transaction
4816
+  (0.1ms) begin transaction
4817
+  (0.1ms) rollback transaction
4818
+  (0.0ms) begin transaction
4819
+  (0.0ms) rollback transaction
4820
+  (0.0ms) begin transaction
4821
+  (0.1ms) rollback transaction
4822
+  (0.0ms) begin transaction
4823
+  (0.0ms) rollback transaction
4824
+  (0.0ms) begin transaction
4825
+  (0.0ms) rollback transaction
4826
+  (0.0ms) begin transaction
4827
+  (0.0ms) rollback transaction
4828
+  (0.0ms) begin transaction
4829
+  (0.0ms) rollback transaction
4830
+  (0.0ms) begin transaction
4831
+  (0.0ms) rollback transaction
4832
+  (0.0ms) begin transaction
4833
+  (0.0ms) rollback transaction
4834
+  (0.0ms) begin transaction
4835
+  (0.0ms) rollback transaction
4836
+  (0.0ms) begin transaction
4837
+  (0.0ms) rollback transaction
4838
+  (0.0ms) begin transaction
4839
+  (0.0ms) rollback transaction
4840
+  (0.1ms) begin transaction
4841
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4842
+  (0.1ms) SELECT COUNT(*) FROM "phones" 
4843
+ Processing by PhonesController#create as HTML
4844
+ Parameters: {"phone"=>{"number"=>"972541234567"}}
4845
+  (0.1ms) SAVEPOINT active_record_1
4846
+ SQL (0.7ms) 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]]
4847
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4848
+ Redirected to http://test.host/phones/980190963
4849
+ Completed 302 Found in 10ms (ActiveRecord: 0.8ms)
4850
+  (0.1ms) SELECT COUNT(*) FROM "phones" 
4851
+  (2.3ms) rollback transaction
4852
+  (0.1ms) begin transaction
4853
+ Phone Load (0.2ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4854
+  (0.1ms) SELECT COUNT(*) FROM "phones" 
4855
+ Processing by PhonesController#destroy as HTML
4856
+ Parameters: {"id"=>"450723037"}
4857
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", "450723037"]]
4858
+  (0.1ms) SAVEPOINT active_record_1
4859
+ SQL (0.4ms) DELETE FROM "phones" WHERE "phones"."id" = ? [["id", 450723037]]
4860
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4861
+ Redirected to http://test.host/phones
4862
+ Completed 302 Found in 4ms (ActiveRecord: 0.6ms)
4863
+  (0.1ms) SELECT COUNT(*) FROM "phones"
4864
+  (0.8ms) rollback transaction
4865
+  (0.1ms) begin transaction
4866
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4867
+ Processing by PhonesController#edit as HTML
4868
+ Parameters: {"id"=>"450723037"}
4869
+ Phone Load (0.1ms) 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
+  (0.1ms) rollback transaction
4873
+  (0.1ms) begin transaction
4874
+ Phone Load (0.2ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4875
+ Processing by PhonesController#index as HTML
4876
+ Phone Load (0.2ms) SELECT "phones".* FROM "phones"
4877
+ Completed 200 OK in 13ms (Views: 11.2ms | ActiveRecord: 0.2ms)
4878
+  (0.1ms) rollback transaction
4879
+  (0.1ms) begin transaction
4880
+ Phone Load (0.2ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["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
+  (0.1ms) rollback transaction
4885
+  (0.1ms) begin transaction
4886
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", 450723037]]
4887
+ Processing by PhonesController#show as HTML
4888
+ Parameters: {"id"=>"450723037"}
4889
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", "450723037"]]
4890
+ Completed 200 OK in 7ms (Views: 5.3ms | ActiveRecord: 0.1ms)
4891
+  (0.1ms) rollback transaction
4892
+  (0.1ms) begin transaction
4893
+ Phone Load (0.1ms) 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
+ Phone Load (0.1ms) SELECT "phones".* FROM "phones" WHERE "phones"."id" = ? LIMIT 1 [["id", "450723037"]]
4897
+  (0.1ms) SAVEPOINT active_record_1
4898
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4899
+ Redirected to http://test.host/phones/450723037
4900
+ Completed 302 Found in 7ms (ActiveRecord: 0.2ms)
4901
+  (0.1ms) 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.1
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-24 00:00:00.000000000 Z
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: -4099978874626020954
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: -4099978874626020954
172
+ hash: -1562647719027337657
173
173
  requirements: []
174
174
  rubyforge_project:
175
175
  rubygems_version: 1.8.24