git_hub 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +16 -2
- data/VERSION +1 -1
- data/bin/git_hub +1 -2
- data/git_hub.gemspec +30 -3
- data/lib/git_hub/api.rb +6 -0
- data/lib/git_hub/base.rb +52 -10
- data/lib/git_hub/commit.rb +45 -0
- data/lib/git_hub/repo.rb +47 -51
- data/rdoc/classes/GitHub/Api.html +300 -0
- data/rdoc/classes/GitHub/Base.html +423 -0
- data/rdoc/classes/GitHub/Repo.html +738 -0
- data/rdoc/classes/GitHub.html +310 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README_rdoc.html +171 -0
- data/rdoc/files/lib/git_hub/api_rb.html +103 -0
- data/rdoc/files/lib/git_hub/base_rb.html +101 -0
- data/rdoc/files/lib/git_hub/repo_rb.html +91 -0
- data/rdoc/files/lib/git_hub_rb.html +91 -0
- data/rdoc/fr_class_index.html +33 -0
- data/rdoc/fr_file_index.html +35 -0
- data/rdoc/fr_method_index.html +81 -0
- data/rdoc/index.html +23 -0
- data/rdoc/rdoc-style.css +299 -0
- data/spec/git_hub/base_spec.rb +2 -2
- data/spec/git_hub/commit_spec.rb +53 -0
- data/spec/git_hub/repo_spec.rb +123 -85
- data/spec/spec_helper.rb +35 -8
- data/spec/stubs/api_route_error.res +14 -0
- data/spec/stubs/commits/list/joe007/fine_repo/master/README.res +28 -0
- data/spec/stubs/commits/list/joe007/fine_repo/master.res +84 -0
- data/spec/stubs/commits/show/joe007/fine_repo/5e61f0687c40ca48214d09dc7ae2d0d0d8fbfeb8.res +38 -0
- data/spec/stubs/repos/create.1.res +22 -0
- data/spec/stubs/repos/{create.res → create.2.res} +0 -0
- data/spec/stubs/repos/create.3.res +100 -0
- data/spec/stubs/repos/create.4.res +14 -0
- data/spec/stubs/repos/show/joe007/fine_repo/branches.res +15 -0
- data/spec/stubs/repos/show/joe007/fine_repo/tags.res +17 -0
- metadata +30 -3
@@ -0,0 +1,423 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Class: GitHub::Base [zemax 0.1.0
|
6
|
+
]</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
9
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
+
<script type="text/javascript">
|
11
|
+
// <![CDATA[
|
12
|
+
|
13
|
+
function popupCode( url ) {
|
14
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
15
|
+
}
|
16
|
+
|
17
|
+
function toggleCode( id ) {
|
18
|
+
if ( document.getElementById )
|
19
|
+
elem = document.getElementById( id );
|
20
|
+
else if ( document.all )
|
21
|
+
elem = eval( "document.all." + id );
|
22
|
+
else
|
23
|
+
return false;
|
24
|
+
|
25
|
+
elemStyle = elem.style;
|
26
|
+
|
27
|
+
if ( elemStyle.display != "block" ) {
|
28
|
+
elemStyle.display = "block"
|
29
|
+
} else {
|
30
|
+
elemStyle.display = "none"
|
31
|
+
}
|
32
|
+
|
33
|
+
return true;
|
34
|
+
}
|
35
|
+
|
36
|
+
// Make codeblocks hidden by default
|
37
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
38
|
+
|
39
|
+
// ]]>
|
40
|
+
</script>
|
41
|
+
|
42
|
+
</head>
|
43
|
+
<body>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="classHeader">
|
47
|
+
<table class="header-table">
|
48
|
+
<tr class="top-aligned-row">
|
49
|
+
<td><strong>Class</strong></td>
|
50
|
+
<td class="class-name-in-header">GitHub::Base</td>
|
51
|
+
</tr>
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>In:</strong></td>
|
54
|
+
<td>
|
55
|
+
|
56
|
+
|
57
|
+
<a href="../../files/lib/git_hub/base_rb.html">
|
58
|
+
|
59
|
+
lib/git_hub/base.rb
|
60
|
+
|
61
|
+
</a>
|
62
|
+
|
63
|
+
|
64
|
+
<br />
|
65
|
+
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
|
69
|
+
|
70
|
+
<tr class="top-aligned-row">
|
71
|
+
<td><strong>Parent:</strong></td>
|
72
|
+
<td>
|
73
|
+
|
74
|
+
Object
|
75
|
+
|
76
|
+
</td>
|
77
|
+
</tr>
|
78
|
+
|
79
|
+
</table>
|
80
|
+
</div>
|
81
|
+
<!-- banner header -->
|
82
|
+
|
83
|
+
<div id="bodyContent">
|
84
|
+
|
85
|
+
<div id="contextContent">
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
<div id="method-list">
|
91
|
+
<h3 class="section-bar">Methods</h3>
|
92
|
+
|
93
|
+
<div class="name-list">
|
94
|
+
|
95
|
+
<a href="#M000017">api</a>
|
96
|
+
|
97
|
+
<a href="#M000014">api</a>
|
98
|
+
|
99
|
+
<a href="#M000010">base_uri</a>
|
100
|
+
|
101
|
+
<a href="#M000012">get</a>
|
102
|
+
|
103
|
+
<a href="#M000015">get</a>
|
104
|
+
|
105
|
+
<a href="#M000009">new</a>
|
106
|
+
|
107
|
+
<a href="#M000013">post</a>
|
108
|
+
|
109
|
+
<a href="#M000016">post</a>
|
110
|
+
|
111
|
+
<a href="#M000011">request</a>
|
112
|
+
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<!-- if includes -->
|
119
|
+
|
120
|
+
<div id="section">
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<!-- if method_list -->
|
126
|
+
|
127
|
+
<div id="methods">
|
128
|
+
|
129
|
+
<h3 class="section-bar">Public Class methods</h3>
|
130
|
+
|
131
|
+
|
132
|
+
<div id="method-M000014" class="method-detail">
|
133
|
+
<a name="M000014"></a>
|
134
|
+
|
135
|
+
<div class="method-heading">
|
136
|
+
|
137
|
+
<a href="#M000014" class="method-signature">
|
138
|
+
|
139
|
+
<span class="method-name">api</span><span class="method-args">()</span>
|
140
|
+
|
141
|
+
</a>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div class="method-description">
|
146
|
+
|
147
|
+
<p><a class="source-toggle" href="#"
|
148
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
149
|
+
<div class="method-source-code" id="M000014-source">
|
150
|
+
<pre>
|
151
|
+
<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 33</span>
|
152
|
+
<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>
|
154
|
+
<span class="ruby-keyword kw">end</span>
|
155
|
+
</pre>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
|
162
|
+
<div id="method-M000010" class="method-detail">
|
163
|
+
<a name="M000010"></a>
|
164
|
+
|
165
|
+
<div class="method-heading">
|
166
|
+
|
167
|
+
<a href="#M000010" class="method-signature">
|
168
|
+
|
169
|
+
<span class="method-name">base_uri</span><span class="method-args">(uri)</span>
|
170
|
+
|
171
|
+
</a>
|
172
|
+
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div class="method-description">
|
176
|
+
|
177
|
+
<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">
|
180
|
+
<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>
|
185
|
+
</pre>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
|
192
|
+
<div id="method-M000012" class="method-detail">
|
193
|
+
<a name="M000012"></a>
|
194
|
+
|
195
|
+
<div class="method-heading">
|
196
|
+
|
197
|
+
<a href="#M000012" class="method-signature">
|
198
|
+
|
199
|
+
<span class="method-name">get</span><span class="method-args">(uri, params ={})</span>
|
200
|
+
|
201
|
+
</a>
|
202
|
+
|
203
|
+
</div>
|
204
|
+
|
205
|
+
<div class="method-description">
|
206
|
+
|
207
|
+
<p><a class="source-toggle" href="#"
|
208
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
209
|
+
<div class="method-source-code" id="M000012-source">
|
210
|
+
<pre>
|
211
|
+
<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 25</span>
|
212
|
+
<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
|
+
<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
|
+
<span class="ruby-keyword kw">end</span>
|
215
|
+
</pre>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
</div>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
|
222
|
+
<div id="method-M000009" class="method-detail">
|
223
|
+
<a name="M000009"></a>
|
224
|
+
|
225
|
+
<div class="method-heading">
|
226
|
+
|
227
|
+
<a href="#M000009" class="method-signature">
|
228
|
+
|
229
|
+
<span class="method-name">new</span><span class="method-args">(attributes={})</span>
|
230
|
+
|
231
|
+
</a>
|
232
|
+
|
233
|
+
</div>
|
234
|
+
|
235
|
+
<div class="method-description">
|
236
|
+
|
237
|
+
<p><a class="source-toggle" href="#"
|
238
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
239
|
+
<div class="method-source-code" id="M000009-source">
|
240
|
+
<pre>
|
241
|
+
<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 7</span>
|
242
|
+
<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">"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>
|
247
|
+
<span class="ruby-keyword kw">end</span>
|
248
|
+
</pre>
|
249
|
+
</div>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
</div>
|
253
|
+
|
254
|
+
|
255
|
+
<div id="method-M000013" class="method-detail">
|
256
|
+
<a name="M000013"></a>
|
257
|
+
|
258
|
+
<div class="method-heading">
|
259
|
+
|
260
|
+
<a href="#M000013" class="method-signature">
|
261
|
+
|
262
|
+
<span class="method-name">post</span><span class="method-args">(uri, params = {})</span>
|
263
|
+
|
264
|
+
</a>
|
265
|
+
|
266
|
+
</div>
|
267
|
+
|
268
|
+
<div class="method-description">
|
269
|
+
|
270
|
+
<p><a class="source-toggle" href="#"
|
271
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
272
|
+
<div class="method-source-code" id="M000013-source">
|
273
|
+
<pre>
|
274
|
+
<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 29</span>
|
275
|
+
<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
|
+
<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
|
+
<span class="ruby-keyword kw">end</span>
|
278
|
+
</pre>
|
279
|
+
</div>
|
280
|
+
|
281
|
+
</div>
|
282
|
+
</div>
|
283
|
+
|
284
|
+
|
285
|
+
<div id="method-M000011" class="method-detail">
|
286
|
+
<a name="M000011"></a>
|
287
|
+
|
288
|
+
<div class="method-heading">
|
289
|
+
|
290
|
+
<a href="#M000011" class="method-signature">
|
291
|
+
|
292
|
+
<span class="method-name">request</span><span class="method-args">(verb, uri, params = {})</span>
|
293
|
+
|
294
|
+
</a>
|
295
|
+
|
296
|
+
</div>
|
297
|
+
|
298
|
+
<div class="method-description">
|
299
|
+
|
300
|
+
<p><a class="source-toggle" href="#"
|
301
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
302
|
+
<div class="method-source-code" id="M000011-source">
|
303
|
+
<pre>
|
304
|
+
<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 19</span>
|
305
|
+
<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 "in show: #{res}: #{res.code}: #{res.http_version}: #{res.message}", res.body</span>
|
309
|
+
<span class="ruby-keyword kw">end</span>
|
310
|
+
</pre>
|
311
|
+
</div>
|
312
|
+
|
313
|
+
</div>
|
314
|
+
</div>
|
315
|
+
|
316
|
+
|
317
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
318
|
+
|
319
|
+
|
320
|
+
<div id="method-M000017" class="method-detail">
|
321
|
+
<a name="M000017"></a>
|
322
|
+
|
323
|
+
<div class="method-heading">
|
324
|
+
|
325
|
+
<a href="#M000017" class="method-signature">
|
326
|
+
|
327
|
+
<span class="method-name">api</span><span class="method-args">()</span>
|
328
|
+
|
329
|
+
</a>
|
330
|
+
|
331
|
+
</div>
|
332
|
+
|
333
|
+
<div class="method-description">
|
334
|
+
|
335
|
+
<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">
|
338
|
+
<pre>
|
339
|
+
<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 54</span>
|
340
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">api</span>
|
341
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">api</span>
|
342
|
+
<span class="ruby-keyword kw">end</span>
|
343
|
+
</pre>
|
344
|
+
</div>
|
345
|
+
|
346
|
+
</div>
|
347
|
+
</div>
|
348
|
+
|
349
|
+
|
350
|
+
<div id="method-M000015" class="method-detail">
|
351
|
+
<a name="M000015"></a>
|
352
|
+
|
353
|
+
<div class="method-heading">
|
354
|
+
|
355
|
+
<a href="#M000015" class="method-signature">
|
356
|
+
|
357
|
+
<span class="method-name">get</span><span class="method-args">(uri, params ={})</span>
|
358
|
+
|
359
|
+
</a>
|
360
|
+
|
361
|
+
</div>
|
362
|
+
|
363
|
+
<div class="method-description">
|
364
|
+
|
365
|
+
<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">
|
368
|
+
<pre>
|
369
|
+
<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 46</span>
|
370
|
+
<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
|
+
<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
|
+
<span class="ruby-keyword kw">end</span>
|
373
|
+
</pre>
|
374
|
+
</div>
|
375
|
+
|
376
|
+
</div>
|
377
|
+
</div>
|
378
|
+
|
379
|
+
|
380
|
+
<div id="method-M000016" class="method-detail">
|
381
|
+
<a name="M000016"></a>
|
382
|
+
|
383
|
+
<div class="method-heading">
|
384
|
+
|
385
|
+
<a href="#M000016" class="method-signature">
|
386
|
+
|
387
|
+
<span class="method-name">post</span><span class="method-args">(uri, params ={})</span>
|
388
|
+
|
389
|
+
</a>
|
390
|
+
|
391
|
+
</div>
|
392
|
+
|
393
|
+
<div class="method-description">
|
394
|
+
|
395
|
+
<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">
|
398
|
+
<pre>
|
399
|
+
<span class="ruby-comment cmt"># File lib/git_hub/base.rb, line 50</span>
|
400
|
+
<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
|
+
<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
|
+
<span class="ruby-keyword kw">end</span>
|
403
|
+
</pre>
|
404
|
+
</div>
|
405
|
+
|
406
|
+
</div>
|
407
|
+
</div>
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
</div>
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
</div>
|
417
|
+
|
418
|
+
<div id="validator-badges">
|
419
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
</body>
|
423
|
+
</html>
|