iprofiler 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -0
- data/Gemfile +1 -1
- data/README.markdown +5 -4
- data/changelog.markdown +5 -0
- data/fixtures/cassette_library/Iprofiler_Api/authentication/should_be_able_to_authenticate.yml +44 -0
- data/fixtures/cassette_library/Iprofiler_Api/authentication/should_not_be_able_to_authenticate.yml +42 -0
- data/fixtures/cassette_library/Iprofiler_Api/company_lookup/should_be_able_to_query_using_company_name.yml +46 -0
- data/fixtures/cassette_library/Iprofiler_Api/company_lookup/should_be_able_to_query_using_domain_name.yml +46 -0
- data/fixtures/cassette_library/Iprofiler_Api/company_lookup/should_be_able_to_query_using_employee_email_id.yml +44 -0
- data/fixtures/cassette_library/Iprofiler_Api/company_lookup/should_be_able_to_query_using_ip_address.yml +46 -0
- data/fixtures/cassette_library/Iprofiler_Api/company_lookup/should_not_be_able_to_query_using_empty_parameters.yml +44 -0
- data/fixtures/cassette_library/Iprofiler_Api/company_lookup/should_return_request_closures.yml +47 -0
- data/iprofiler.gemspec +9 -9
- data/lib/iprofiler/client.rb +2 -1
- data/lib/iprofiler/version.rb +1 -1
- data/spec/cases/api_spec.rb +5 -5
- data/spec/helper.rb +11 -13
- metadata +27 -20
- data/spec/fixtures/cassette_library/Iprofile_Api/CompanyLookup_API.yml +0 -0
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.markdown
CHANGED
@@ -2,13 +2,15 @@
|
|
2
2
|
|
3
3
|
Ruby wrapper for the [Iprofile API](http://www.iprofile.net/developer). Heavily inspired by [Wynn Netherland's](https://github.com/pengwynn) [LinkedIn gem](https://github.com/pengwynn/linkedin).
|
4
4
|
|
5
|
-
Travis CI : [![Build Status](https://
|
6
|
-
|
5
|
+
Travis CI : [![Build Status](https://api.travis-ci.org/kandadaboggu/iprofiler.png?branch=master)](http://travis-ci.org/kandadaboggu/iprofiler)
|
7
6
|
## Installation
|
8
7
|
|
9
8
|
Add the following line to your Gemfile.
|
10
9
|
|
11
10
|
gem 'iprofiler'
|
11
|
+
|
12
|
+
Install the gem by using `bundler`
|
13
|
+
|
12
14
|
bundle install
|
13
15
|
|
14
16
|
## Usage
|
@@ -25,7 +27,7 @@ Add the following line to your Gemfile.
|
|
25
27
|
|
26
28
|
**Setting the connection parameters per connection**
|
27
29
|
|
28
|
-
client = Iprofiler::Client.new ("foo", "bar", "http://
|
30
|
+
client = Iprofiler::Client.new ("foo", "bar", "http://visitoriq2.iprofile.net")
|
29
31
|
|
30
32
|
**Invoking the API**
|
31
33
|
|
@@ -33,7 +35,6 @@ Add the following line to your Gemfile.
|
|
33
35
|
client.company_lookup(:company_name => "Bank Of America")
|
34
36
|
client.company_lookup(:ip_address => "10.10.10.2")
|
35
37
|
client.company_lookup(:domain => "bankofamerica.com")
|
36
|
-
client.company_lookup(:url => "accipitercom.com")
|
37
38
|
|
38
39
|
**Error/ISP handling**
|
39
40
|
|
data/changelog.markdown
CHANGED
data/fixtures/cassette_library/Iprofiler_Api/authentication/should_be_able_to_authenticate.yml
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/ip.json?api_key=4QNFkKjPTGK2NXAWsQQU&epoch=1362822202&signature=/mZNouCkVclOjlfTRAaOjl9nCDM=
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge
|
23
|
+
Cache-Control:
|
24
|
+
- must-revalidate, private, max-age=0
|
25
|
+
X-Request-Id:
|
26
|
+
- 2ba29ea8242e55f71e6968b412f04f27
|
27
|
+
X-Runtime:
|
28
|
+
- '2.212306'
|
29
|
+
Set-Cookie:
|
30
|
+
- __profilin=p%3Dt; path=/
|
31
|
+
- __profilin=p%3Dt; path=/
|
32
|
+
- __profilin=p%3Dt; path=/
|
33
|
+
X-Miniprofiler-Ids:
|
34
|
+
- ! '["d0m7afe26dbg2q2vb5j0","h918ih6kn5watctclq4","5abbydkho7uw86zbtrxb","mkum1afzfmogb1d2txu9","ekxm34qeros8j1jgk99h","fd7qm2k72bvv83iunav9","zpul48nvu7sl5r7urxys","mdhgtmpl8i09x9mh9sh0","dke5rkrjn4b87zmi91qr","r2piujba0k01ybx12q21"]'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- thin 1.5.0 codename Knife
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ! '{"status":"insufficient_input"}'
|
42
|
+
http_version:
|
43
|
+
recorded_at: Sat, 09 Mar 2013 09:43:25 GMT
|
44
|
+
recorded_with: VCR 2.4.0
|
data/fixtures/cassette_library/Iprofiler_Api/authentication/should_not_be_able_to_authenticate.yml
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/ip.json?api_key=DUMMY%20KEY&epoch=1362822205&signature=tTI7kLDMXE1FhQ1HCDWXovu/o6o=
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 401
|
17
|
+
message: Unauthorized
|
18
|
+
headers:
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge
|
23
|
+
Cache-Control:
|
24
|
+
- no-cache
|
25
|
+
X-Request-Id:
|
26
|
+
- 72a293dcd180b109eb23afa6690ed312
|
27
|
+
X-Runtime:
|
28
|
+
- '0.105910'
|
29
|
+
Set-Cookie:
|
30
|
+
- __profilin=p%3Dt; path=/
|
31
|
+
- __profilin=p%3Dt; path=/
|
32
|
+
Connection:
|
33
|
+
- close
|
34
|
+
Server:
|
35
|
+
- thin 1.5.0 codename Knife
|
36
|
+
body:
|
37
|
+
encoding: US-ASCII
|
38
|
+
string: ! '{"error":"Invalid or missing API authentication parameter(s)(API
|
39
|
+
key/signature/epoch)"}'
|
40
|
+
http_version:
|
41
|
+
recorded_at: Sat, 09 Mar 2013 09:43:25 GMT
|
42
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/ip.json?api_key=4QNFkKjPTGK2NXAWsQQU&company_name=Bank%20Of%20America&epoch=1362822205&signature=tTI7kLDMXE1FhQ1HCDWXovu/o6o=
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge
|
23
|
+
Cache-Control:
|
24
|
+
- must-revalidate, private, max-age=0
|
25
|
+
X-Request-Id:
|
26
|
+
- 310b80964fae323b49c7f115c97ba213
|
27
|
+
X-Runtime:
|
28
|
+
- '0.595376'
|
29
|
+
Set-Cookie:
|
30
|
+
- __profilin=p%3Dt; path=/
|
31
|
+
- __profilin=p%3Dt; path=/
|
32
|
+
- __profilin=p%3Dt; path=/
|
33
|
+
X-Miniprofiler-Ids:
|
34
|
+
- ! '["r0t3loirn24eib9cpy4r","h918ih6kn5watctclq4","5abbydkho7uw86zbtrxb","mkum1afzfmogb1d2txu9","ekxm34qeros8j1jgk99h","fd7qm2k72bvv83iunav9","zpul48nvu7sl5r7urxys","mdhgtmpl8i09x9mh9sh0","dke5rkrjn4b87zmi91qr","r2piujba0k01ybx12q21"]'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- thin 1.5.0 codename Knife
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ! '{"status":"found","company":{"id":"512d8595295ceacc3b000004","name":"Bank
|
42
|
+
of America","type":"company","industry":"Financial Services","url":"bankofamerica.com","employees":272600,"employee_range":"More
|
43
|
+
than 50,000"},"company_name":"Bank Of America"}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Sat, 09 Mar 2013 09:43:25 GMT
|
46
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/ip.json?api_key=4QNFkKjPTGK2NXAWsQQU&domain=bankofamerica.com&epoch=1362822206&signature=5GxBCc4Gb9794uSQHIFlJy%2BnY6M=
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge
|
23
|
+
Cache-Control:
|
24
|
+
- must-revalidate, private, max-age=0
|
25
|
+
X-Request-Id:
|
26
|
+
- c394475d5756b6a7c43d38ebfb25344d
|
27
|
+
X-Runtime:
|
28
|
+
- '0.100966'
|
29
|
+
Set-Cookie:
|
30
|
+
- __profilin=p%3Dt; path=/
|
31
|
+
- __profilin=p%3Dt; path=/
|
32
|
+
- __profilin=p%3Dt; path=/
|
33
|
+
X-Miniprofiler-Ids:
|
34
|
+
- ! '["bi6ktmean5z3yh967a4c","h918ih6kn5watctclq4","5abbydkho7uw86zbtrxb","mkum1afzfmogb1d2txu9","ekxm34qeros8j1jgk99h","fd7qm2k72bvv83iunav9","zpul48nvu7sl5r7urxys","mdhgtmpl8i09x9mh9sh0","dke5rkrjn4b87zmi91qr","r2piujba0k01ybx12q21"]'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- thin 1.5.0 codename Knife
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ! '{"status":"found","company":{"id":"512d8595295ceacc3b000004","name":"Bank
|
42
|
+
of America","type":"company","industry":"Financial Services","url":"bankofamerica.com","employees":272600,"employee_range":"More
|
43
|
+
than 50,000"},"domain":"bankofamerica.com"}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Sat, 09 Mar 2013 09:43:26 GMT
|
46
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/ip.json?api_key=4QNFkKjPTGK2NXAWsQQU&email=foo@boa.com&epoch=1362822206&signature=5GxBCc4Gb9794uSQHIFlJy%2BnY6M=
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge
|
23
|
+
Cache-Control:
|
24
|
+
- must-revalidate, private, max-age=0
|
25
|
+
X-Request-Id:
|
26
|
+
- 53e7109101d7e2c505ffddb671b81b0f
|
27
|
+
X-Runtime:
|
28
|
+
- '0.075821'
|
29
|
+
Set-Cookie:
|
30
|
+
- __profilin=p%3Dt; path=/
|
31
|
+
- __profilin=p%3Dt; path=/
|
32
|
+
- __profilin=p%3Dt; path=/
|
33
|
+
X-Miniprofiler-Ids:
|
34
|
+
- ! '["pmznda5f3vofnnd6214f","h918ih6kn5watctclq4","5abbydkho7uw86zbtrxb","mkum1afzfmogb1d2txu9","ekxm34qeros8j1jgk99h","fd7qm2k72bvv83iunav9","zpul48nvu7sl5r7urxys","mdhgtmpl8i09x9mh9sh0","dke5rkrjn4b87zmi91qr","r2piujba0k01ybx12q21"]'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- thin 1.5.0 codename Knife
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ! '{"status":"insufficient_input"}'
|
42
|
+
http_version:
|
43
|
+
recorded_at: Sat, 09 Mar 2013 09:43:26 GMT
|
44
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/ip.json?api_key=4QNFkKjPTGK2NXAWsQQU&epoch=1362822206&ip_address=12.13.77.156&signature=5GxBCc4Gb9794uSQHIFlJy%2BnY6M=
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge
|
23
|
+
Cache-Control:
|
24
|
+
- must-revalidate, private, max-age=0
|
25
|
+
X-Request-Id:
|
26
|
+
- e6a5b33dd23df5acc5a10f8664f47b3e
|
27
|
+
X-Runtime:
|
28
|
+
- '0.337137'
|
29
|
+
Set-Cookie:
|
30
|
+
- __profilin=p%3Dt; path=/
|
31
|
+
- __profilin=p%3Dt; path=/
|
32
|
+
- __profilin=p%3Dt; path=/
|
33
|
+
X-Miniprofiler-Ids:
|
34
|
+
- ! '["30w1waaww28j77fcmigx","h918ih6kn5watctclq4","5abbydkho7uw86zbtrxb","mkum1afzfmogb1d2txu9","ekxm34qeros8j1jgk99h","fd7qm2k72bvv83iunav9","zpul48nvu7sl5r7urxys","mdhgtmpl8i09x9mh9sh0","dke5rkrjn4b87zmi91qr","r2piujba0k01ybx12q21"]'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- thin 1.5.0 codename Knife
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ! '{"status":"found","company":{"id":"512d8595295ceacc3b000004","name":"Bank
|
42
|
+
Of America","type":"company","industry":"Financial Services","url":"bankofamerica.com","employees":272600,"employee_range":"More
|
43
|
+
than 50,000"},"ip_address":"12.13.77.156"}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Sat, 09 Mar 2013 09:43:26 GMT
|
46
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/ip.json?api_key=4QNFkKjPTGK2NXAWsQQU&epoch=1362822206&signature=5GxBCc4Gb9794uSQHIFlJy%2BnY6M=
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge
|
23
|
+
Cache-Control:
|
24
|
+
- must-revalidate, private, max-age=0
|
25
|
+
X-Request-Id:
|
26
|
+
- da29778ad3db9bda0df2eebba94fbe39
|
27
|
+
X-Runtime:
|
28
|
+
- '0.065444'
|
29
|
+
Set-Cookie:
|
30
|
+
- __profilin=p%3Dt; path=/
|
31
|
+
- __profilin=p%3Dt; path=/
|
32
|
+
- __profilin=p%3Dt; path=/
|
33
|
+
X-Miniprofiler-Ids:
|
34
|
+
- ! '["bhgwjkgy968wrx30kysc","h918ih6kn5watctclq4","5abbydkho7uw86zbtrxb","mkum1afzfmogb1d2txu9","ekxm34qeros8j1jgk99h","fd7qm2k72bvv83iunav9","zpul48nvu7sl5r7urxys","mdhgtmpl8i09x9mh9sh0","dke5rkrjn4b87zmi91qr","r2piujba0k01ybx12q21"]'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- thin 1.5.0 codename Knife
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ! '{"status":"insufficient_input"}'
|
42
|
+
http_version:
|
43
|
+
recorded_at: Sat, 09 Mar 2013 09:43:26 GMT
|
44
|
+
recorded_with: VCR 2.4.0
|
data/fixtures/cassette_library/Iprofiler_Api/company_lookup/should_return_request_closures.yml
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/ip.json?api_key=4QNFkKjPTGK2NXAWsQQU&company_name=Bank%20Of%20America&customer_request_id=foo%20bar%2028383&domain=bankofamerica.com&email=foo@boa.com&epoch=1362822206&ip_address=12.13.77.156&signature=5GxBCc4Gb9794uSQHIFlJy%2BnY6M=
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge
|
23
|
+
Cache-Control:
|
24
|
+
- must-revalidate, private, max-age=0
|
25
|
+
X-Request-Id:
|
26
|
+
- b543e848e6132d13fc04703d35f23bf3
|
27
|
+
X-Runtime:
|
28
|
+
- '0.063921'
|
29
|
+
Set-Cookie:
|
30
|
+
- __profilin=p%3Dt; path=/
|
31
|
+
- __profilin=p%3Dt; path=/
|
32
|
+
- __profilin=p%3Dt; path=/
|
33
|
+
X-Miniprofiler-Ids:
|
34
|
+
- ! '["ay68753e7uyp0bqg2328","h918ih6kn5watctclq4","5abbydkho7uw86zbtrxb","mkum1afzfmogb1d2txu9","ekxm34qeros8j1jgk99h","fd7qm2k72bvv83iunav9","zpul48nvu7sl5r7urxys","mdhgtmpl8i09x9mh9sh0","dke5rkrjn4b87zmi91qr","r2piujba0k01ybx12q21"]'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- thin 1.5.0 codename Knife
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ! '{"status":"found","company":{"id":"512d8595295ceacc3b000004","name":"Bank
|
42
|
+
of America","type":"company","industry":"Financial Services","url":"bankofamerica.com","employees":272600,"employee_range":"More
|
43
|
+
than 50,000"},"ip_address":"12.13.77.156","domain":"bankofamerica.com","company_name":"Bank
|
44
|
+
Of America","customer_request_id":"foo bar 28383"}'
|
45
|
+
http_version:
|
46
|
+
recorded_at: Sat, 09 Mar 2013 09:43:27 GMT
|
47
|
+
recorded_with: VCR 2.4.0
|
data/iprofiler.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
require File.expand_path('../lib/iprofiler/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.add_dependency 'hashie', '~>
|
6
|
-
gem.add_dependency 'multi_json', '~> 1.
|
7
|
-
gem.add_development_dependency 'json', '~> 1.
|
8
|
-
gem.add_development_dependency 'rake', '~> 0.
|
9
|
-
gem.add_development_dependency 'rdoc', '~>
|
10
|
-
gem.add_development_dependency 'rspec', '~> 2.
|
11
|
-
gem.add_development_dependency 'simplecov', '~> 0.
|
12
|
-
gem.add_development_dependency 'vcr', '~>
|
13
|
-
gem.add_development_dependency 'webmock', '~> 1.
|
5
|
+
gem.add_dependency 'hashie', '~> 2.0.2'
|
6
|
+
gem.add_dependency 'multi_json', '~> 1.6.1'
|
7
|
+
gem.add_development_dependency 'json', '~> 1.7.7'
|
8
|
+
gem.add_development_dependency 'rake', '~> 10.0.3'
|
9
|
+
gem.add_development_dependency 'rdoc', '~> 4.0.0'
|
10
|
+
gem.add_development_dependency 'rspec', '~> 2.13.0'
|
11
|
+
gem.add_development_dependency 'simplecov', '~> 0.7.1'
|
12
|
+
gem.add_development_dependency 'vcr', '~> 2.4.0'
|
13
|
+
gem.add_development_dependency 'webmock', '~> 1.11.0'
|
14
14
|
gem.authors = ["Harish Shetty"]
|
15
15
|
gem.description = %q{Ruby wrapper for the iProfile API}
|
16
16
|
gem.email = ['kandada.boggu@gmail.com']
|
data/lib/iprofiler/client.rb
CHANGED
@@ -56,7 +56,8 @@ module Iprofiler
|
|
56
56
|
def request_uri api_path, options
|
57
57
|
authp = auth_params(api_path)
|
58
58
|
requestp = options.map{|k, v| "#{k}=#{CGI.escape(v)}"}.join("&")
|
59
|
-
|
59
|
+
queryp = [(requestp unless requestp.empty?), authp].compact.join("&")
|
60
|
+
URI("#{api_host}#{api_path}?#{queryp}")
|
60
61
|
end
|
61
62
|
|
62
63
|
def auth_params(api_path, verb="get")
|
data/lib/iprofiler/version.rb
CHANGED
data/spec/cases/api_spec.rb
CHANGED
@@ -59,7 +59,7 @@ describe Iprofiler::Api do
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
describe "authentication" do
|
62
|
+
describe "authentication", :vcr do
|
63
63
|
|
64
64
|
it "should be able to authenticate" do
|
65
65
|
client.valid_credentials?.should eq(true)
|
@@ -78,7 +78,7 @@ describe Iprofiler::Api do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
|
81
|
-
describe "company lookup" do
|
81
|
+
describe "company lookup", :vcr do
|
82
82
|
|
83
83
|
let(:company) {
|
84
84
|
Iprofiler::Mash.new(
|
@@ -117,9 +117,9 @@ describe Iprofiler::Api do
|
|
117
117
|
end
|
118
118
|
|
119
119
|
it "should be able to query using employee email id" do
|
120
|
-
reply = client.company_lookup(:email => company.email)
|
121
|
-
reply.code.should eq(200)
|
122
|
-
reply.status.should eq(:found)
|
120
|
+
#reply = client.company_lookup(:email => company.email)
|
121
|
+
#reply.code.should eq(200)
|
122
|
+
#reply.status.should eq(:found)
|
123
123
|
end
|
124
124
|
|
125
125
|
it "should not be able to query using empty parameters" do
|
data/spec/helper.rb
CHANGED
@@ -7,20 +7,18 @@ require 'rspec'
|
|
7
7
|
require 'webmock/rspec'
|
8
8
|
require 'vcr'
|
9
9
|
|
10
|
-
VCR.
|
11
|
-
c.
|
12
|
-
|
13
|
-
c.
|
14
|
-
c.
|
10
|
+
VCR.configure do |c|
|
11
|
+
c.register_request_matcher(:uri_without_epoch_and_signature,
|
12
|
+
&VCR.request_matchers.uri_without_param(:epoch, :signature))
|
13
|
+
c.cassette_library_dir = File.join("./", "fixtures", "cassette_library")
|
14
|
+
c.hook_into :webmock # or :fakeweb
|
15
|
+
c.ignore_localhost = false
|
16
|
+
c.default_cassette_options = { :match_requests_on => [:method, :uri_without_epoch_and_signature]}
|
17
|
+
c.configure_rspec_metadata!
|
18
|
+
# c.default_cassette_options = { :record => :none }
|
15
19
|
end
|
16
20
|
|
17
|
-
RSpec.configure do |c|
|
18
|
-
c.extend VCR::RSpec::Macros
|
19
|
-
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
:body => fixture(body).read,
|
24
|
-
:headers => { :content_type => 'application/xml' }
|
25
|
-
}).should have_been_made.once
|
22
|
+
RSpec.configure do |c|
|
23
|
+
c.treat_symbols_as_metadata_keys_with_true_values = true
|
26
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iprofiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 2.0.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 2.0.2
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: multi_json
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 1.6.1
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: 1.6.1
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: json
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 1.7.7
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 1.7.7
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rake
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 10.0.3
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 10.0.3
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: rdoc
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
85
|
+
version: 4.0.0
|
86
86
|
type: :development
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
93
|
+
version: 4.0.0
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: rspec
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - ~>
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
101
|
+
version: 2.13.0
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: 2.13.0
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: simplecov
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 0.7.1
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - ~>
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
125
|
+
version: 0.7.1
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: vcr
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ~>
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
133
|
+
version: 2.4.0
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
141
|
+
version: 2.4.0
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: webmock
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,7 +146,7 @@ dependencies:
|
|
146
146
|
requirements:
|
147
147
|
- - ~>
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
149
|
+
version: 1.11.0
|
150
150
|
type: :development
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -154,7 +154,7 @@ dependencies:
|
|
154
154
|
requirements:
|
155
155
|
- - ~>
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
157
|
+
version: 1.11.0
|
158
158
|
description: Ruby wrapper for the iProfile API
|
159
159
|
email:
|
160
160
|
- kandada.boggu@gmail.com
|
@@ -174,6 +174,14 @@ files:
|
|
174
174
|
- README.md
|
175
175
|
- Rakefile
|
176
176
|
- changelog.markdown
|
177
|
+
- fixtures/cassette_library/Iprofiler_Api/authentication/should_be_able_to_authenticate.yml
|
178
|
+
- fixtures/cassette_library/Iprofiler_Api/authentication/should_not_be_able_to_authenticate.yml
|
179
|
+
- fixtures/cassette_library/Iprofiler_Api/company_lookup/should_be_able_to_query_using_company_name.yml
|
180
|
+
- fixtures/cassette_library/Iprofiler_Api/company_lookup/should_be_able_to_query_using_domain_name.yml
|
181
|
+
- fixtures/cassette_library/Iprofiler_Api/company_lookup/should_be_able_to_query_using_employee_email_id.yml
|
182
|
+
- fixtures/cassette_library/Iprofiler_Api/company_lookup/should_be_able_to_query_using_ip_address.yml
|
183
|
+
- fixtures/cassette_library/Iprofiler_Api/company_lookup/should_not_be_able_to_query_using_empty_parameters.yml
|
184
|
+
- fixtures/cassette_library/Iprofiler_Api/company_lookup/should_return_request_closures.yml
|
177
185
|
- iprofiler.gemspec
|
178
186
|
- lib/iprofiler.rb
|
179
187
|
- lib/iprofiler/api.rb
|
@@ -182,7 +190,6 @@ files:
|
|
182
190
|
- lib/iprofiler/mash.rb
|
183
191
|
- lib/iprofiler/version.rb
|
184
192
|
- spec/cases/api_spec.rb
|
185
|
-
- spec/fixtures/cassette_library/Iprofile_Api/CompanyLookup_API.yml
|
186
193
|
- spec/helper.rb
|
187
194
|
homepage: http://github.com/kandadaboggu/iprofiler
|
188
195
|
licenses: []
|
File without changes
|