zero_push 0.0.1 → 0.0.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.
- data/.gitignore +2 -0
- data/.travis.yml +9 -0
- data/.yardoc/checksums +2 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile.lock +7 -3
- data/README.md +2 -0
- data/doc/ZeroPush.html +472 -0
- data/doc/_index.html +110 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +111 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +111 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +84 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/zero_push.rb +15 -1
- data/lib/zero_push/version.rb +1 -1
- data/spec/fixtures/verify_credentials.yml +75 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/zero_push_spec.rb +20 -2
- data/zero_push.gemspec +6 -4
- metadata +64 -8
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/.yardoc/checksums
ADDED
|
Binary file
|
|
Binary file
|
data/.yardoc/proxy_types
ADDED
|
Binary file
|
data/Gemfile.lock
CHANGED
|
@@ -2,7 +2,7 @@ PATH
|
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
4
|
zero_push (0.0.1)
|
|
5
|
-
faraday (
|
|
5
|
+
faraday (~> 0.8.5)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
@@ -11,12 +11,16 @@ GEM
|
|
|
11
11
|
multipart-post (~> 1.1)
|
|
12
12
|
minitest (4.6.1)
|
|
13
13
|
multipart-post (1.1.5)
|
|
14
|
+
rake (10.0.3)
|
|
14
15
|
vcr (2.4.0)
|
|
16
|
+
yard (0.8.4.1)
|
|
15
17
|
|
|
16
18
|
PLATFORMS
|
|
17
19
|
ruby
|
|
18
20
|
|
|
19
21
|
DEPENDENCIES
|
|
20
|
-
minitest (
|
|
21
|
-
|
|
22
|
+
minitest (~> 4.6.1)
|
|
23
|
+
rake (~> 10.0.3)
|
|
24
|
+
vcr (~> 2.4.0)
|
|
25
|
+
yard (~> 0.8.4)
|
|
22
26
|
zero_push!
|
data/README.md
CHANGED
data/doc/ZeroPush.html
ADDED
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<title>
|
|
7
|
+
Module: ZeroPush
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.8.4.1
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
|
19
|
+
relpath = '';
|
|
20
|
+
framesUrl = "frames.html#!" + escape(window.location.href);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
|
25
|
+
|
|
26
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<div id="header">
|
|
32
|
+
<div id="menu">
|
|
33
|
+
|
|
34
|
+
<a href="_index.html">Index (Z)</a> »
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
<span class="title">ZeroPush</span>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div id="search">
|
|
44
|
+
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
54
|
+
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<iframe id="search_frame"></iframe>
|
|
65
|
+
|
|
66
|
+
<div id="content"><h1>Module: ZeroPush
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</h1>
|
|
71
|
+
|
|
72
|
+
<dl class="box">
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
|
82
|
+
<dd class="r1 last">lib/zero_push.rb<span class="defines">,<br />
|
|
83
|
+
lib/zero_push/version.rb</span>
|
|
84
|
+
</dd>
|
|
85
|
+
|
|
86
|
+
</dl>
|
|
87
|
+
<div class="clear"></div>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<h2>Constant Summary</h2>
|
|
91
|
+
|
|
92
|
+
<dl class="constants">
|
|
93
|
+
|
|
94
|
+
<dt id="URL-constant" class="">URL =
|
|
95
|
+
|
|
96
|
+
</dt>
|
|
97
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>http://www.zeropush.com</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
98
|
+
|
|
99
|
+
<dt id="VERSION-constant" class="">VERSION =
|
|
100
|
+
|
|
101
|
+
</dt>
|
|
102
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.0.1</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
103
|
+
|
|
104
|
+
</dl>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<h2>Class Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
|
111
|
+
<ul class="summary">
|
|
112
|
+
|
|
113
|
+
<li class="public ">
|
|
114
|
+
<span class="summary_signature">
|
|
115
|
+
|
|
116
|
+
<a href="#auth_token-class_method" title="auth_token (class method)">+ (Object) <strong>auth_token</strong> </a>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
</span>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
<span class="summary_desc"><div class='inline'>
|
|
134
|
+
<p>Returns the value of attribute auth_token.</p>
|
|
135
|
+
</div></span>
|
|
136
|
+
|
|
137
|
+
</li>
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
</ul>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
<h2>
|
|
147
|
+
Class Method Summary
|
|
148
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
149
|
+
</h2>
|
|
150
|
+
|
|
151
|
+
<ul class="summary">
|
|
152
|
+
|
|
153
|
+
<li class="public ">
|
|
154
|
+
<span class="summary_signature">
|
|
155
|
+
|
|
156
|
+
<a href="#client-class_method" title="client (class method)">+ (Object) <strong>client</strong> </a>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
</span>
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
<span class="summary_desc"><div class='inline'>
|
|
171
|
+
<p>the HTTP client configured for API requests.</p>
|
|
172
|
+
</div></span>
|
|
173
|
+
|
|
174
|
+
</li>
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
<li class="public ">
|
|
178
|
+
<span class="summary_signature">
|
|
179
|
+
|
|
180
|
+
<a href="#notify-class_method" title="notify (class method)">+ (Object) <strong>notify</strong>(params) </a>
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
</span>
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
<span class="summary_desc"><div class='inline'>
|
|
195
|
+
<p>Sends a notification to the list of devices.</p>
|
|
196
|
+
</div></span>
|
|
197
|
+
|
|
198
|
+
</li>
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
<li class="public ">
|
|
202
|
+
<span class="summary_signature">
|
|
203
|
+
|
|
204
|
+
<a href="#verify_credentials-class_method" title="verify_credentials (class method)">+ (Boolean) <strong>verify_credentials</strong> </a>
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
</span>
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
<span class="summary_desc"><div class='inline'>
|
|
219
|
+
<p>verifies credentials.</p>
|
|
220
|
+
</div></span>
|
|
221
|
+
|
|
222
|
+
</li>
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
</ul>
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
<div id="class_attr_details" class="attr_details">
|
|
230
|
+
<h2>Class Attribute Details</h2>
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
<span id="auth_token=-class_method"></span>
|
|
234
|
+
<div class="method_details first">
|
|
235
|
+
<h3 class="signature first" id="auth_token-class_method">
|
|
236
|
+
|
|
237
|
+
+ (<tt>Object</tt>) <strong>auth_token</strong>
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
</h3><div class="docstring">
|
|
244
|
+
<div class="discussion">
|
|
245
|
+
|
|
246
|
+
<p>Returns the value of attribute auth_token</p>
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
<div class="tags">
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
</div><table class="source_code">
|
|
255
|
+
<tr>
|
|
256
|
+
<td>
|
|
257
|
+
<pre class="lines">
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
8
|
|
261
|
+
9
|
|
262
|
+
10</pre>
|
|
263
|
+
</td>
|
|
264
|
+
<td>
|
|
265
|
+
<pre class="code"><span class="info file"># File 'lib/zero_push.rb', line 8</span>
|
|
266
|
+
|
|
267
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_auth_token'>auth_token</span>
|
|
268
|
+
<span class='ivar'>@auth_token</span>
|
|
269
|
+
<span class='kw'>end</span></pre>
|
|
270
|
+
</td>
|
|
271
|
+
</tr>
|
|
272
|
+
</table>
|
|
273
|
+
</div>
|
|
274
|
+
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
<div id="class_method_details" class="method_details_list">
|
|
279
|
+
<h2>Class Method Details</h2>
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
<div class="method_details first">
|
|
283
|
+
<h3 class="signature first" id="client-class_method">
|
|
284
|
+
|
|
285
|
+
+ (<tt>Object</tt>) <strong>client</strong>
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
</h3><div class="docstring">
|
|
292
|
+
<div class="discussion">
|
|
293
|
+
|
|
294
|
+
<p>the HTTP client configured for API requests</p>
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
<div class="tags">
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
</div><table class="source_code">
|
|
303
|
+
<tr>
|
|
304
|
+
<td>
|
|
305
|
+
<pre class="lines">
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
28
|
|
309
|
+
29
|
|
310
|
+
30
|
|
311
|
+
31
|
|
312
|
+
32
|
|
313
|
+
33
|
|
314
|
+
34</pre>
|
|
315
|
+
</td>
|
|
316
|
+
<td>
|
|
317
|
+
<pre class="code"><span class="info file"># File 'lib/zero_push.rb', line 28</span>
|
|
318
|
+
|
|
319
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_client'>client</span>
|
|
320
|
+
<span class='const'>Faraday</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>url:</span> <span class='const'>URL</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
|
|
321
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_token_auth'>token_auth</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_auth_token'>auth_token</span>
|
|
322
|
+
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_request'>request</span> <span class='symbol'>:url_encoded</span> <span class='comment'># form-encode POST params
|
|
323
|
+
</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_adapter'>adapter</span> <span class='const'>Faraday</span><span class='period'>.</span><span class='id identifier rubyid_default_adapter'>default_adapter</span> <span class='comment'># Net::HTTP
|
|
324
|
+
</span> <span class='kw'>end</span>
|
|
325
|
+
<span class='kw'>end</span></pre>
|
|
326
|
+
</td>
|
|
327
|
+
</tr>
|
|
328
|
+
</table>
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
<div class="method_details ">
|
|
332
|
+
<h3 class="signature " id="notify-class_method">
|
|
333
|
+
|
|
334
|
+
+ (<tt>Object</tt>) <strong>notify</strong>(params)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
</h3><div class="docstring">
|
|
341
|
+
<div class="discussion">
|
|
342
|
+
|
|
343
|
+
<p>Sends a notification to the list of devices</p>
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
</div>
|
|
347
|
+
</div>
|
|
348
|
+
<div class="tags">
|
|
349
|
+
<p class="tag_title">Parameters:</p>
|
|
350
|
+
<ul class="param">
|
|
351
|
+
|
|
352
|
+
<li>
|
|
353
|
+
|
|
354
|
+
<span class='name'>params</span>
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
</li>
|
|
362
|
+
|
|
363
|
+
</ul>
|
|
364
|
+
|
|
365
|
+
<p class="tag_title">Returns:</p>
|
|
366
|
+
<ul class="return">
|
|
367
|
+
|
|
368
|
+
<li>
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
<span class='type'></span>
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
<div class='inline'>
|
|
377
|
+
<p>response</p>
|
|
378
|
+
</div>
|
|
379
|
+
|
|
380
|
+
</li>
|
|
381
|
+
|
|
382
|
+
</ul>
|
|
383
|
+
|
|
384
|
+
</div><table class="source_code">
|
|
385
|
+
<tr>
|
|
386
|
+
<td>
|
|
387
|
+
<pre class="lines">
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
22
|
|
391
|
+
23
|
|
392
|
+
24</pre>
|
|
393
|
+
</td>
|
|
394
|
+
<td>
|
|
395
|
+
<pre class="code"><span class="info file"># File 'lib/zero_push.rb', line 22</span>
|
|
396
|
+
|
|
397
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_notify'>notify</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
|
398
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/api/notify</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
|
399
|
+
<span class='kw'>end</span></pre>
|
|
400
|
+
</td>
|
|
401
|
+
</tr>
|
|
402
|
+
</table>
|
|
403
|
+
</div>
|
|
404
|
+
|
|
405
|
+
<div class="method_details ">
|
|
406
|
+
<h3 class="signature " id="verify_credentials-class_method">
|
|
407
|
+
|
|
408
|
+
+ (<tt>Boolean</tt>) <strong>verify_credentials</strong>
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
</h3><div class="docstring">
|
|
415
|
+
<div class="discussion">
|
|
416
|
+
|
|
417
|
+
<p>verifies credentials</p>
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
</div>
|
|
421
|
+
</div>
|
|
422
|
+
<div class="tags">
|
|
423
|
+
|
|
424
|
+
<p class="tag_title">Returns:</p>
|
|
425
|
+
<ul class="return">
|
|
426
|
+
|
|
427
|
+
<li>
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
</li>
|
|
435
|
+
|
|
436
|
+
</ul>
|
|
437
|
+
|
|
438
|
+
</div><table class="source_code">
|
|
439
|
+
<tr>
|
|
440
|
+
<td>
|
|
441
|
+
<pre class="lines">
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
13
|
|
445
|
+
14
|
|
446
|
+
15
|
|
447
|
+
16</pre>
|
|
448
|
+
</td>
|
|
449
|
+
<td>
|
|
450
|
+
<pre class="code"><span class="info file"># File 'lib/zero_push.rb', line 13</span>
|
|
451
|
+
|
|
452
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_verify_credentials'>verify_credentials</span>
|
|
453
|
+
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/api/verify_credentials</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
454
|
+
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='op'>==</span> <span class='int'>200</span>
|
|
455
|
+
<span class='kw'>end</span></pre>
|
|
456
|
+
</td>
|
|
457
|
+
</tr>
|
|
458
|
+
</table>
|
|
459
|
+
</div>
|
|
460
|
+
|
|
461
|
+
</div>
|
|
462
|
+
|
|
463
|
+
</div>
|
|
464
|
+
|
|
465
|
+
<div id="footer">
|
|
466
|
+
Generated on Fri Feb 22 12:52:51 2013 by
|
|
467
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
468
|
+
0.8.4.1 (ruby-1.9.3).
|
|
469
|
+
</div>
|
|
470
|
+
|
|
471
|
+
</body>
|
|
472
|
+
</html>
|