linkedin 0.2.2 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,28 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: https://api.linkedin.com:443/uas/oauth/requestToken
6
+ body:
7
+ headers:
8
+ user-agent:
9
+ - OAuth gem v0.4.4
10
+ authorization:
11
+ - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", oauth_consumer_key="eAI15DqRUTTd7OuQJBG3Mo0aw2Ekx5yoLX3x3NaLnbTnZbaU46OEii7uNTKijII4", oauth_nonce="5INIHjRHjfLCYQX0r7cArMGiUPXoH62wEAgbrh1M", oauth_signature="K1kJU%2FQsuIKj1OUKsaUIcM1xr8Q%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1297103788", oauth_version="1.0"
12
+ content-length:
13
+ - "0"
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ content-type:
20
+ - text/plain
21
+ server:
22
+ - Apache-Coyote/1.1
23
+ date:
24
+ - Mon, 07 Feb 2011 18:36:29 GMT
25
+ content-length:
26
+ - "236"
27
+ body: oauth_token=fe9d7429-e5cc-47c2-b396-23521d86cf9c&oauth_token_secret=092e7c24-8ad8-4ca9-8f92-8c4f17664bcb&oauth_callback_confirmed=true&xoauth_request_auth_url=https%3A%2F%2Fapi.linkedin.com%2Fuas%2Foauth%2Fauthorize&oauth_expires_in=599
28
+ http_version: "1.1"
data/spec/helper.rb ADDED
@@ -0,0 +1,30 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'simplecov'
4
+ SimpleCov.start
5
+ require 'linkedin'
6
+ require 'rspec'
7
+ require 'webmock/rspec'
8
+ require 'vcr'
9
+
10
+ VCR.config do |c|
11
+ c.cassette_library_dir = 'spec/fixtures/cassette_library'
12
+ c.stub_with :webmock
13
+ c.ignore_localhost = true
14
+ c.default_cassette_options = { :record => :none }
15
+ end
16
+
17
+ RSpec.configure do |c|
18
+ c.extend VCR::RSpec::Macros
19
+ end
20
+
21
+ def linkedin_url(url)
22
+ url =~ /^http/ ? url : "https://api.linkedin.com#{url}"
23
+ end
24
+
25
+ def expect_post(url, body, result = nil)
26
+ a_request(:post, linkedin_url(url)).with({
27
+ :body => fixture(body).read,
28
+ :headers => { :content_type => 'application/xml' }
29
+ }).should have_been_made.once
30
+ end
metadata CHANGED
@@ -1,232 +1,202 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: linkedin
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 2
10
- version: 0.2.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Wynn Netherland
14
9
  - Josh Kalderimis
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2010-03-01 00:00:00 +01:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
13
+ date: 2011-07-22 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ requirement: &70124430784760 !ruby/object:Gem::Requirement
24
18
  none: false
25
- requirements:
19
+ requirements:
26
20
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 15
29
- segments:
30
- - 0
31
- - 4
32
- - 0
33
- version: 0.4.0
21
+ - !ruby/object:Gem::Version
22
+ version: '0.9'
23
+ type: :development
34
24
  prerelease: false
35
- type: :runtime
36
- requirement: *id001
37
- name: oauth
38
- - !ruby/object:Gem::Dependency
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *70124430784760
26
+ - !ruby/object:Gem::Dependency
27
+ name: rdoc
28
+ requirement: &70124430783800 !ruby/object:Gem::Requirement
40
29
  none: false
41
- requirements:
30
+ requirements:
42
31
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 15
45
- segments:
46
- - 1
47
- - 4
48
- - 4
49
- version: 1.4.4
32
+ - !ruby/object:Gem::Version
33
+ version: '3.8'
34
+ type: :development
50
35
  prerelease: false
51
- type: :runtime
52
- requirement: *id002
53
- name: nokogiri
54
- - !ruby/object:Gem::Dependency
55
- version_requirements: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *70124430783800
37
+ - !ruby/object:Gem::Dependency
38
+ name: rspec
39
+ requirement: &70124430783140 !ruby/object:Gem::Requirement
56
40
  none: false
57
- requirements:
41
+ requirements:
58
42
  - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 31
61
- segments:
62
- - 2
63
- - 4
64
- - 0
65
- version: 2.4.0
66
- prerelease: false
43
+ - !ruby/object:Gem::Version
44
+ version: '2.6'
67
45
  type: :development
68
- requirement: *id003
69
- name: rspec
70
- - !ruby/object:Gem::Dependency
71
- version_requirements: &id004 !ruby/object:Gem::Requirement
46
+ prerelease: false
47
+ version_requirements: *70124430783140
48
+ - !ruby/object:Gem::Dependency
49
+ name: simplecov
50
+ requirement: &70124430782600 !ruby/object:Gem::Requirement
72
51
  none: false
