phoneUS 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -12
- data/lib/phoneUS.rb +1 -1
- data/lib/phoneUS/version.rb +1 -1
- metadata +67 -45
- checksums.yaml +0 -15
data/README.md
CHANGED
@@ -1,8 +1,15 @@
|
|
1
1
|
# PhoneUS
|
2
2
|
|
3
|
-
|
3
|
+
Validates MX Records of Emails
|
4
|
+
=========
|
5
|
+
|
6
|
+
An active record validator to Check if the phonumber is in US format. the area code may not start with 1 and the prefix may not start with 1
|
7
|
+
* allows '-' or ' ' as a separator and allows parens around area code
|
8
|
+
* some people may want to put a '1' in front of their number
|
9
|
+
validates 1(212)-999-2345 or
|
10
|
+
* 212 999 2344 or
|
11
|
+
* 212-999-0983
|
4
12
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
13
|
|
7
14
|
## Installation
|
8
15
|
|
@@ -20,16 +27,6 @@ Or install it yourself as:
|
|
20
27
|
|
21
28
|
$ gem install phoneUS
|
22
29
|
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
30
|
## Contributing
|
34
31
|
|
35
32
|
1. Fork it ( https://github.com/[my-github-username]/phoneUS/fork )
|
data/lib/phoneUS.rb
CHANGED
@@ -6,7 +6,7 @@ module PhoneUS
|
|
6
6
|
def validate_each(record, attribute, value)
|
7
7
|
value = value.gsub(/\s+/, "")
|
8
8
|
if not value.length > 9 && value.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/) then
|
9
|
-
record.errors[attribute] << "Please specify a valid phone number"
|
9
|
+
record.errors[attribute] << "Please specify a valid US phone number"
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/lib/phoneUS/version.rb
CHANGED
metadata
CHANGED
@@ -1,50 +1,62 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: phoneUS
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
5
11
|
platform: ruby
|
6
|
-
authors:
|
12
|
+
authors:
|
7
13
|
- tessie
|
8
14
|
autorequire:
|
9
15
|
bindir: exe
|
10
16
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
17
|
+
|
18
|
+
date: 2015-03-15 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
14
21
|
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.8'
|
20
|
-
type: :development
|
21
22
|
prerelease: false
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.8'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
31
26
|
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 31
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 8
|
32
|
+
version: "1.8"
|
34
33
|
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rake
|
35
37
|
prerelease: false
|
36
|
-
|
37
|
-
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
38
41
|
- - ~>
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 35
|
44
|
+
segments:
|
45
|
+
- 10
|
46
|
+
- 0
|
47
|
+
version: "10.0"
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id002
|
41
50
|
description: Validates if the phonnumber is in US format
|
42
|
-
email:
|
51
|
+
email:
|
43
52
|
- tessyjoseph1992@gmail.com
|
44
53
|
executables: []
|
54
|
+
|
45
55
|
extensions: []
|
56
|
+
|
46
57
|
extra_rdoc_files: []
|
47
|
-
|
58
|
+
|
59
|
+
files:
|
48
60
|
- .gitignore
|
49
61
|
- Gemfile
|
50
62
|
- README.md
|
@@ -55,27 +67,37 @@ files:
|
|
55
67
|
- lib/phoneUS/version.rb
|
56
68
|
- phoneUS.gemspec
|
57
69
|
homepage:
|
58
|
-
licenses:
|
70
|
+
licenses:
|
59
71
|
- MIT
|
60
|
-
metadata: {}
|
61
72
|
post_install_message:
|
62
73
|
rdoc_options: []
|
63
|
-
|
74
|
+
|
75
|
+
require_paths:
|
64
76
|
- lib
|
65
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 3
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
version: "0"
|
75
95
|
requirements: []
|
96
|
+
|
76
97
|
rubyforge_project:
|
77
|
-
rubygems_version:
|
98
|
+
rubygems_version: 1.8.15
|
78
99
|
signing_key:
|
79
|
-
specification_version:
|
100
|
+
specification_version: 3
|
80
101
|
summary: Validates US phonnumber!
|
81
102
|
test_files: []
|
103
|
+
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
OTE5OWVhYWI2OGNhNmFiYzViNTYyY2Y3ODlmMGRhYjVjMzVmMTE0Yw==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
OWVlNmI1ZmE1YWFlZjI0NzRkYWI2MGY3MGE5ZDhhOTVhOWQ4YjBhZQ==
|
7
|
-
SHA512:
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MmZiYmQ5YzNkOWUzM2I0ZTk2OTdhMzNmZjY3ODhlMzZmN2VlM2U4Yzg2ZWMy
|
10
|
-
ZjZiMmY3NTE4YTUzNDU1NDc2YjVjNDMzZGIxNWIzNGFjNDI1NDE2NzMzZmM5
|
11
|
-
YjA5ZjQ2MmM5OGFmYzRlYmY4OTQ2YWE0MmZkZjE0ODNmMDBlN2U=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NWFkNmIyMjEwYjQzZGFhYWVlMGFhZDM3OTBjMzljYWY2YzdmNTU2ZjUzY2Y2
|
14
|
-
YTQ3OTRlZGJkZTY0ODVhYTMwZDg5MTI2YmYwZTAxYjUyYmY5ZTA1YWNjYzE5
|
15
|
-
YTgxODQxZDBkYmZiNTdmZTQwOGRmMzQzZDIzMjI3NjljOWI2NTg=
|