will_it_dial 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,9 @@ Defaults to US
15
15
 
16
16
  WillItDial('404-332-1494') => true
17
17
 
18
+ ## Installation
19
+
20
+ gem install will_it_dial
18
21
 
19
22
  ## Todo
20
23
 
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.1
@@ -54,7 +54,8 @@ module WillItDial
54
54
  end
55
55
 
56
56
  def fake_exchange_code?
57
- (number[3,1].to_i == 1) || (number[3,1].to_i == 0)
57
+ # Per wikipedia, no x11 or 0xx 1xx exchange codes
58
+ (number[3,1].to_i == 1) || (number[3,1].to_i == 0) || (number[4,2].to_i == 11)
58
59
  end
59
60
 
60
61
  def fake_area_code?
@@ -19,6 +19,7 @@ describe "A paranoid phone validator" do
19
19
  it "should return false for invalid numbers" do
20
20
  WillItDial::US.check('404-154-7372').should be_false # Can't start exchange code with 1
21
21
  WillItDial::US.check('404-054-7372').should be_false # Can't start exchange code with 0
22
+ WillItDial::US.check('404-311-7372').should be_false # Can't have x11 exchange codes
22
23
  end
23
24
 
24
25
  it "should return false for banned numbers" do
@@ -0,0 +1,53 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{will_it_dial}
8
+ s.version = "1.0.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Mark Percival"]
12
+ s.date = %q{2010-01-22}
13
+ s.description = %q{Used to validate phone numbers that customers enter.
14
+ It will detect numbers that while technically valid, seem suspicious}
15
+ s.email = %q{mark@mpercival.com}
16
+ s.extra_rdoc_files = [
17
+ "LICENSE",
18
+ "README.markdown"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ ".gitignore",
23
+ "LICENSE",
24
+ "README.markdown",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "lib/will_it_dial.rb",
28
+ "spec/will_it_dial_us_spec.rb",
29
+ "will_it_dial.gemspec"
30
+ ]
31
+ s.homepage = %q{http://github.com/markpercival/will_it_dial}
32
+ s.rdoc_options = ["--charset=UTF-8"]
33
+ s.require_paths = ["lib"]
34
+ s.rubygems_version = %q{1.3.5}
35
+ s.summary = %q{A paranoid validator for phone numbers}
36
+ s.test_files = [
37
+ "spec/will_it_dial_us_spec.rb"
38
+ ]
39
+
40
+ if s.respond_to? :specification_version then
41
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
42
+ s.specification_version = 3
43
+
44
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
45
+ s.add_development_dependency(%q<rspec>, [">= 0"])
46
+ else
47
+ s.add_dependency(%q<rspec>, [">= 0"])
48
+ end
49
+ else
50
+ s.add_dependency(%q<rspec>, [">= 0"])
51
+ end
52
+ end
53
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: will_it_dial
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Percival
@@ -37,9 +37,12 @@ files:
37
37
  - .document
38
38
  - .gitignore
39
39
  - LICENSE
40
+ - README.markdown
40
41
  - Rakefile
42
+ - VERSION
41
43
  - lib/will_it_dial.rb
42
- - README.markdown
44
+ - spec/will_it_dial_us_spec.rb
45
+ - will_it_dial.gemspec
43
46
  has_rdoc: true
44
47
  homepage: http://github.com/markpercival/will_it_dial
45
48
  licenses: []