syncano 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/syncano/jimson_client.rb +32 -0
- data/lib/syncano/version.rb +1 -1
- metadata +58 -33
- checksums.yaml +0 -7
@@ -2,6 +2,38 @@
|
|
2
2
|
module Jimson
|
3
3
|
# Overwritten helper from Jimson gem
|
4
4
|
class ClientHelper
|
5
|
+
# Overwritten send_single_request method, so it now adds header with the user agent
|
6
|
+
# @return [Array] collection of responses
|
7
|
+
def send_single_request(method, args)
|
8
|
+
post_data = {
|
9
|
+
'jsonrpc' => JSON_RPC_VERSION,
|
10
|
+
'method' => method,
|
11
|
+
'params' => args,
|
12
|
+
'id' => self.class.make_id
|
13
|
+
}.to_json
|
14
|
+
resp = RestClient.post(@url, post_data, :content_type => 'application/json', :user_agent => "syncano-ruby-#{Syncano::VERSION}")
|
15
|
+
if resp.nil? || resp.body.nil? || resp.body.empty?
|
16
|
+
raise Jimson::ClientError::InvalidResponse.new
|
17
|
+
end
|
18
|
+
|
19
|
+
return resp.body
|
20
|
+
|
21
|
+
rescue Exception, StandardError
|
22
|
+
raise Jimson::ClientError::InternalError.new($!)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Overwritten send_batch_request method, so it now adds header with the user agent
|
26
|
+
# @return [Array] collection of responses
|
27
|
+
def send_batch_request(batch)
|
28
|
+
post_data = batch.to_json
|
29
|
+
resp = RestClient.post(@url, post_data, :content_type => 'application/json', :user_agent => "syncano-ruby-#{Syncano::VERSION}")
|
30
|
+
if resp.nil? || resp.body.nil? || resp.body.empty?
|
31
|
+
raise Jimson::ClientError::InvalidResponse.new
|
32
|
+
end
|
33
|
+
|
34
|
+
return resp.body
|
35
|
+
end
|
36
|
+
|
5
37
|
# Overwritten send_batch method, so it now returns collection of responses
|
6
38
|
# @return [Array] collection of responses
|
7
39
|
def send_batch
|
data/lib/syncano/version.rb
CHANGED
metadata
CHANGED
@@ -1,181 +1,206 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syncano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Piotr Zadrożny
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-
|
12
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: jimson-client
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '0'
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0'
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: activesupport
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- -
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '0'
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- -
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '0'
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: activemodel
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- -
|
51
|
+
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0'
|
48
54
|
type: :runtime
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: multi_json
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- -
|
67
|
+
- - ~>
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '1.10'
|
62
70
|
type: :runtime
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- -
|
75
|
+
- - ~>
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '1.10'
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: eventmachine
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
|
-
- -
|
83
|
+
- - ! '>='
|
74
84
|
- !ruby/object:Gem::Version
|
75
85
|
version: '0'
|
76
86
|
type: :runtime
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
|
-
- -
|
91
|
+
- - ! '>='
|
81
92
|
- !ruby/object:Gem::Version
|
82
93
|
version: '0'
|
83
94
|
- !ruby/object:Gem::Dependency
|
84
95
|
name: active_attr
|
85
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
86
98
|
requirements:
|
87
|
-
- -
|
99
|
+
- - ! '>='
|
88
100
|
- !ruby/object:Gem::Version
|
89
101
|
version: '0'
|
90
102
|
type: :runtime
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
93
106
|
requirements:
|
94
|
-
- -
|
107
|
+
- - ! '>='
|
95
108
|
- !ruby/object:Gem::Version
|
96
109
|
version: '0'
|
97
110
|
- !ruby/object:Gem::Dependency
|
98
111
|
name: bundler
|
99
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - ~>
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: '1.6'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
107
122
|
requirements:
|
108
|
-
- -
|
123
|
+
- - ~>
|
109
124
|
- !ruby/object:Gem::Version
|
110
125
|
version: '1.6'
|
111
126
|
- !ruby/object:Gem::Dependency
|
112
127
|
name: rake
|
113
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
114
130
|
requirements:
|
115
|
-
- -
|
131
|
+
- - ! '>='
|
116
132
|
- !ruby/object:Gem::Version
|
117
133
|
version: '0'
|
118
134
|
type: :development
|
119
135
|
prerelease: false
|
120
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
121
138
|
requirements:
|
122
|
-
- -
|
139
|
+
- - ! '>='
|
123
140
|
- !ruby/object:Gem::Version
|
124
141
|
version: '0'
|
125
142
|
- !ruby/object:Gem::Dependency
|
126
143
|
name: yard
|
127
144
|
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
128
146
|
requirements:
|
129
|
-
- -
|
147
|
+
- - ! '>='
|
130
148
|
- !ruby/object:Gem::Version
|
131
149
|
version: '0'
|
132
150
|
type: :development
|
133
151
|
prerelease: false
|
134
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
135
154
|
requirements:
|
136
|
-
- -
|
155
|
+
- - ! '>='
|
137
156
|
- !ruby/object:Gem::Version
|
138
157
|
version: '0'
|
139
158
|
- !ruby/object:Gem::Dependency
|
140
159
|
name: rspec
|
141
160
|
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
142
162
|
requirements:
|
143
|
-
- -
|
163
|
+
- - ! '>='
|
144
164
|
- !ruby/object:Gem::Version
|
145
165
|
version: '0'
|
146
166
|
type: :development
|
147
167
|
prerelease: false
|
148
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
149
170
|
requirements:
|
150
|
-
- -
|
171
|
+
- - ! '>='
|
151
172
|
- !ruby/object:Gem::Version
|
152
173
|
version: '0'
|
153
174
|
- !ruby/object:Gem::Dependency
|
154
175
|
name: mocha
|
155
176
|
requirement: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
156
178
|
requirements:
|
157
|
-
- -
|
179
|
+
- - ! '>='
|
158
180
|
- !ruby/object:Gem::Version
|
159
181
|
version: '0'
|
160
182
|
type: :development
|
161
183
|
prerelease: false
|
162
184
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
163
186
|
requirements:
|
164
|
-
- -
|
187
|
+
- - ! '>='
|
165
188
|
- !ruby/object:Gem::Version
|
166
189
|
version: '0'
|
167
190
|
- !ruby/object:Gem::Dependency
|
168
191
|
name: guard-rspec
|
169
192
|
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
170
194
|
requirements:
|
171
|
-
- -
|
195
|
+
- - ! '>='
|
172
196
|
- !ruby/object:Gem::Version
|
173
197
|
version: '0'
|
174
198
|
type: :development
|
175
199
|
prerelease: false
|
176
200
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
177
202
|
requirements:
|
178
|
-
- -
|
203
|
+
- - ! '>='
|
179
204
|
- !ruby/object:Gem::Version
|
180
205
|
version: '0'
|
181
206
|
description: A Ruby client that provides convenient interface for the Syncano api.
|
@@ -185,7 +210,7 @@ executables: []
|
|
185
210
|
extensions: []
|
186
211
|
extra_rdoc_files: []
|
187
212
|
files:
|
188
|
-
-
|
213
|
+
- .gitignore
|
189
214
|
- Gemfile
|
190
215
|
- Guardfile
|
191
216
|
- LICENSE.txt
|
@@ -252,26 +277,27 @@ files:
|
|
252
277
|
homepage: https://github.com/Syncano/syncano-ruby
|
253
278
|
licenses:
|
254
279
|
- MIT
|
255
|
-
metadata: {}
|
256
280
|
post_install_message:
|
257
281
|
rdoc_options: []
|
258
282
|
require_paths:
|
259
283
|
- lib
|
260
284
|
required_ruby_version: !ruby/object:Gem::Requirement
|
285
|
+
none: false
|
261
286
|
requirements:
|
262
|
-
- -
|
287
|
+
- - ! '>='
|
263
288
|
- !ruby/object:Gem::Version
|
264
289
|
version: '0'
|
265
290
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
291
|
+
none: false
|
266
292
|
requirements:
|
267
|
-
- -
|
293
|
+
- - ! '>='
|
268
294
|
- !ruby/object:Gem::Version
|
269
295
|
version: '0'
|
270
296
|
requirements: []
|
271
297
|
rubyforge_project:
|
272
|
-
rubygems_version:
|
298
|
+
rubygems_version: 1.8.24
|
273
299
|
signing_key:
|
274
|
-
specification_version:
|
300
|
+
specification_version: 3
|
275
301
|
summary: A Ruby client library for Syncano
|
276
302
|
test_files:
|
277
303
|
- spec/admins_spec.rb
|
@@ -285,4 +311,3 @@ test_files:
|
|
285
311
|
- spec/spec_helper.rb
|
286
312
|
- spec/sync_resources_spec.rb
|
287
313
|
- spec/syncano_spec.rb
|
288
|
-
has_rdoc:
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 9c3a289c247f6654d64d2a9510acb205bce778a1
|
4
|
-
data.tar.gz: 23f7bc994f710dd3b4e25be3d2847358506b173d
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: ffc0eea9c73a2d85d04999f7d2cb7cd3cb3bd199655fa929b8360abbf76f587bacb66983f69ca8986d0879d236f417470a714fa7e00091c4861af8a55a66404f
|
7
|
-
data.tar.gz: 51d2312ec5ba3115266634e9e17742b6501c05232fa4cef96edb292ba95728ceb128f576502bdd1d80ab2e0f20536bf7e7a12f3ed69ba2a97a125793473c3663
|