russian_phone 0.3.5 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de2b1c829af8ca3af5a9e976e456ab5a543c3089
4
- data.tar.gz: 38063084067c0c3683d12a1f579fb130ab2dad3a
3
+ metadata.gz: 691b7c30d9c45e5eda62e256a30aee50ca90095e
4
+ data.tar.gz: 0230e4dca9827def0c1a3f958257f4f6847ec3d5
5
5
  SHA512:
6
- metadata.gz: a76aa835d65eccdbcd6734342a0856c729868a3b6c361b26d9c82fb67bc6d08fd9a25fe1dc7ea0c8f1b3b2f08a36af70069b9c855274adbff5468eb01858deeb
7
- data.tar.gz: b63665d691b789c1c7b3e40a0a4b2edd4d1879d2bfef7ad454bc6fa8bac2db870b994a237e3174aa3e42b7db5c532dc41eba6ac618cc867a253eb49323016841
6
+ metadata.gz: 13cc8d62bf62e9ef6e17a237de6b166b6ea2ac029ddf0848c36431626339e251726362fb00c8745f856da9558e27fa76ee394bfd1e8c14ad2ede88622c86f672
7
+ data.tar.gz: 808b86c9676a76aaa7be3014320e751d3fe255bd57720ceda6b0da785e47d7b2fc417a2f4ca7268c23ae4fbf0de6346f8fcea38093884a8befc4a351491d33b0
data/.gitignore CHANGED
File without changes
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.0.0-p195
1
+ 2.1.1
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ services:
2
+ - mongodb
3
+
4
+ notifications:
5
+ email: false
6
+
7
+ language: ruby
8
+ rvm:
9
+ - 2.0.0
10
+ - 2.1.1
11
+ - jruby-20mode
12
+
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # RussianPhone
2
2
 
