linkedin-bdigital 0.2.2

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 (69) hide show
  1. data/.autotest +14 -0
  2. data/.document +5 -0
  3. data/.gitignore +25 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE +20 -0
  6. data/README.markdown +78 -0
  7. data/Rakefile +41 -0
  8. data/VERSION +1 -0
  9. data/changelog.markdown +71 -0
  10. data/examples/authenticate.rb +21 -0
  11. data/examples/network.rb +12 -0
  12. data/examples/profile.rb +14 -0
  13. data/examples/status.rb +9 -0
  14. data/lib/linked_in/api_standard_profile_request.rb +17 -0
  15. data/lib/linked_in/authorization_helpers.rb +48 -0
  16. data/lib/linked_in/base.rb +13 -0
  17. data/lib/linked_in/birthdate.rb +21 -0
  18. data/lib/linked_in/client.rb +155 -0
  19. data/lib/linked_in/company.rb +11 -0
  20. data/lib/linked_in/connections.rb +16 -0
  21. data/lib/linked_in/country.rb +9 -0
  22. data/lib/linked_in/current_share.rb +56 -0
  23. data/lib/linked_in/education.rb +41 -0
  24. data/lib/linked_in/error.rb +21 -0
  25. data/lib/linked_in/group.rb +32 -0
  26. data/lib/linked_in/languages.rb +28 -0
  27. data/lib/linked_in/likes.rb +23 -0
  28. data/lib/linked_in/location.rb +13 -0
  29. data/lib/linked_in/message.rb +20 -0
  30. data/lib/linked_in/network.rb +12 -0
  31. data/lib/linked_in/patents.rb +42 -0
  32. data/lib/linked_in/people.rb +18 -0
  33. data/lib/linked_in/person.rb +7 -0
  34. data/lib/linked_in/phone_number.rb +29 -0
  35. data/lib/linked_in/position.rb +46 -0
  36. data/lib/linked_in/profile.rb +85 -0
  37. data/lib/linked_in/publications.rb +40 -0
  38. data/lib/linked_in/recipient.rb +7 -0
  39. data/lib/linked_in/recipients.rb +18 -0
  40. data/lib/linked_in/recommendations.rb +30 -0
  41. data/lib/linked_in/request_helpers.rb +78 -0
  42. data/lib/linked_in/short_profile.rb +13 -0
  43. data/lib/linked_in/skill.rb +33 -0
  44. data/lib/linked_in/to_xml_helpers.rb +53 -0
  45. data/lib/linked_in/update.rb +23 -0
  46. data/lib/linked_in/url_resource.rb +26 -0
  47. data/lib/linkedin.rb +81 -0
  48. data/linkedin.gemspec +49 -0
  49. data/spec/cases/client_spec.rb +230 -0
  50. data/spec/cases/linkedin_spec.rb +37 -0
  51. data/spec/cases/oauth_spec.rb +109 -0
  52. data/spec/client_shared_examples.rb +91 -0
  53. data/spec/fixtures/403.xml +7 -0
  54. data/spec/fixtures/404.xml +7 -0
  55. data/spec/fixtures/blank.xml +0 -0
  56. data/spec/fixtures/connections.xml +3733 -0
  57. data/spec/fixtures/likes.xml +18 -0
  58. data/spec/fixtures/mailbox_items.xml +16 -0
  59. data/spec/fixtures/network_status_with_group.xml +44 -0
  60. data/spec/fixtures/network_statuses.xml +317 -0
  61. data/spec/fixtures/picture_updates.xml +117 -0
  62. data/spec/fixtures/profile.xml +9 -0
  63. data/spec/fixtures/profile_full.xml +3909 -0
  64. data/spec/fixtures/profile_with_positions.xml +79 -0
  65. data/spec/fixtures/search.xml +538 -0
  66. data/spec/fixtures/shares.xml +12 -0
  67. data/spec/fixtures/status.xml +2 -0
  68. data/spec/spec_helper.rb +58 -0
  69. metadata +179 -0
