duns-lookup 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/duns-lookup.gemspec +34 -41
- data/lib/duns-lookup.rb +4 -2
- data/spec/spec_helper.rb +6 -4
- metadata +46 -64
- data/.gitignore +0 -5
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ begin
|
|
7
7
|
gem.name = "duns-lookup"
|
8
8
|
gem.summary = "Wrapper for looking up Dun & Bradstreet numbers (DUNS)"
|
9
9
|
gem.description = %Q{Provides a small wrapper around the Dun & Bradstreet website to retrieve business information from DUNS numbers.}
|
10
|
-
gem.email = "kali
|
10
|
+
gem.email = "kali@deviantech.com"
|
11
11
|
gem.homepage = "http://github.com/kdonovan/duns-lookup"
|
12
12
|
gem.authors = ["Kali Donovan"]
|
13
13
|
gem.add_development_dependency "rspec"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/duns-lookup.gemspec
CHANGED
@@ -1,63 +1,56 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.1.
|
7
|
+
s.name = "duns-lookup"
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kali Donovan"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2011-09-19"
|
13
|
+
s.description = "Provides a small wrapper around the Dun & Bradstreet website to retrieve business information from DUNS numbers."
|
14
|
+
s.email = "kali@deviantech.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
"lib/duns-lookup.rb",
|
43
|
-
"spec/duns-lookup_spec.rb",
|
44
|
-
"spec/spec_helper.rb"
|
45
|
-
]
|
46
|
-
s.homepage = %q{http://github.com/kdonovan/duns-lookup}
|
47
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
48
|
-
s.require_paths = ["lib"]
|
49
|
-
s.rubygems_version = %q{1.3.6}
|
50
|
-
s.summary = %q{Wrapper for looking up Dun & Bradstreet numbers (DUNS)}
|
51
|
-
s.test_files = [
|
21
|
+
"LICENSE",
|
22
|
+
"README.rdoc",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"doc/classes/Duns.html",
|
26
|
+
"doc/classes/Duns.src/M000001.html",
|
27
|
+
"doc/classes/Duns.src/M000002.html",
|
28
|
+
"doc/classes/Duns.src/M000003.html",
|
29
|
+
"doc/classes/Duns.src/M000004.html",
|
30
|
+
"doc/classes/Duns.src/M000005.html",
|
31
|
+
"doc/classes/Duns.src/M000006.html",
|
32
|
+
"doc/classes/DunsError.html",
|
33
|
+
"doc/created.rid",
|
34
|
+
"doc/files/lib/duns-lookup_rb.html",
|
35
|
+
"doc/fr_class_index.html",
|
36
|
+
"doc/fr_file_index.html",
|
37
|
+
"doc/fr_method_index.html",
|
38
|
+
"doc/index.html",
|
39
|
+
"doc/rdoc-style.css",
|
40
|
+
"duns-lookup.gemspec",
|
41
|
+
"lib/duns-lookup.rb",
|
52
42
|
"spec/duns-lookup_spec.rb",
|
53
|
-
|
43
|
+
"spec/spec_helper.rb"
|
54
44
|
]
|
45
|
+
s.homepage = "http://github.com/kdonovan/duns-lookup"
|
46
|
+
s.require_paths = ["lib"]
|
47
|
+
s.rubygems_version = "1.8.10"
|
48
|
+
s.summary = "Wrapper for looking up Dun & Bradstreet numbers (DUNS)"
|
55
49
|
|
56
50
|
if s.respond_to? :specification_version then
|
57
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
58
51
|
s.specification_version = 3
|
59
52
|
|
60
|
-
if Gem::Version.new(Gem::
|
53
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
54
|
s.add_development_dependency(%q<rspec>, [">= 0"])
|
62
55
|
s.add_runtime_dependency(%q<mechanize>, [">= 0"])
|
63
56
|
else
|
data/lib/duns-lookup.rb
CHANGED
@@ -8,7 +8,7 @@ end
|
|
8
8
|
#
|
9
9
|
# == Example
|
10
10
|
# require 'rubygems'
|
11
|
-
# require '
|
11
|
+
# require 'duns-lookup'
|
12
12
|
#
|
13
13
|
# Duns.lookup_duns( *invalid_number* )
|
14
14
|
# # => nil
|
@@ -36,8 +36,10 @@ class Duns
|
|
36
36
|
# Otherwise, returns nil.
|
37
37
|
#
|
38
38
|
def self.lookup_duns(number)
|
39
|
+
formatted_number = enforce_duns_formatting(number) # Abort early if invalid format
|
40
|
+
|
39
41
|
form = @@agent.get( @@dnb_advanced_search ).form('DunsSearchForm')
|
40
|
-
form.dunsNumber =
|
42
|
+
form.dunsNumber = formatted_number
|
41
43
|
page = @@agent.submit(form)
|
42
44
|
|
43
45
|
extract_search_results(page)
|
data/spec/spec_helper.rb
CHANGED
@@ -12,11 +12,13 @@ end
|
|
12
12
|
# Try looking up your business by hand first to see exactly the format used by the D&B website
|
13
13
|
# (for instance punctuation matters, as in the abbreviations of CO and INC below)
|
14
14
|
def real_duns
|
15
|
-
{
|
16
|
-
:number =>
|
17
|
-
:name =>
|
18
|
-
:address =>
|
15
|
+
hash = {
|
16
|
+
:number => ENV['DUNS'], # Enter the company's DUNS number
|
17
|
+
:name => ENV['DUNS_NAME'], # Enter the official company name, ALL UPPER CASE: FOO WIDGET CO., INC.
|
18
|
+
:address => ENV['DUNS_ADDRESS'] # Enter the officially registered address, ALL UPPER CASE: 123 W MAIN ST, SAN FRANCISCO, CA
|
19
19
|
}
|
20
|
+
raise("\n>> To test against a real company, you must add valid info to #real_duns in #{__FILE__}!\n") unless hash[:number]
|
21
|
+
hash
|
20
22
|
end
|
21
23
|
|
22
24
|
# A valid, but non-existant DUNS number
|
metadata
CHANGED
@@ -1,58 +1,48 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: duns-lookup
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
version: 0.1.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Kali Donovan
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-09-19 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: rspec
|
22
|
-
|
23
|
-
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
- 0
|
29
|
-
version: "0"
|
16
|
+
requirement: &2153077460 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
30
22
|
type: :development
|
31
|
-
version_requirements: *id001
|
32
|
-
- !ruby/object:Gem::Dependency
|
33
|
-
name: mechanize
|
34
23
|
prerelease: false
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
24
|
+
version_requirements: *2153077460
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: mechanize
|
27
|
+
requirement: &2153076980 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
42
33
|
type: :runtime
|
43
|
-
|
44
|
-
|
45
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *2153076980
|
36
|
+
description: Provides a small wrapper around the Dun & Bradstreet website to retrieve
|
37
|
+
business information from DUNS numbers.
|
38
|
+
email: kali@deviantech.com
|
46
39
|
executables: []
|
47
|
-
|
48
40
|
extensions: []
|
49
|
-
|
50
|
-
extra_rdoc_files:
|
41
|
+
extra_rdoc_files:
|
51
42
|
- LICENSE
|
52
43
|
- README.rdoc
|
53
|
-
files:
|
44
|
+
files:
|
54
45
|
- .document
|
55
|
-
- .gitignore
|
56
46
|
- LICENSE
|
57
47
|
- README.rdoc
|
58
48
|
- Rakefile
|
@@ -76,36 +66,28 @@ files:
|
|
76
66
|
- lib/duns-lookup.rb
|
77
67
|
- spec/duns-lookup_spec.rb
|
78
68
|
- spec/spec_helper.rb
|
79
|
-
has_rdoc: true
|
80
69
|
homepage: http://github.com/kdonovan/duns-lookup
|
81
70
|
licenses: []
|
82
|
-
|
83
71
|
post_install_message:
|
84
|
-
rdoc_options:
|
85
|
-
|
86
|
-
require_paths:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
87
74
|
- lib
|
88
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
requirements:
|
97
|
-
- -
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
|
100
|
-
- 0
|
101
|
-
version: "0"
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
102
87
|
requirements: []
|
103
|
-
|
104
88
|
rubyforge_project:
|
105
|
-
rubygems_version: 1.
|
89
|
+
rubygems_version: 1.8.10
|
106
90
|
signing_key:
|
107
91
|
specification_version: 3
|
108
92
|
summary: Wrapper for looking up Dun & Bradstreet numbers (DUNS)
|
109
|
-
test_files:
|
110
|
-
- spec/duns-lookup_spec.rb
|
111
|
-
- spec/spec_helper.rb
|
93
|
+
test_files: []
|