git_hub 0.2.0 → 0.2.7
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/README.rdoc +30 -29
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/features/{zemax.feature → git_hub.feature} +0 -0
- data/features/step_definitions/{zemax_steps.rb → git_hub_steps.rb} +0 -0
- data/features/support/env.rb +1 -1
- data/git_hub.gemspec +10 -4
- data/lib/git_hub/base.rb +37 -23
- data/lib/git_hub/commit.rb +20 -17
- data/lib/git_hub/repo.rb +51 -31
- data/lib/git_hub.rb +1 -10
- data/rdoc/classes/GitHub/Api.html +49 -15
- data/rdoc/classes/GitHub/Base.html +147 -47
- data/rdoc/classes/GitHub/Commit.html +390 -0
- data/rdoc/classes/GitHub/Repo.html +266 -111
- data/rdoc/classes/GitHub.html +34 -60
- data/rdoc/created.rid +1 -1
- data/rdoc/files/README_rdoc.html +43 -18
- data/rdoc/files/lib/git_hub/api_rb.html +2 -2
- data/rdoc/files/lib/git_hub/base_rb.html +2 -2
- data/rdoc/files/lib/git_hub/commit_rb.html +91 -0
- data/rdoc/files/lib/git_hub/repo_rb.html +2 -2
- data/rdoc/files/lib/git_hub_rb.html +2 -2
- data/rdoc/fr_class_index.html +4 -2
- data/rdoc/fr_file_index.html +4 -2
- data/rdoc/fr_method_index.html +42 -24
- data/rdoc/index.html +2 -2
- data/spec/git_hub/commit_spec.rb +6 -6
- data/spec/git_hub/repo_spec.rb +12 -7
- data/spec/git_hub/user_spec.rb +15 -0
- data/spec/spec_helper.rb +6 -2
- data/spec/stubs/commits/show/joe007/fine_repo/3a70f86293b719f193f778a8710b1f83f2f7bf38.res +47 -0
- data/spec/stubs/commits/show/joe007/fine_repo/f7f5dddaa37deacc83f1f56876e2b135389d03ab.res +38 -0
- metadata +10 -4
@@ -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 [
|
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>
|
96
|
-
|
97
95
|
<a href="#M000014">api</a>
|
98
96
|
|
99
|
-
<a href="#
|
97
|
+
<a href="#M000019">api</a>
|
98
|
+
|
99
|
+
<a href="#M000016">base_uri</a>
|
100
100
|
|
101
101
|
<a href="#M000012">get</a>
|
102
102
|
|
103
|
-
<a href="#
|
103
|
+
<a href="#M000017">get</a>
|
104
104
|
|
105
105
|
<a href="#M000009">new</a>
|
106
106
|
|
107
107
|
<a href="#M000013">post</a>
|
108
108
|
|
109
|
-
<a href="#
|
109
|
+
<a href="#M000018">post</a>
|
110
110
|
|
111
111
|
<a href="#M000011">request</a>
|
112
112
|
|
113
|
+
<a href="#M000010">set_attributes</a>
|
114
|
+
|
115
|
+
<a href="#M000015">set_resource</a>
|
116
|
+
|
117
|
+
<a href="#M000020">to_s</a>
|
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
|
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">
|
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-
|
163
|
-
<a name="
|
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="#
|
173
|
+
<a href="#M000016" class="method-signature">
|
168
174
|
|
169
|
-
<span class="method-name">base_uri</span><span class="method-args">(
|
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('
|
179
|
-
<div class="method-source-code" id="
|
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
|
182
|
-
|
183
|
-
|
184
|
-
|
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
|
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
|
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">
|
244
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-node">"No attr_accessor for #{key} on #{self.class}"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">"#{key}="</span>)
|
245
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">"#{key}="</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
|
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
|
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">
|
307
|
-
<span class="ruby-
|
308
|
-
<span class="ruby-
|
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 "request: #{verb} #{full_uri} #{params}"</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 "response: #{res}: #{res.code}: #{res.http_version}: #{res.message}", 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-
|
321
|
-
<a name="
|
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="#
|
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('
|
337
|
-
<div class="method-source-code" id="
|
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
|
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-
|
351
|
-
<a name="
|
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="#
|
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('
|
367
|
-
<div class="method-source-code" id="
|
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
|
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-
|
381
|
-
<a name="
|
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="#
|
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('
|
397
|
-
<div class="method-source-code" id="
|
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
|
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">"No attr_accessor for #{key} on #{self.class}"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">"#{key}="</span>)
|
470
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">"#{key.to_s}="</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
|
|