@@ -0,0 +1,12 @@
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>
@@ -0,0 +1,2 @@
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>
@@ -0,0 +1,58 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'although not required, bundler is recommened for running the tests'
5
+ end
6
+
7
+ require 'webmock/rspec'
8
+
9
+ require 'client_shared_examples'
10
+
11
+ require 'linkedin'
12
+
13
+
14
+
15
+ def fixture_path
16
+ File.expand_path("../fixtures", __FILE__)
17
+ end
18
+
19
+ def fixture(file)
20
+ File.new(fixture_path + '/' + file)
21
+ end
22
+
23
+
24
+ def linkedin_url(url)
25
+ url =~ /^http/ ? url : "https://api.linkedin.com#{url}"
26
+ end
27
+
28
+
29
+ def stub_get(url, filename, status=nil)
30
+ options = { :body => fixture(filename) }
31
+ options.merge!({ :status => status }) if status
32
+
33
+ stub_request(:get, linkedin_url(url)).to_return(options)
34
+ end
35
+
36
+ def stub_post(url, result)
37
+ result_hash = { :status => 201 }
38
+ result_hash[:body] = fixture(result) if result
39
+
40
+ stub_request(:post, linkedin_url(url)).to_return(result_hash)
41
+ end
42
+
43
+ def expect_post(url, body, result = nil)
44
+ a_request(:post, linkedin_url(url)).with({
45
+ :body => fixture(body).read,
46
+ :headers => { :content_type => 'application/xml' }
47
+ }).should have_been_made.once
48
+ end
49
+
50
+ def stub_put(url, returns_xml, status=nil)
51
+ options = { :body => fixture(returns_xml) }
52
+ options.merge!({ :status => status }) if status
53
+ stub_request(:put, linkedin_url(url)).to_return(options)
54
+ end
55
+
56
+ def stub_delete(url, returns_xml)
57
+ stub_request(:delete, linkedin_url(url)).to_return(:body => fixture(returns_xml))
58
+ end
metadata ADDED
@@ -0,0 +1,179 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: linkedin-bdigital
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.2.2
6
+ platform: ruby
7
+ authors:
8
+ - Wynn Netherland
9
+ - Josh Kalderimis
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+
14
+ date: 2010-03-01 00:00:00 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: oauth
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: 0.4.0
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: nokogiri
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
35
+ version: 1.4.4
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: rspec
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 2.4.0
47
+ type: :development
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: rake
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ version: 0.8.7
58
+ type: :development
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: webmock
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.6.0
69
+ type: :development
70
+ version_requirements: *id005
71
+ description: Ruby wrapper for the LinkedIn API
72
+ email:
73
+ - wynn.netherland@gmail.com
74
+ - josh.kalderimis@gmail.com
75
+ executables: []
76
+
77
+ extensions: []
78
+
79
+ extra_rdoc_files:
80
+ - README.markdown
81
+ - LICENSE
82
+ files:
83
+ - .autotest
84
+ - .document
85
+ - .gitignore
86
+ - Gemfile
87
+ - LICENSE
88
+ - README.markdown
89
+ - Rakefile
90
+ - VERSION
91
+ - changelog.markdown
92
+ - examples/authenticate.rb
93
+ - examples/network.rb
94
+ - examples/profile.rb
95
+ - examples/status.rb
96
+ - lib/linked_in/api_standard_profile_request.rb
97
+ - lib/linked_in/authorization_helpers.rb
98
+ - lib/linked_in/base.rb
99
+ - lib/linked_in/birthdate.rb
100
+ - lib/linked_in/client.rb
101
+ - lib/linked_in/company.rb
102
+ - lib/linked_in/connections.rb
103
+ - lib/linked_in/country.rb
104
+ - lib/linked_in/current_share.rb
105
+ - lib/linked_in/education.rb
106
+ - lib/linked_in/error.rb
107
+ - lib/linked_in/group.rb
108
+ - lib/linked_in/languages.rb
109
+ - lib/linked_in/likes.rb
110
+ - lib/linked_in/location.rb
111
+ - lib/linked_in/message.rb
112
+ - lib/linked_in/network.rb
113
+ - lib/linked_in/patents.rb
114
+ - lib/linked_in/people.rb
115
+ - lib/linked_in/person.rb
116
+ - lib/linked_in/phone_number.rb
117
+ - lib/linked_in/position.rb
118
+ - lib/linked_in/profile.rb
119
+ - lib/linked_in/publications.rb
120
+ - lib/linked_in/recipient.rb
121
+ - lib/linked_in/recipients.rb
122
+ - lib/linked_in/recommendations.rb
123
+ - lib/linked_in/request_helpers.rb
124
+ - lib/linked_in/short_profile.rb
125
+ - lib/linked_in/skill.rb
126
+ - lib/linked_in/to_xml_helpers.rb
127
+ - lib/linked_in/update.rb
128
+ - lib/linked_in/url_resource.rb
129
+ - lib/linkedin.rb
130
+ - linkedin.gemspec
131
+ - spec/cases/client_spec.rb
132
+ - spec/cases/linkedin_spec.rb
133
+ - spec/cases/oauth_spec.rb
134
+ - spec/client_shared_examples.rb
135
+ - spec/fixtures/403.xml
136
+ - spec/fixtures/404.xml
137
+ - spec/fixtures/blank.xml
138
+ - spec/fixtures/connections.xml
139
+ - spec/fixtures/likes.xml
140
+ - spec/fixtures/mailbox_items.xml
141
+ - spec/fixtures/network_status_with_group.xml
142
+ - spec/fixtures/network_statuses.xml
143
+ - spec/fixtures/picture_updates.xml
144
+ - spec/fixtures/profile.xml
145
+ - spec/fixtures/profile_full.xml
146
+ - spec/fixtures/profile_with_positions.xml
147
+ - spec/fixtures/search.xml
148
+ - spec/fixtures/shares.xml
149
+ - spec/fixtures/status.xml
150
+ - spec/spec_helper.rb
151
+ homepage: http://github.com/pengwynn/linkedin
152
+ licenses: []
153
+
154
+ post_install_message:
155
+ rdoc_options:
156
+ - --charset=UTF-8
157
+ require_paths:
158
+ - lib
159
+ required_ruby_version: !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: "0"
165
+ required_rubygems_version: !ruby/object:Gem::Requirement
166
+ none: false
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: "0"
171
+ requirements: []
172
+
173
+ rubyforge_project:
174
+ rubygems_version: 1.7.2
175
+ signing_key:
176
+ specification_version: 3
177
+ summary: Ruby wrapper for the LinkedIn API
178
+ test_files: []
179
+