linkedin 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. data/{spec/fixtures/blank.xml → .gemtest} +0 -0
  2. data/.gitignore +36 -21
  3. data/.rspec +3 -0
  4. data/.travis.yml +6 -0
  5. data/Gemfile +6 -2
  6. data/Rakefile +9 -31
  7. data/changelog.markdown +1 -1
  8. data/lib/linked_in/api/query_methods.rb +49 -0
  9. data/lib/linked_in/api/update_methods.rb +54 -0
  10. data/lib/linked_in/client.rb +44 -147
  11. data/lib/linked_in/errors.rb +20 -0
  12. data/lib/linked_in/helpers/authorization.rb +67 -0
  13. data/lib/linked_in/helpers/request.rb +77 -0
  14. data/lib/linked_in/mash.rb +68 -0
  15. data/lib/linked_in/search.rb +34 -0
  16. data/lib/linked_in/version.rb +11 -0
  17. data/lib/linkedin.rb +4 -55
  18. data/linkedin.gemspec +26 -47
  19. data/spec/cases/client_spec.rb +260 -276
  20. data/spec/cases/linkedin_spec.rb +6 -6
  21. data/spec/cases/mash_spec.rb +85 -0
  22. data/spec/cases/oauth_spec.rb +146 -92
  23. data/spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml +28 -0
  24. data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml +28 -0
  25. data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml +28 -0
  26. data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml +28 -0
  27. data/spec/helper.rb +30 -0
  28. metadata +139 -169
  29. data/VERSION +0 -1
  30. data/lib/linked_in/api_standard_profile_request.rb +0 -17
  31. data/lib/linked_in/authorization_helpers.rb +0 -48
  32. data/lib/linked_in/base.rb +0 -13
  33. data/lib/linked_in/birthdate.rb +0 -21
  34. data/lib/linked_in/company.rb +0 -11
  35. data/lib/linked_in/connections.rb +0 -16
  36. data/lib/linked_in/country.rb +0 -9
  37. data/lib/linked_in/current_share.rb +0 -56
  38. data/lib/linked_in/education.rb +0 -41
  39. data/lib/linked_in/error.rb +0 -21
  40. data/lib/linked_in/group.rb +0 -32
  41. data/lib/linked_in/languages.rb +0 -28
  42. data/lib/linked_in/likes.rb +0 -23
  43. data/lib/linked_in/location.rb +0 -13
  44. data/lib/linked_in/message.rb +0 -20
  45. data/lib/linked_in/network.rb +0 -12
  46. data/lib/linked_in/patents.rb +0 -42
  47. data/lib/linked_in/people.rb +0 -18
  48. data/lib/linked_in/person.rb +0 -7
  49. data/lib/linked_in/phone_number.rb +0 -29
  50. data/lib/linked_in/position.rb +0 -46
  51. data/lib/linked_in/profile.rb +0 -85
  52. data/lib/linked_in/publications.rb +0 -40
  53. data/lib/linked_in/recipient.rb +0 -7
  54. data/lib/linked_in/recipients.rb +0 -18
  55. data/lib/linked_in/recommendations.rb +0 -30
  56. data/lib/linked_in/short_profile.rb +0 -13
  57. data/lib/linked_in/skill.rb +0 -33
  58. data/lib/linked_in/to_xml_helpers.rb +0 -53
  59. data/lib/linked_in/update.rb +0 -23
  60. data/lib/linked_in/url_resource.rb +0 -26
  61. data/spec/fixtures/connections.xml +0 -3733
  62. data/spec/fixtures/error.xml +0 -7
  63. data/spec/fixtures/likes.xml +0 -18
  64. data/spec/fixtures/mailbox_items.xml +0 -16
  65. data/spec/fixtures/network_status_with_group.xml +0 -44
  66. data/spec/fixtures/network_statuses.xml +0 -317
  67. data/spec/fixtures/picture_updates.xml +0 -117
  68. data/spec/fixtures/profile.xml +0 -9
  69. data/spec/fixtures/profile_full.xml +0 -3906
  70. data/spec/fixtures/profile_with_positions.xml +0 -79
  71. data/spec/fixtures/search.xml +0 -538
  72. data/spec/fixtures/shares.xml +0 -12
  73. data/spec/fixtures/status.xml +0 -2
  74. data/spec/spec_helper.rb +0 -49
@@ -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>
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
- <current-status>New blog post: What makes a good API wrapper? http://wynnnetherland.com/2009/11/what-makes-a-good-api-wrapper/</current-status>
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