git_hub 0.2.0 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
3
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
4
  <head>
5
- <title>Class: GitHub::Base [zemax 0.1.0
5
+ <title>Class: GitHub::Base [git_hub 0.2.7
6
6
  ]</title>
7
7
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
8
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
@@ -92,24 +92,30 @@
92
92
 
93
93
  <div class="name-list">
94
94
 
95
- <a href="#M000017">api</a>&nbsp;&nbsp;
96
-
97
95
  <a href="#M000014">api</a>&nbsp;&nbsp;
98
96
 
99
- <a href="#M000010">base_uri</a>&nbsp;&nbsp;
97
+ <a href="#M000019">api</a>&nbsp;&nbsp;
98
+
99
+ <a href="#M000016">base_uri</a>&nbsp;&nbsp;
100
100
 
101
101
  <a href="#M000012">get</a>&nbsp;&nbsp;
102
102
 
103
- <a href="#M000015">get</a>&nbsp;&nbsp;
103
+ <a href="#M000017">get</a>&nbsp;&nbsp;
104
104
 
105
105
  <a href="#M000009">new</a>&nbsp;&nbsp;
106
106
 
107
107
  <a href="#M000013">post</a>&nbsp;&nbsp;
108
108
 
109
- <a href="#M000016">post</a>&nbsp;&nbsp;
109
+ <a href="#M000018">post</a>&nbsp;&nbsp;
110
110
 
111
111
  <a href="#M000011">request</a>&nbsp;&nbsp;
112
112
 
113
+ <a href="#M000010">set_attributes</a>&nbsp;&nbsp;
114
+
115
+ <a href="#M000015">set_resource</a>&nbsp;&nbsp;
116
+
117
+ <a href="#M000020">to_s</a>&nbsp;&nbsp;
118
+
113
119
  </div>
114
120
  </div>
115
121
 
@@ -148,9 +154,9 @@
148
154
  onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
149
155
  <div class="method-source-code" id="M000014-source">
150
156
  <pre>
151
- <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 33</span>
157
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 34</span>
152
158
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">api</span>
153
- <span class="ruby-ivar">@@api</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">GitHub</span><span class="ruby-operator">::</span><span class="ruby-constant">Api</span>.<span class="ruby-identifier">instance</span>
159
+ <span class="ruby-ivar">@@api</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Api</span>.<span class="ruby-identifier">instance</span>
154
160
  <span class="ruby-keyword kw">end</span>
155
161
  </pre>
156
162
  </div>
@@ -159,14 +165,14 @@
159
165
  </div>
160
166
 
161
167
 
162
- <div id="method-M000010" class="method-detail">
163
- <a name="M000010"></a>
168
+ <div id="method-M000016" class="method-detail">
169
+ <a name="M000016"></a>
164
170
 
165
171
  <div class="method-heading">
166
172
 
167
- <a href="#M000010" class="method-signature">
173
+ <a href="#M000016" class="method-signature">
168
174
 
169
- <span class="method-name">base_uri</span><span class="method-args">(uri)</span>
175
+ <span class="method-name">base_uri</span><span class="method-args">()</span>
170
176
 
171
177
  </a>
172
178
 
@@ -175,13 +181,13 @@
175
181
  <div class="method-description">
176
182
 
177
183
  <p><a class="source-toggle" href="#"
178
- onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
179
- <div class="method-source-code" id="M000010-source">
184
+ onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
185
+ <div class="method-source-code" id="M000016-source">
180
186
  <pre>
181
- <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 14</span>
182
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">base_uri</span> <span class="ruby-identifier">uri</span>
183
- <span class="ruby-ivar">@base_uri</span> = <span class="ruby-identifier">uri</span>
184
- <span class="ruby-keyword kw">end</span>
187
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 44</span>
188
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base_uri</span>
189
+ <span class="ruby-ivar">@base_uri</span> <span class="ruby-operator">||</span> <span class="ruby-value str">''</span>
190
+ <span class="ruby-keyword kw">end</span>
185
191
  </pre>
186
192
  </div>
187
193
 
@@ -208,7 +214,7 @@
208
214
  onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
209
215
  <div class="method-source-code" id="M000012-source">
210
216
  <pre>
211
- <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 25</span>
217
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 26</span>
212
218
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> ={}
213
219
  <span class="ruby-identifier">request</span> <span class="ruby-identifier">:get</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span>
214
220
  <span class="ruby-keyword kw">end</span>
@@ -238,12 +244,9 @@
238
244
  onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
239
245
  <div class="method-source-code" id="M000009-source">
240
246
  <pre>
241
- <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 7</span>
247
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 6</span>
242
248
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">attributes</span>={})
243
- <span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
244
- <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;No attr_accessor for #{key} on #{self.class}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;#{key}=&quot;</span>)
245
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{key}=&quot;</span>, <span class="ruby-identifier">value</span>)
246
- <span class="ruby-keyword kw">end</span>
249
+ <span class="ruby-identifier">set_attributes</span> <span class="ruby-identifier">attributes</span>
247
250
  <span class="ruby-keyword kw">end</span>