73
- requirements:
52
+ requirements:
74
53
  - - ~>
75
- - !ruby/object:Gem::Version
76
- hash: 49
77
- segments:
78
- - 0
79
- - 8
80
- - 7
81
- version: 0.8.7
54
+ - !ruby/object:Gem::Version
55
+ version: '0.4'
56
+ type: :development
82
57
  prerelease: false
58
+ version_requirements: *70124430782600
59
+ - !ruby/object:Gem::Dependency
60
+ name: vcr
61
+ requirement: &70124430782100 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ~>
65
+ - !ruby/object:Gem::Version
66
+ version: '1.10'
83
67
  type: :development
84
- requirement: *id004
85
- name: rake
86
- - !ruby/object:Gem::Dependency
87
- version_requirements: &id005 !ruby/object:Gem::Requirement
68
+ prerelease: false
69
+ version_requirements: *70124430782100
70
+ - !ruby/object:Gem::Dependency
71
+ name: webmock
72
+ requirement: &70124430781480 !ruby/object:Gem::Requirement
88
73
  none: false
89
- requirements:
74
+ requirements:
90
75
  - - ~>
91
- - !ruby/object:Gem::Version
92
- hash: 15
93
- segments:
94
- - 1
95
- - 6
96
- - 0
97
- version: 1.6.0
76
+ - !ruby/object:Gem::Version
77
+ version: '1.6'
78
+ type: :development
98
79
  prerelease: false
80
+ version_requirements: *70124430781480
81
+ - !ruby/object:Gem::Dependency
82
+ name: yajl-ruby
83
+ requirement: &70124430799940 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ version: '0.8'
99
89
  type: :development
100
- requirement: *id005
101
- name: webmock
90
+ prerelease: false
91
+ version_requirements: *70124430799940
92
+ - !ruby/object:Gem::Dependency
93
+ name: hashie
94
+ requirement: &70124430799380 !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ~>
98
+ - !ruby/object:Gem::Version
99
+ version: 1.0.0
100
+ type: :runtime
101
+ prerelease: false
102
+ version_requirements: *70124430799380
103
+ - !ruby/object:Gem::Dependency
104
+ name: multi_json
105
+ requirement: &70124430798740 !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: 1.0.3
111
+ type: :runtime
112
+ prerelease: false
113
+ version_requirements: *70124430798740
114
+ - !ruby/object:Gem::Dependency
115
+ name: oauth
116
+ requirement: &70124430798100 !ruby/object:Gem::Requirement
117
+ none: false
118
+ requirements:
119
+ - - ~>
120
+ - !ruby/object:Gem::Version
121
+ version: 0.4.5
122
+ type: :runtime
123
+ prerelease: false
124
+ version_requirements: *70124430798100
102
125
  description: Ruby wrapper for the LinkedIn API
103
- email:
126
+ email:
104
127
  - wynn.netherland@gmail.com
105
128
  - josh.kalderimis@gmail.com
106
129
  executables: []
107
-
108
130
  extensions: []
109
-
110
- extra_rdoc_files:
111
- - README.markdown
112
- - LICENSE
113
- files:
131
+ extra_rdoc_files: []
132
+ files:
114
133
  - .autotest
115
134
  - .document
135
+ - .gemtest
116
136
  - .gitignore
137
+ - .rspec
138
+ - .travis.yml
117
139
  - Gemfile
118
140
  - LICENSE
119
141
  - README.markdown
120
142
  - Rakefile
121
- - VERSION
122
143
  - changelog.markdown
123
144
  - examples/authenticate.rb
124
145
  - examples/network.rb
125
146
  - examples/profile.rb
126
147
  - examples/status.rb
127
- - lib/linked_in/api_standard_profile_request.rb
128
- - lib/linked_in/authorization_helpers.rb
129
- - lib/linked_in/base.rb
130
- - lib/linked_in/birthdate.rb
148
+ - lib/linked_in/api/query_methods.rb
149
+ - lib/linked_in/api/update_methods.rb
131
150
  - lib/linked_in/client.rb
132
- - lib/linked_in/company.rb
133
- - lib/linked_in/connections.rb
134
- - lib/linked_in/country.rb
135
- - lib/linked_in/current_share.rb
136
- - lib/linked_in/education.rb
137
- - lib/linked_in/error.rb
138
- - lib/linked_in/group.rb
139
- - lib/linked_in/languages.rb
140
- - lib/linked_in/likes.rb
141
- - lib/linked_in/location.rb
142
- - lib/linked_in/message.rb
143
- - lib/linked_in/network.rb
144
- - lib/linked_in/patents.rb
145
- - lib/linked_in/people.rb
146
- - lib/linked_in/person.rb
147
- - lib/linked_in/phone_number.rb
148
- - lib/linked_in/position.rb
149
- - lib/linked_in/profile.rb
150
- - lib/linked_in/publications.rb
151
- - lib/linked_in/recipient.rb
152
- - lib/linked_in/recipients.rb
153
- - lib/linked_in/recommendations.rb
151
+ - lib/linked_in/errors.rb
152
+ - lib/linked_in/helpers/authorization.rb
153
+ - lib/linked_in/helpers/request.rb
154
+ - lib/linked_in/mash.rb
154
155
  - lib/linked_in/request_helpers.rb
