xing_api_client 0.0.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.
- data/.gitignore +5 -0
- data/.rspec +2 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +76 -0
- data/Guardfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +239 -0
- data/Rakefile +1 -0
- data/config.yml.sample +7 -0
- data/lib/xing_api_client/call/base.rb +23 -0
- data/lib/xing_api_client/call/registry.rb +22 -0
- data/lib/xing_api_client/call/users_bookmarks_call.rb +36 -0
- data/lib/xing_api_client/call/users_call.rb +11 -0
- data/lib/xing_api_client/call/users_contact_requests_call.rb +41 -0
- data/lib/xing_api_client/call/users_contacts_call.rb +25 -0
- data/lib/xing_api_client/call/users_contacts_shared_call.rb +24 -0
- data/lib/xing_api_client/call/users_contacts_tags_call.rb +14 -0
- data/lib/xing_api_client/call/users_find_by_emails_call.rb +21 -0
- data/lib/xing_api_client/call/users_me_id_card_call.rb +9 -0
- data/lib/xing_api_client/call/users_network_paths_call.rb +18 -0
- data/lib/xing_api_client/call/users_profile_message_call.rb +22 -0
- data/lib/xing_api_client/call.rb +12 -0
- data/lib/xing_api_client/config.rb +38 -0
- data/lib/xing_api_client/object/address.rb +8 -0
- data/lib/xing_api_client/object/base.rb +23 -0
- data/lib/xing_api_client/object/company.rb +15 -0
- data/lib/xing_api_client/object/school.rb +15 -0
- data/lib/xing_api_client/object/user.rb +29 -0
- data/lib/xing_api_client/object/year_month.rb +28 -0
- data/lib/xing_api_client/object.rb +11 -0
- data/lib/xing_api_client/request/error.rb +23 -0
- data/lib/xing_api_client/request.rb +85 -0
- data/lib/xing_api_client/version.rb +3 -0
- data/lib/xing_api_client.rb +54 -0
- data/spec/spec_helper.rb +107 -0
- data/spec/xing_api_client/call/users_bookmarks_call_spec.rb +103 -0
- data/spec/xing_api_client/call/users_call_spec.rb +41 -0
- data/spec/xing_api_client/call/users_contact_requests_call_spec.rb +130 -0
- data/spec/xing_api_client/call/users_contacts_call_spec.rb +45 -0
- data/spec/xing_api_client/call/users_contacts_shared_call_spec.rb +45 -0
- data/spec/xing_api_client/call/users_contacts_tags_call_spec.rb +20 -0
- data/spec/xing_api_client/call/users_find_by_emails_call_spec.rb +37 -0
- data/spec/xing_api_client/call/users_me_id_card_call_spec.rb +19 -0
- data/spec/xing_api_client/call/users_network_paths_call_spec.rb +37 -0
- data/spec/xing_api_client/call/users_profile_message_call_spec.rb +63 -0
- data/spec/xing_api_client/config_spec.rb +67 -0
- data/spec/xing_api_client/object/user_spec.rb +37 -0
- data/spec/xing_api_client/object/year_month_spec.rb +70 -0
- data/spec/xing_api_client/request/error_spec.rb +15 -0
- data/spec/xing_api_client/request_spec.rb +70 -0
- data/spec/xing_api_client_spec.rb +51 -0
- data/xing_api_client.gemspec +26 -0
- metadata +227 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe XingApiClient do
|
4
|
+
subject { XingApiClient }
|
5
|
+
let(:instance){ subject.new('access_token_ABC123', 'secret_DEF456') }
|
6
|
+
|
7
|
+
describe '.request_params' do
|
8
|
+
let(:token) { double('request_token', authorize_url: 'www.url.sample') }
|
9
|
+
before { subject.stub_chain(:consumer, :get_request_token).and_return(token) }
|
10
|
+
|
11
|
+
it 'returns a hash with a request token and a auth url' do
|
12
|
+
subject.request_params.should == { request_token: token, auth_url: 'www.url.sample'}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '.authorize' do
|
17
|
+
let(:request_token) { double('request_token') }
|
18
|
+
let(:pin) { '1234' }
|
19
|
+
let(:access_token) { double('access_token', token: 'access_token_ABC123', secret: 'secret_DEF456' ) }
|
20
|
+
|
21
|
+
before do
|
22
|
+
request_token.should_receive(:get_access_token).with(oauth_verifier: pin).and_return(access_token)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'returns a hash with a access token and a secret' do
|
26
|
+
subject.authorize(request_token, pin).should == { access_token: 'access_token_ABC123', secret: 'secret_DEF456'}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '.consumer' do
|
31
|
+
it 'returns a OAuth::Consumer instance' do
|
32
|
+
subject.send(:consumer).should be_kind_of(OAuth::Consumer)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '.new' do
|
37
|
+
it 'sets the intsance variable access_token to the first argument when it gets initialized' do
|
38
|
+
instance.instance_variable_get('@access_token').should == 'access_token_ABC123'
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'sets the intsance variable secret to the second argument when it gets initialized' do
|
42
|
+
instance.instance_variable_get('@secret').should == 'secret_DEF456'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '#consumer_token' do
|
47
|
+
it 'returns a OAuth::ConsumerToken instance' do
|
48
|
+
instance.send(:consumer_token).should be_kind_of(OAuth::ConsumerToken)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require File.expand_path('../lib/xing_api_client/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = "xing_api_client"
|
6
|
+
spec.version = XingApiClient::VERSION
|
7
|
+
spec.authors = ["Martin Brendel"]
|
8
|
+
spec.email = ["ependichter@gmail.com"]
|
9
|
+
spec.description = %q{Wrapper for the XING API}
|
10
|
+
spec.summary = %q{An easy way to access the XING API}
|
11
|
+
spec.homepage = ""
|
12
|
+
spec.license = "MIT"
|
13
|
+
|
14
|
+
spec.files = `git ls-files`.split($/)
|
15
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
16
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
|
+
spec.require_paths = ["lib"]
|
18
|
+
|
19
|
+
spec.add_development_dependency "rspec"
|
20
|
+
spec.add_development_dependency "guard-rspec"
|
21
|
+
spec.add_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_dependency "rake"
|
23
|
+
spec.add_dependency "oauth"
|
24
|
+
spec.add_dependency "activesupport"
|
25
|
+
spec.add_dependency "parallel"
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,227 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xing_api_client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Martin Brendel
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-10-26 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: guard-rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: bundler
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.3'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.3'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rake
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: oauth
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: activesupport
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: parallel
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
description: Wrapper for the XING API
|
127
|
+
email:
|
128
|
+
- ependichter@gmail.com
|
129
|
+
executables: []
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- .gitignore
|
134
|
+
- .rspec
|
135
|
+
- Gemfile
|
136
|
+
- Gemfile.lock
|
137
|
+
- Guardfile
|
138
|
+
- LICENSE.txt
|
139
|
+
- README.md
|
140
|
+
- Rakefile
|
141
|
+
- config.yml.sample
|
142
|
+
- lib/xing_api_client.rb
|
143
|
+
- lib/xing_api_client/call.rb
|
144
|
+
- lib/xing_api_client/call/base.rb
|
145
|
+
- lib/xing_api_client/call/registry.rb
|
146
|
+
- lib/xing_api_client/call/users_bookmarks_call.rb
|
147
|
+
- lib/xing_api_client/call/users_call.rb
|
148
|
+
- lib/xing_api_client/call/users_contact_requests_call.rb
|
149
|
+
- lib/xing_api_client/call/users_contacts_call.rb
|
150
|
+
- lib/xing_api_client/call/users_contacts_shared_call.rb
|
151
|
+
- lib/xing_api_client/call/users_contacts_tags_call.rb
|
152
|
+
- lib/xing_api_client/call/users_find_by_emails_call.rb
|
153
|
+
- lib/xing_api_client/call/users_me_id_card_call.rb
|
154
|
+
- lib/xing_api_client/call/users_network_paths_call.rb
|
155
|
+
- lib/xing_api_client/call/users_profile_message_call.rb
|
156
|
+
- lib/xing_api_client/config.rb
|
157
|
+
- lib/xing_api_client/object.rb
|
158
|
+
- lib/xing_api_client/object/address.rb
|
159
|
+
- lib/xing_api_client/object/base.rb
|
160
|
+
- lib/xing_api_client/object/company.rb
|
161
|
+
- lib/xing_api_client/object/school.rb
|
162
|
+
- lib/xing_api_client/object/user.rb
|
163
|
+
- lib/xing_api_client/object/year_month.rb
|
164
|
+
- lib/xing_api_client/request.rb
|
165
|
+
- lib/xing_api_client/request/error.rb
|
166
|
+
- lib/xing_api_client/version.rb
|
167
|
+
- spec/spec_helper.rb
|
168
|
+
- spec/xing_api_client/call/users_bookmarks_call_spec.rb
|
169
|
+
- spec/xing_api_client/call/users_call_spec.rb
|
170
|
+
- spec/xing_api_client/call/users_contact_requests_call_spec.rb
|
171
|
+
- spec/xing_api_client/call/users_contacts_call_spec.rb
|
172
|
+
- spec/xing_api_client/call/users_contacts_shared_call_spec.rb
|
173
|
+
- spec/xing_api_client/call/users_contacts_tags_call_spec.rb
|
174
|
+
- spec/xing_api_client/call/users_find_by_emails_call_spec.rb
|
175
|
+
- spec/xing_api_client/call/users_me_id_card_call_spec.rb
|
176
|
+
- spec/xing_api_client/call/users_network_paths_call_spec.rb
|
177
|
+
- spec/xing_api_client/call/users_profile_message_call_spec.rb
|
178
|
+
- spec/xing_api_client/config_spec.rb
|
179
|
+
- spec/xing_api_client/object/user_spec.rb
|
180
|
+
- spec/xing_api_client/object/year_month_spec.rb
|
181
|
+
- spec/xing_api_client/request/error_spec.rb
|
182
|
+
- spec/xing_api_client/request_spec.rb
|
183
|
+
- spec/xing_api_client_spec.rb
|
184
|
+
- xing_api_client.gemspec
|
185
|
+
homepage: ''
|
186
|
+
licenses:
|
187
|
+
- MIT
|
188
|
+
post_install_message:
|
189
|
+
rdoc_options: []
|
190
|
+
require_paths:
|
191
|
+
- lib
|
192
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
194
|
+
requirements:
|
195
|
+
- - ! '>='
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '0'
|
198
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
199
|
+
none: false
|
200
|
+
requirements:
|
201
|
+
- - ! '>='
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
requirements: []
|
205
|
+
rubyforge_project:
|
206
|
+
rubygems_version: 1.8.23
|
207
|
+
signing_key:
|
208
|
+
specification_version: 3
|
209
|
+
summary: An easy way to access the XING API
|
210
|
+
test_files:
|
211
|
+
- spec/spec_helper.rb
|
212
|
+
- spec/xing_api_client/call/users_bookmarks_call_spec.rb
|
213
|
+
- spec/xing_api_client/call/users_call_spec.rb
|
214
|
+
- spec/xing_api_client/call/users_contact_requests_call_spec.rb
|
215
|
+
- spec/xing_api_client/call/users_contacts_call_spec.rb
|
216
|
+
- spec/xing_api_client/call/users_contacts_shared_call_spec.rb
|
217
|
+
- spec/xing_api_client/call/users_contacts_tags_call_spec.rb
|
218
|
+
- spec/xing_api_client/call/users_find_by_emails_call_spec.rb
|
219
|
+
- spec/xing_api_client/call/users_me_id_card_call_spec.rb
|
220
|
+
- spec/xing_api_client/call/users_network_paths_call_spec.rb
|
221
|
+
- spec/xing_api_client/call/users_profile_message_call_spec.rb
|
222
|
+
- spec/xing_api_client/config_spec.rb
|
223
|
+
- spec/xing_api_client/object/user_spec.rb
|
224
|
+
- spec/xing_api_client/object/year_month_spec.rb
|
225
|
+
- spec/xing_api_client/request/error_spec.rb
|
226
|
+
- spec/xing_api_client/request_spec.rb
|
227
|
+
- spec/xing_api_client_spec.rb
|