3
+ [![Build Status](https://travis-ci.org/glebtv/russian_phone.svg?branch=master)](https://travis-ci.org/glebtv/russian_phone)
4
+
3
5
  ## Что это
4
6
 
5
7
  Гем для разбора и нормализации русских телефонных номеров
@@ -51,6 +53,8 @@ Or install it yourself as:
51
53
  => "111-11-11"
52
54
  # phone.full
53
55
  => "+7 (906) 111-11-11"
56
+ # phone.clean
57
+ => "79061111111"
54
58
  # phone.cell?
55
59
  => true
56
60
  # phone.free?
data/Rakefile CHANGED
File without changes
data/lib/russian_phone.rb CHANGED
@@ -15,20 +15,5 @@ module RussianPhone
15
15
  end
16
16
 
17
17
  if Object.const_defined?("RailsAdmin")
18
- require 'rails_admin/adapters/mongoid'
19
- require 'rails_admin/config/fields/types/text'
20
- module RailsAdmin
21
- module Adapters
22
- module Mongoid
23
- alias_method :type_lookup_without_russian_phone, :type_lookup
24
- def type_lookup(name, field)
25
- if field.type.class.name == "RussianPhone::Field"
26
- { :type => :string }
27
- else
28
- type_lookup_without_russian_phone(name, field)
29
- end
30
- end
31
- end
32
- end
33
- end
18
+ require "russian_phone/rails_admin"
34
19
  end
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,23 @@
1
+ require 'rails_admin/adapters/mongoid'
2
+ begin
3
+ require 'rails_admin/adapters/mongoid/property'
4
+ rescue Exception => e
5
+ end
6
+
7
+ module RailsAdmin
8
+ module Adapters
9
+ module Mongoid
10
+ class Property
11
+ alias_method :type_without_russian_phone, :type
12
+ def type(name, field)
13
+ if field.type.class.name == "RussianPhone::Field"
14
+ { :type => :string }
15
+ else
16
+ type_without_russian_phone(name, field)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+
@@ -1,3 +1,4 @@
1
1
  module RussianPhone
2
- VERSION = "0.3.5"
2
+ VERSION = "0.4.0"
3
3
  end
4
+
@@ -18,9 +18,11 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
 
20
20
 
21
- gem.add_runtime_dependency(%q<mongoid>, [">= 3.0.0"])
22
- gem.add_development_dependency(%q<rspec>, ["~> 2.12.0"])
23
- gem.add_development_dependency(%q<bundler>, [">= 1.1.0"])
24
- gem.add_development_dependency(%q<simplecov>, [">= 0.4.0"])
25
- gem.add_development_dependency(%q<database_cleaner>, ["~> 0.9.0"])
21
+ gem.add_runtime_dependency 'mongoid', '>= 3.0.0'
22
+
23
+ gem.add_development_dependency 'bundler'
24
+ gem.add_development_dependency 'rake'
25
+ gem.add_development_dependency 'rspec'
26
+ gem.add_development_dependency 'simplecov'
27
+ gem.add_development_dependency 'database_cleaner'
26
28
  end
data/spec/phone_spec.rb CHANGED
File without changes
data/spec/spec_helper.rb CHANGED
File without changes
data/spec/support/user.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,85 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: russian_phone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GlebTv
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-14 00:00:00.000000000 Z
11
+ date: 2014-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.0.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
28
+ name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 2.12.0
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 2.12.0
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: bundler
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - '>='
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: 1.1.0
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - '>='
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: 1.1.0
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: simplecov
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - '>='
73
+ - - ">="
60
74
  - !ruby/object:Gem::Version
61
- version: 0.4.0
75
+ version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - '>='
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
- version: 0.4.0
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: database_cleaner
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - ~>
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
- version: 0.9.0
89
+ version: '0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - ~>
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
- version: 0.9.0
96
+ version: '0'
83
97
  description: Russian Phone Numbers for Mongoid
84
98
  email:
85
99
  - glebtv@gmail.com
@@ -87,9 +101,10 @@ executables: []
87
101
  extensions: []
88
102
  extra_rdoc_files: []
89
103
  files:
90
- - .gitignore
91
- - .ruby-gemset
92
- - .ruby-version
104
+ - ".gitignore"
105
+ - ".ruby-gemset"
106
+ - ".ruby-version"
107
+ - ".travis.yml"
93
108
  - Gemfile
94
109
  - LICENSE.txt
95
110
  - README.md
@@ -100,6 +115,7 @@ files:
100
115
  - lib/russian_phone/format_validator.rb
101
116
  - lib/russian_phone/number.rb
102
117
  - lib/russian_phone/presence_validator.rb
118
+ - lib/russian_phone/rails_admin.rb
103
119
  - lib/russian_phone/version.rb
104
120
  - russian_phone.gemspec
105
121
  - spec/phone_spec.rb
@@ -110,7 +126,6 @@ files:
110
126
  - spec/support/user_with_required.rb
111
127
  - spec/support/user_with_validation.rb
112
128
  - spec/support/user_without_validation.rb
113
- - validate.sh
114
129
  homepage: https://github.com/glebtv/russian_phone
115
130
  licenses: []
116
131
  metadata: {}
@@ -120,20 +135,20 @@ require_paths:
120
135
  - lib
121
136
  required_ruby_version: !ruby/object:Gem::Requirement
122
137
  requirements:
123
- - - '>='
138
+ - - ">="
124
139
  - !ruby/object:Gem::Version
125
140
  version: '0'
126
141
  required_rubygems_version: !ruby/object:Gem::Requirement
127
142
  requirements:
128
- - - '>='
143
+ - - ">="
129
144
  - !ruby/object:Gem::Version
130
145
  version: '0'
131
146
  requirements: []
132
147
  rubyforge_project:
133
- rubygems_version: 2.0.3
148
+ rubygems_version: 2.2.2
134
149
  signing_key:
135
150
  specification_version: 4
136
- summary: Поле для хранения Российских телефонных номеров в Mongoid
151
+ summary: "Поле для хранения Российских телефонных номеров в Mongoid"
137
152
  test_files:
138
153
  - spec/phone_spec.rb
139
154
  - spec/spec_helper.rb
data/validate.sh DELETED
@@ -1,33 +0,0 @@
1
- #!/bin/bash
2
-
3
- if ! which md5sum > /dev/null; then
4
- echo Install md5sum
5
- exit 1
6
- fi
7
-
8
- if ! which curl > /dev/null; then
9
- echo Install curl
10
- exit 1
11
- fi
12
-
13
- home=$(gem env GEM_HOME)
14
- cache=$home/cache
15
-
16
- echo This will take a while...
17
-
18
- for gem in $cache/*.gem; do
19
- gemfile=$(basename $gem)
20
-
21
- local=$(md5sum $gem | awk '{print $1}')
22
- remote=$(curl -s -D - -X HEAD -H 'Connection:close' http://production.cf.rubygems.org/gems/$gemfile | grep 'ETag' | cut -d '"' -f 2)
23
-
24
- # echo $gemfile local: $local, remote: $remote
25
-
26
- if [[ ! $local = $remote ]]; then
27
- echo $gemfile mismatch. local: $local, remote: $remote
28
- fi
29
-
30
-
31
- done
32
-
33
- echo All done.