155
- - lib/linked_in/short_profile.rb
156
- - lib/linked_in/skill.rb
157
- - lib/linked_in/to_xml_helpers.rb
158
- - lib/linked_in/update.rb
159
- - lib/linked_in/url_resource.rb
156
+ - lib/linked_in/search.rb
157
+ - lib/linked_in/version.rb
160
158
  - lib/linkedin.rb
161
159
  - linkedin.gemspec
162
160
  - spec/cases/client_spec.rb
163
161
  - spec/cases/linkedin_spec.rb
162
+ - spec/cases/mash_spec.rb
164
163
  - spec/cases/oauth_spec.rb
165
- - spec/fixtures/blank.xml
166
- - spec/fixtures/connections.xml
167
- - spec/fixtures/error.xml
168
- - spec/fixtures/likes.xml
169
- - spec/fixtures/mailbox_items.xml
170
- - spec/fixtures/network_status_with_group.xml
171
- - spec/fixtures/network_statuses.xml
172
- - spec/fixtures/picture_updates.xml
173
- - spec/fixtures/profile.xml
174
- - spec/fixtures/profile_full.xml
175
- - spec/fixtures/profile_with_positions.xml
176
- - spec/fixtures/search.xml
177
- - spec/fixtures/shares.xml
178
- - spec/fixtures/status.xml
179
- - spec/spec_helper.rb
180
- has_rdoc: true
164
+ - spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml
165
+ - spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml
166
+ - spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml
167
+ - spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml
168
+ - spec/helper.rb
181
169
  homepage: http://github.com/pengwynn/linkedin
182
170
  licenses: []
183
-
184
171
  post_install_message:
185
- rdoc_options:
186
- - --charset=UTF-8
187
- require_paths:
172
+ rdoc_options: []
173
+ require_paths:
188
174
  - lib
189
- required_ruby_version: !ruby/object:Gem::Requirement
175
+ required_ruby_version: !ruby/object:Gem::Requirement
190
176
  none: false
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- hash: 3
195
- segments:
196
- - 0
197
- version: "0"
198
- required_rubygems_version: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ! '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ required_rubygems_version: !ruby/object:Gem::Requirement
199
182
  none: false
200
- requirements:
201
- - - ">="
202
- - !ruby/object:Gem::Version
203
- hash: 3
204
- segments:
205
- - 0
206
- version: "0"
183
+ requirements:
184
+ - - ! '>='
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
207
187
  requirements: []
208
-
209
188
  rubyforge_project:
210
- rubygems_version: 1.5.0
189
+ rubygems_version: 1.8.5
211
190
  signing_key:
212
191
  specification_version: 3
213
192
  summary: Ruby wrapper for the LinkedIn API
214
- test_files:
193
+ test_files:
215
194
  - spec/cases/client_spec.rb
216
195
  - spec/cases/linkedin_spec.rb
196
+ - spec/cases/mash_spec.rb
217
197
  - spec/cases/oauth_spec.rb
218
- - spec/fixtures/blank.xml
219
- - spec/fixtures/connections.xml
220
- - spec/fixtures/error.xml
221
- - spec/fixtures/likes.xml
222
- - spec/fixtures/mailbox_items.xml
223
- - spec/fixtures/network_status_with_group.xml
224
- - spec/fixtures/network_statuses.xml
225
- - spec/fixtures/picture_updates.xml
226
- - spec/fixtures/profile.xml
227
- - spec/fixtures/profile_full.xml
228
- - spec/fixtures/profile_with_positions.xml
229
- - spec/fixtures/search.xml
230
- - spec/fixtures/shares.xml
231
- - spec/fixtures/status.xml
232
- - spec/spec_helper.rb
198
+ - spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml
199
+ - spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml
200
+ - spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml
201
+ - spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml
202
+ - spec/helper.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.1
@@ -1,17 +0,0 @@
1
- module LinkedIn
2
- class ApiStandardProfileRequest < LinkedIn::Base
3
-
4
- def url
5
- @doc.xpath("//api-standard-profile-request/url").text
6
- end
7
-
8
- # returning a hash should be ok, but suggestions are welcome
9
- def headers
10
- hash = {}
11
- hash[:name] = @doc.xpath("//api-standard-profile-request/headers/http-header/name").text
12
- hash[:value] = @doc.xpath("//api-standard-profile-request/headers/http-header/value").text
13
- hash
14
- end
15
-
16
- end
17
- end