248
251
  </pre>
249
252
  </div>
@@ -271,7 +274,7 @@
271
274
  onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
272
275
  <div class="method-source-code" id="M000013-source">
273
276
  <pre>
274
- <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 29</span>
277
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 30</span>
275
278
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> = {}
276
279
  <span class="ruby-identifier">request</span> <span class="ruby-identifier">:post</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span>
277
280
  <span class="ruby-keyword kw">end</span>
@@ -301,11 +304,45 @@
301
304
  onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
302
305
  <div class="method-source-code" id="M000011-source">
303
306
  <pre>
304
- <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 19</span>
307
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 18</span>
305
308
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request</span> <span class="ruby-identifier">verb</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> = {}
306
- <span class="ruby-identifier">res</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">request</span> <span class="ruby-identifier">verb</span>, <span class="ruby-ivar">@base_uri</span><span class="ruby-operator">+</span><span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span>
307
- <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:body</span>) <span class="ruby-comment cmt"># res.kind_of?(Net::HTTPSuccess)</span>
308
- <span class="ruby-comment cmt">#p &quot;in show: #{res}: #{res.code}: #{res.http_version}: #{res.message}&quot;, res.body</span>
309
+ <span class="ruby-identifier">full_uri</span> = <span class="ruby-identifier">uri</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">base_uri</span><span class="ruby-operator">+</span><span class="ruby-identifier">uri</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">uri</span>
310
+ <span class="ruby-comment cmt">#p &quot;request: #{verb} #{full_uri} #{params}&quot;</span>
311
+ <span class="ruby-identifier">res</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">request</span> <span class="ruby-identifier">verb</span>, <span class="ruby-identifier">full_uri</span>, <span class="ruby-identifier">params</span>
312
+ <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:body</span>)
313
+ <span class="ruby-comment cmt">#p &quot;response: #{res}: #{res.code}: #{res.http_version}: #{res.message}&quot;, res.body</span>
314
+ <span class="ruby-keyword kw">end</span>
315
+ </pre>
316
+ </div>
317
+
318
+ </div>
319
+ </div>
320
+
321
+
322
+ <div id="method-M000015" class="method-detail">
323
+ <a name="M000015"></a>
324
+
325
+ <div class="method-heading">
326
+
327
+ <a href="#M000015" class="method-signature">
328
+
329
+ <span class="method-name">set_resource</span><span class="method-args">(base_uri, singulars, plurals)</span>
330
+
331
+ </a>
332
+
333
+ </div>
334
+
335
+ <div class="method-description">
336
+
337
+ <p><a class="source-toggle" href="#"
338
+ onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
339
+ <div class="method-source-code" id="M000015-source">
340
+ <pre>
341
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 38</span>
342
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_resource</span> <span class="ruby-identifier">base_uri</span>, <span class="ruby-identifier">singulars</span>, <span class="ruby-identifier">plurals</span>
343
+ <span class="ruby-ivar">@base_uri</span> = <span class="ruby-identifier">base_uri</span>
344
+ <span class="ruby-ivar">@singulars</span> = [<span class="ruby-identifier">singulars</span>].<span class="ruby-identifier">flatten</span>
345
+ <span class="ruby-ivar">@plurals</span> = [<span class="ruby-identifier">plurals</span>].<span class="ruby-identifier">flatten</span>
309
346
  <span class="ruby-keyword kw">end</span>
310
347
  </pre>
311
348
  </div>
@@ -317,12 +354,12 @@
317
354
  <h3 class="section-bar">Public Instance methods</h3>
318
355
 
319
356
 
320
- <div id="method-M000017" class="method-detail">
321
- <a name="M000017"></a>
357
+ <div id="method-M000019" class="method-detail">
358
+ <a name="M000019"></a>
322
359
 
323
360
  <div class="method-heading">
324
361
 
325
- <a href="#M000017" class="method-signature">
362
+ <a href="#M000019" class="method-signature">
326
363
 
327
364
  <span class="method-name">api</span><span class="method-args">()</span>
328
365
 
@@ -333,10 +370,10 @@
333
370
  <div class="method-description">
