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 +4 -4
- data/.gitignore +0 -0
- data/.ruby-version +1 -1
- data/.travis.yml +12 -0
- data/README.md +4 -0
- data/Rakefile +0 -0
- data/lib/russian_phone.rb +1 -16
- data/lib/russian_phone/codes.rb +0 -0
- data/lib/russian_phone/field.rb +0 -0
- data/lib/russian_phone/format_validator.rb +0 -0
- data/lib/russian_phone/number.rb +0 -0
- data/lib/russian_phone/presence_validator.rb +0 -0
- data/lib/russian_phone/rails_admin.rb +23 -0
- data/lib/russian_phone/version.rb +2 -1
- data/russian_phone.gemspec +7 -5
- data/spec/phone_spec.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/support/user.rb +0 -0
- data/spec/support/user_with_any_code.rb +0 -0
- data/spec/support/user_with_required.rb +0 -0
- data/spec/support/user_with_validation.rb +0 -0
- data/spec/support/user_without_validation.rb +0 -0
- metadata +45 -30
- data/validate.sh +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 691b7c30d9c45e5eda62e256a30aee50ca90095e
|
4
|
+
data.tar.gz: 0230e4dca9827def0c1a3f958257f4f6847ec3d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13cc8d62bf62e9ef6e17a237de6b166b6ea2ac029ddf0848c36431626339e251726362fb00c8745f856da9558e27fa76ee394bfd1e8c14ad2ede88622c86f672
|
7
|
+
data.tar.gz: 808b86c9676a76aaa7be3014320e751d3fe255bd57720ceda6b0da785e47d7b2fc417a2f4ca7268c23ae4fbf0de6346f8fcea38093884a8befc4a351491d33b0
|
data/.gitignore
CHANGED
File without changes
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.1.1
|
data/.travis.yml
ADDED
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
|
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
|
data/lib/russian_phone/codes.rb
CHANGED
File without changes
|
data/lib/russian_phone/field.rb
CHANGED
File without changes
|
File without changes
|
data/lib/russian_phone/number.rb
CHANGED
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
|
+
|
data/russian_phone.gemspec
CHANGED
@@ -18,9 +18,11 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
20
|
|
21
|
-
gem.add_runtime_dependency
|
22
|
-
|
23
|
-
gem.add_development_dependency
|
24
|
-
gem.add_development_dependency
|
25
|
-
gem.add_development_dependency
|
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.
|
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:
|
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:
|
28
|
+
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
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:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
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:
|
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:
|
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
|
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
|
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
|
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
|
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.
|
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.
|