linkedin 0.2.2 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/{spec/fixtures/blank.xml → .gemtest} +0 -0
- data/.gitignore +36 -21
- data/.rspec +3 -0
- data/.travis.yml +6 -0
- data/Gemfile +6 -2
- data/Rakefile +9 -31
- data/changelog.markdown +1 -1
- data/lib/linked_in/api/query_methods.rb +49 -0
- data/lib/linked_in/api/update_methods.rb +54 -0
- data/lib/linked_in/client.rb +44 -147
- data/lib/linked_in/errors.rb +20 -0
- data/lib/linked_in/helpers/authorization.rb +67 -0
- data/lib/linked_in/helpers/request.rb +77 -0
- data/lib/linked_in/mash.rb +68 -0
- data/lib/linked_in/search.rb +34 -0
- data/lib/linked_in/version.rb +11 -0
- data/lib/linkedin.rb +4 -55
- data/linkedin.gemspec +26 -47
- data/spec/cases/client_spec.rb +260 -276
- data/spec/cases/linkedin_spec.rb +6 -6
- data/spec/cases/mash_spec.rb +85 -0
- data/spec/cases/oauth_spec.rb +146 -92
- data/spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml +28 -0
- data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml +28 -0
- data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml +28 -0
- data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml +28 -0
- data/spec/helper.rb +30 -0
- metadata +139 -169
- data/VERSION +0 -1
- data/lib/linked_in/api_standard_profile_request.rb +0 -17
- data/lib/linked_in/authorization_helpers.rb +0 -48
- data/lib/linked_in/base.rb +0 -13
- data/lib/linked_in/birthdate.rb +0 -21
- data/lib/linked_in/company.rb +0 -11
- data/lib/linked_in/connections.rb +0 -16
- data/lib/linked_in/country.rb +0 -9
- data/lib/linked_in/current_share.rb +0 -56
- data/lib/linked_in/education.rb +0 -41
- data/lib/linked_in/error.rb +0 -21
- data/lib/linked_in/group.rb +0 -32
- data/lib/linked_in/languages.rb +0 -28
- data/lib/linked_in/likes.rb +0 -23
- data/lib/linked_in/location.rb +0 -13
- data/lib/linked_in/message.rb +0 -20
- data/lib/linked_in/network.rb +0 -12
- data/lib/linked_in/patents.rb +0 -42
- data/lib/linked_in/people.rb +0 -18
- data/lib/linked_in/person.rb +0 -7
- data/lib/linked_in/phone_number.rb +0 -29
- data/lib/linked_in/position.rb +0 -46
- data/lib/linked_in/profile.rb +0 -85
- data/lib/linked_in/publications.rb +0 -40
- data/lib/linked_in/recipient.rb +0 -7
- data/lib/linked_in/recipients.rb +0 -18
- data/lib/linked_in/recommendations.rb +0 -30
- data/lib/linked_in/short_profile.rb +0 -13
- data/lib/linked_in/skill.rb +0 -33
- data/lib/linked_in/to_xml_helpers.rb +0 -53
- data/lib/linked_in/update.rb +0 -23
- data/lib/linked_in/url_resource.rb +0 -26
- data/spec/fixtures/connections.xml +0 -3733
- data/spec/fixtures/error.xml +0 -7
- data/spec/fixtures/likes.xml +0 -18
- data/spec/fixtures/mailbox_items.xml +0 -16
- data/spec/fixtures/network_status_with_group.xml +0 -44
- data/spec/fixtures/network_statuses.xml +0 -317
- data/spec/fixtures/picture_updates.xml +0 -117
- data/spec/fixtures/profile.xml +0 -9
- data/spec/fixtures/profile_full.xml +0 -3906
- data/spec/fixtures/profile_with_positions.xml +0 -79
- data/spec/fixtures/search.xml +0 -538
- data/spec/fixtures/shares.xml +0 -12
- data/spec/fixtures/status.xml +0 -2
- data/spec/spec_helper.rb +0 -49
data/spec/fixtures/shares.xml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<share>
|
3
|
-
<comment>Testing out the LinkedIn API</comment>
|
4
|
-
<content>
|
5
|
-
<title>Share</title>
|
6
|
-
<submitted-url>http://www.linkedin.com</submitted-url>
|
7
|
-
<submitted-image-url>http://www.linkedin.com/pretty_logo.jpg</submitted-image-url>
|
8
|
-
</content>
|
9
|
-
<visibility>
|
10
|
-
<code>anyone</code>
|
11
|
-
</visibility>
|
12
|
-
</share>
|
data/spec/fixtures/status.xml
DELETED
data/spec/spec_helper.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'webmock/rspec'
|
2
|
-
|
3
|
-
require 'linkedin'
|
4
|
-
|
5
|
-
|
6
|
-
def fixture_path
|
7
|
-
File.expand_path("../fixtures", __FILE__)
|
8
|
-
end
|
9
|
-
|
10
|
-
def fixture(file)
|
11
|
-
File.new(fixture_path + '/' + file)
|
12
|
-
end
|
13
|
-
|
14
|
-
|
15
|
-
def linkedin_url(url)
|
16
|
-
url =~ /^http/ ? url : "https://api.linkedin.com#{url}"
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
def stub_get(url, filename, status=nil)
|
21
|
-
options = { :body => fixture(filename) }
|
22
|
-
options.merge!({ :status => status }) unless status.nil?
|
23
|
-
|
24
|
-
stub_request(:get, linkedin_url(url)).to_return(options)
|
25
|
-
end
|
26
|
-
|
27
|
-
def stub_post(url, result)
|
28
|
-
result_hash = { :status => 201 }
|
29
|
-
result_hash[:body] = fixture(result) if result
|
30
|
-
|
31
|
-
stub_request(:post, linkedin_url(url)).to_return(result_hash)
|
32
|
-
end
|
33
|
-
|
34
|
-
def expect_post(url, body, result = nil)
|
35
|
-
a_request(:post, linkedin_url(url)).with({
|
36
|
-
:body => fixture(body).read,
|
37
|
-
:headers => { :content_type => 'application/xml' }
|
38
|
-
}).should have_been_made.once
|
39
|
-
end
|
40
|
-
|
41
|
-
def stub_put(url, returns_xml, status=nil)
|
42
|
-
options = { :body => fixture(returns_xml) }
|
43
|
-
options.merge!({ :status => status }) unless status.nil?
|
44
|
-
stub_request(:put, linkedin_url(url)).to_return(options)
|
45
|
-
end
|
46
|
-
|
47
|
-
def stub_delete(url, returns_xml)
|
48
|
-
stub_request(:delete, linkedin_url(url)).to_return(:body => fixture(returns_xml))
|
49
|
-
end
|