fullcontact 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/fullcontact.gemspec +4 -4
- data/lib/fullcontact/client/person.rb +7 -3
- data/lib/fullcontact/version.rb +1 -1
- data/spec/faraday/response_spec.rb +2 -2
- data/spec/fullcontact_spec.rb +9 -3
- data/spec/ruby_fullcontact/client_spec.rb +1 -1
- metadata +33 -37
- data/vendor/cache/addressable-2.2.6.gem +0 -0
- data/vendor/cache/faraday-0.6.1.gem +0 -0
- data/vendor/cache/multi_json-1.0.3.gem +0 -0
- data/vendor/cache/multi_xml-0.2.2.gem +0 -0
data/fullcontact.gemspec
CHANGED
@@ -11,10 +11,10 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.add_development_dependency 'webmock', '~> 1.6'
|
12
12
|
s.add_development_dependency 'yard', '~> 0.7'
|
13
13
|
s.add_runtime_dependency 'hashie', '~> 1.2.0'
|
14
|
-
s.add_runtime_dependency 'faraday', '~> 0.
|
15
|
-
s.add_runtime_dependency 'faraday_middleware', '~> 0.6
|
16
|
-
s.add_runtime_dependency 'multi_json', '~> 1.
|
17
|
-
s.add_runtime_dependency 'multi_xml', '~> 0.2
|
14
|
+
s.add_runtime_dependency 'faraday', '~> 0.7.3'
|
15
|
+
s.add_runtime_dependency 'faraday_middleware', '~> 0.8.6'
|
16
|
+
s.add_runtime_dependency 'multi_json', '~> 1.2.0'
|
17
|
+
s.add_runtime_dependency 'multi_xml', '~> 0.4.2'
|
18
18
|
s.add_runtime_dependency 'rash', '~> 0.3.0'
|
19
19
|
|
20
20
|
s.author = "Brandon West"
|
@@ -1,10 +1,14 @@
|
|
1
1
|
module FullContact
|
2
2
|
class Client
|
3
3
|
module Person
|
4
|
-
# Returns extended information for a given email
|
4
|
+
# Returns extended information for a given person (email, phone, twitter or facebook)
|
5
5
|
#
|
6
|
-
def person(
|
7
|
-
|
6
|
+
def person(options={})
|
7
|
+
if options.is_a?(String)
|
8
|
+
warn "[DEPRECATION] supplying an email address directly is deprecated. Please use {email: #{options}} instead."
|
9
|
+
options = {:email => options}
|
10
|
+
end
|
11
|
+
response = get('person', options)
|
8
12
|
format.to_s.downcase == 'xml' ? response['person'] : response
|
9
13
|
end
|
10
14
|
end
|
data/lib/fullcontact/version.rb
CHANGED
@@ -30,7 +30,7 @@ describe Faraday::Response do
|
|
30
30
|
|
31
31
|
it "should raise #{exception.name} error" do
|
32
32
|
lambda do
|
33
|
-
@client.person( 'brawest@gmail.com')
|
33
|
+
@client.person(:email => 'brawest@gmail.com')
|
34
34
|
end.should raise_error(exception)
|
35
35
|
end
|
36
36
|
end
|
@@ -46,7 +46,7 @@ describe Faraday::Response do
|
|
46
46
|
|
47
47
|
it "should raise #{exception.name} error" do
|
48
48
|
lambda do
|
49
|
-
@client.person( 'brawest@gmail.com')
|
49
|
+
@client.person(:email => 'brawest@gmail.com')
|
50
50
|
end.should raise_error(exception)
|
51
51
|
end
|
52
52
|
end
|
data/spec/fullcontact_spec.rb
CHANGED
@@ -17,19 +17,25 @@ describe FullContact do
|
|
17
17
|
with(:query => {:apiKey => "api_key", :email => "brawest@gmail.com"}).
|
18
18
|
to_return(:body => fixture("person.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
19
19
|
|
20
|
+
stub_get("person.json").
|
21
|
+
with(:query => {:apiKey => "api_key", :twitter => "brawtest"}).
|
22
|
+
to_return(:body => fixture("person.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
20
23
|
end
|
21
24
|
|
22
25
|
it "should get the correct resource" do
|
23
|
-
FullContact.person("brawest@gmail.com")
|
26
|
+
FullContact.person(email: "brawest@gmail.com")
|
24
27
|
a_get("person.json")
|
25
28
|
.with(:query => {:apiKey => "api_key", :email => "brawest@gmail.com"})
|
26
29
|
.should have_been_made
|
27
30
|
end
|
28
31
|
|
29
|
-
it "should return the same results as a client" do
|
30
|
-
FullContact.person("brawest@gmail.com").should == FullContact::Client.new.person("brawest@gmail.com")
|
32
|
+
it "should return the same results as a client by email" do
|
33
|
+
FullContact.person(:email => "brawest@gmail.com").should == FullContact::Client.new.person(:email => "brawest@gmail.com")
|
31
34
|
end
|
32
35
|
|
36
|
+
it "should return the same results as a client by twitter" do
|
37
|
+
FullContact.person(:twitter => "brawtest").should == FullContact::Client.new.person(:twitter => "brawtest")
|
38
|
+
end
|
33
39
|
end
|
34
40
|
|
35
41
|
describe '.respond_to?' do
|
@@ -4,7 +4,7 @@ describe FullContact::Client do
|
|
4
4
|
it "should connect using the endpoint configuration" do
|
5
5
|
client = FullContact::Client.new
|
6
6
|
endpoint = URI.parse(client.api_endpoint)
|
7
|
-
connection = client.send(:connection).build_url(nil).to_s
|
7
|
+
connection = "#{client.send(:connection).build_url(nil).to_s}/"
|
8
8
|
connection.should == endpoint.to_s
|
9
9
|
end
|
10
10
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fullcontact
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: maruku
|
16
|
-
requirement: &
|
16
|
+
requirement: &70239467615240 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0.6'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70239467615240
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nokogiri
|
27
|
-
requirement: &
|
27
|
+
requirement: &70239467614540 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.4'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70239467614540
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70239467613760 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0.9'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70239467613760
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &70239467628820 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '2.6'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70239467628820
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: simplecov
|
60
|
-
requirement: &
|
60
|
+
requirement: &70239467626920 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0.4'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70239467626920
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
|
-
requirement: &
|
71
|
+
requirement: &70239467625280 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '1.6'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70239467625280
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: yard
|
82
|
-
requirement: &
|
82
|
+
requirement: &70239467623380 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0.7'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70239467623380
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: hashie
|
93
|
-
requirement: &
|
93
|
+
requirement: &70239467636700 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
@@ -98,54 +98,54 @@ dependencies:
|
|
98
98
|
version: 1.2.0
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70239467636700
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: faraday
|
104
|
-
requirement: &
|
104
|
+
requirement: &70239467635260 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.
|
109
|
+
version: 0.7.3
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70239467635260
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: faraday_middleware
|
115
|
-
requirement: &
|
115
|
+
requirement: &70239467634180 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ~>
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version: 0.6
|
120
|
+
version: 0.8.6
|
121
121
|
type: :runtime
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70239467634180
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: multi_json
|
126
|
-
requirement: &
|
126
|
+
requirement: &70239467632440 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ~>
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.2.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70239467632440
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: multi_xml
|
137
|
-
requirement: &
|
137
|
+
requirement: &70239467630080 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ~>
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version: 0.2
|
142
|
+
version: 0.4.2
|
143
143
|
type: :runtime
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *70239467630080
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: rash
|
148
|
-
requirement: &
|
148
|
+
requirement: &70239467644300 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ~>
|
@@ -153,7 +153,7 @@ dependencies:
|
|
153
153
|
version: 0.3.0
|
154
154
|
type: :runtime
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *70239467644300
|
157
157
|
description: A Ruby wrapper for the FullContact API
|
158
158
|
email:
|
159
159
|
- brawest@gmail.com
|
@@ -190,11 +190,7 @@ files:
|
|
190
190
|
- spec/ruby_fullcontact/api_spec.rb
|
191
191
|
- spec/ruby_fullcontact/client/person_spec.rb
|
192
192
|
- spec/ruby_fullcontact/client_spec.rb
|
193
|
-
- vendor/cache/addressable-2.2.6.gem
|
194
|
-
- vendor/cache/faraday-0.6.1.gem
|
195
193
|
- vendor/cache/maruku-0.6.0.gem
|
196
|
-
- vendor/cache/multi_json-1.0.3.gem
|
197
|
-
- vendor/cache/multi_xml-0.2.2.gem
|
198
194
|
- vendor/cache/syntax-1.0.0.gem
|
199
195
|
homepage: https://github.com/brandonmwest/rainmaker
|
200
196
|
licenses: []
|
@@ -219,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
219
215
|
version: '0'
|
220
216
|
segments:
|
221
217
|
- 0
|
222
|
-
hash:
|
218
|
+
hash: -646188366586204482
|
223
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
224
220
|
none: false
|
225
221
|
requirements:
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|