334
371
 
335
372
  <p><a class="source-toggle" href="#"
336
- onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
337
- <div class="method-source-code" id="M000017-source">
373
+ onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
374
+ <div class="method-source-code" id="M000019-source">
338
375
  <pre>
339
- <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 54</span>
376
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 97</span>
340
377
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">api</span>
341
378
  <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">api</span>
342
379
  <span class="ruby-keyword kw">end</span>
@@ -347,12 +384,12 @@
347
384
  </div>
348
385
 
349
386
 
350
- <div id="method-M000015" class="method-detail">
351
- <a name="M000015"></a>
387
+ <div id="method-M000017" class="method-detail">
388
+ <a name="M000017"></a>
352
389
 
353
390
  <div class="method-heading">
354
391
 
355
- <a href="#M000015" class="method-signature">
392
+ <a href="#M000017" class="method-signature">
356
393
 
357
394
  <span class="method-name">get</span><span class="method-args">(uri, params ={})</span>
358
395
 
@@ -363,10 +400,10 @@
363
400
  <div class="method-description">
364
401
 
365
402
  <p><a class="source-toggle" href="#"
366
- onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
367
- <div class="method-source-code" id="M000015-source">
403
+ onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
404
+ <div class="method-source-code" id="M000017-source">
368
405
  <pre>
369
- <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 46</span>
406
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 89</span>
370
407
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> ={}
371
408
  <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">get</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span>
372
409
  <span class="ruby-keyword kw">end</span>
@@ -377,12 +414,12 @@
377
414
  </div>
378
415
 
379
416
 
380
- <div id="method-M000016" class="method-detail">
381
- <a name="M000016"></a>
417
+ <div id="method-M000018" class="method-detail">
418
+ <a name="M000018"></a>
382
419
 
383
420
  <div class="method-heading">
384
421
 
385
- <a href="#M000016" class="method-signature">
422
+ <a href="#M000018" class="method-signature">
386
423
 
387
424
  <span class="method-name">post</span><span class="method-args">(uri, params ={})</span>
388
425
 
@@ -393,10 +430,10 @@
393
430
  <div class="method-description">
394
431
 
395
432
  <p><a class="source-toggle" href="#"
396
- onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
397
- <div class="method-source-code" id="M000016-source">
433
+ onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
434
+ <div class="method-source-code" id="M000018-source">
398
435
  <pre>
399
- <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 50</span>
436
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 93</span>
400
437
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> ={}
401
438
  <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">post</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span>
402
439
  <span class="ruby-keyword kw">end</span>
@@ -407,6 +444,69 @@
407
444
  </div>
408
445
 
409
446
 
447
+ <div id="method-M000010" class="method-detail">
448
+ <a name="M000010"></a>
449
+
450
+ <div class="method-heading">
451
+
452
+ <a href="#M000010" class="method-signature">
453
+
454
+ <span class="method-name">set_attributes</span><span class="method-args">(attributes)</span>
455
+
456
+ </a>
457
+
458
+ </div>
459
+
460
+ <div class="method-description">
461
+
462
+ <p><a class="source-toggle" href="#"
463
+ onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
464
+ <div class="method-source-code" id="M000010-source">
465
+ <pre>
466
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 10</span>
467
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_attributes</span> <span class="ruby-identifier">attributes</span>
468
+ <span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
469
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;No attr_accessor for #{key} on #{self.class}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;#{key}=&quot;</span>)
470
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{key.to_s}=&quot;</span>, <span class="ruby-identifier">value</span>)
471
+ <span class="ruby-keyword kw">end</span>
472
+ <span class="ruby-keyword kw">end</span>
473
+ </pre>
474
+ </div>
475
+
476
+ </div>
477
+ </div>
478
+
479
+
480
+ <div id="method-M000020" class="method-detail">
481
+ <a name="M000020"></a>
482
+
483
+ <div class="method-heading">
484
+
485
+ <a href="#M000020" class="method-signature">
486
+
487
+ <span class="method-name">to_s</span><span class="method-args">()</span>
488
+
489
+ </a>
490
+
491
+ </div>
492
+
493
+ <div class="method-description">
494
+
495
+ <p><a class="source-toggle" href="#"
496
+ onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
497
+ <div class="method-source-code" id="M000020-source">
498
+ <pre>
499
+ <span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 101</span>
500
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
501
+ <span class="ruby-identifier">name</span>
502
+ <span class="ruby-keyword kw">end</span>
503
+ </pre>
504
+ </div>
505
+
506
+ </div>
507
+ </div>
508
+
509
+
410
510
 
411
511
  </div>
412
512