/
file.README.html
849 lines (638 loc) · 73.3 KB
/
file.README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
File: README
—
</title>
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
pathId = "README";
relpath = '';
</script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="file_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="_index.html">Index</a> »
<span class="title">File: README</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><div id='filecontents'><h1>Octokit</h1>
<p>Ruby toolkit for the GitHub API.</p>
<p><img src="http://cl.ly/image/3Y013H0A2z3z/gundam-ruby.png" alt="logo"></p>
<p>Upgrading? Check the <a href="#Upgrading_guide">Upgrade Guide</a> before bumping to a new
<a href="http://semver.org/">major version</a>.</p>
<h2>Table of Contents</h2>
<ol>
<li><a href="#Philosophy">Philosophy</a></li>
<li><a href="#Quick_start">Quick start</a></li>
<li><a href="#Making_requests">Making requests</a></li>
<li><a href="#Consuming_resources">Consuming resources</a></li>
<li><a href="#Accessing_http_responses">Accessing HTTP responses</a></li>
<li><a href="#Authentication">Authentication</a>
<ol>
<li><a href="#basic-Authentication">Basic Authentication</a></li>
<li><a href="#Oauth_access_tokens">OAuth access tokens</a></li>
<li><a href="#two-factor-Authentication">Two-Factor Authentication</a></li>
<li><a href="#Using_a_netrc_file">Using a .netrc file</a></li>
<li><a href="#application-Authentication">Application Authentication</a></li>
</ol></li>
<li><a href="#Pagination">Pagination</a>
<ol>
<li><a href="#auto-Pagination">Auto Pagination</a></li>
</ol></li>
<li><a href="#Working_with_github_enterprise">Working with GitHub Enterprise</a>
<ol>
<li><a href="#Interacting_with_the_githubcom_apis_in_github_enterprise">Interacting with the GitHub.com APIs in GitHub Enterprise</a></li>
<li><a href="#Interacting_with_the_github_enterprise_admin_apis">Interacting with the GitHub Enterprise Admin APIs</a></li>
<li><a href="#Interacting_with_the_github_enterprise_management_console_apis">Interacting with the GitHub Enterprise Management Console APIs</a></li>
</ol></li>
<li><a href="#Ssl_connection_errors">SSL Connection Errors</a></li>
<li><a href="#Configuration_and_defaults">Configuration and defaults</a>
<ol>
<li><a href="#Configuring_module_defaults">Configuring module defaults</a></li>
<li><a href="#Using_env_variables">Using ENV variables</a></li>
</ol></li>
<li><a href="#Hypermedia_agent">Hypermedia agent</a>
<ol>
<li><a href="#Hypermedia_in_octokit">Hypermedia in Octokit</a></li>
<li><a href="#Uri_templates">URI templates</a></li>
<li><a href="#The_full_hypermedia_experience">The Full Hypermedia Experience™</a></li>
</ol></li>
<li><a href="#Upgrading_guide">Upgrading guide</a>
<ol>
<li><a href="#Upgrading_from_1xx">Upgrading from 1.x.x</a></li>
</ol></li>
<li><a href="#Advanced_usage">Advanced usage</a>
<ol>
<li><a href="#Debugging">Debugging</a></li>
<li><a href="#Caching">Caching</a></li>
</ol></li>
<li><a href="#Hacking_on_octokitrb">Hacking on Octokit.rb</a>
<ol>
<li><a href="#Running_and_writing_new_tests">Running and writing new tests</a></li>
</ol></li>
<li><a href="#Supported_ruby_versions">Supported Ruby Versions</a></li>
<li><a href="#Versioning">Versioning</a></li>
<li><a href="#License">License</a></li>
</ol>
<h2>Philosophy</h2>
<p>API wrappers <a href="http://wynnnetherland.com/journal/what-makes-a-good-api-wrapper">should reflect the idioms of the language in which they were
written</a>. Octokit.rb wraps the <a href="http://developer.github.com">GitHub API</a> in a flat API
client that follows Ruby conventions and requires little knowledge of REST.
Most methods have positional arguments for required input and an options hash
for optional parameters, headers, or other options:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span>
<span class='comment'># Fetch a README with Accept header for HTML format
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_readme'>readme</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>al3x/sovereign</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:accept</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>application/vnd.github.html</span><span class='tstring_end'>'</span></span>
</code></pre>
<h2>Quick start</h2>
<p>Install via Rubygems</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_octokit'>octokit</span>
</code></pre>
<p>... or add to your Gemfile</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>octokit</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>~> 4.0</span><span class='tstring_end'>"</span></span>
</code></pre>
<p>Access the library in Ruby:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>octokit</span><span class='tstring_end'>'</span></span>
</code></pre>
<h3>Making requests</h3>
<p><a href="http://octokit.github.io/octokit.rb/method_list.html">API methods</a> are available as client instance methods.</p>
<pre class="code ruby"><code class="ruby"><span class='comment'># Provide Authentication credentials
</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='symbol'>:login</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>defunkt</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:password</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>c0d3b4ssssss!</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Set access_token instead of login and password if you use personal access token
</span><span class='comment'># client = Octokit::Client.new(:access_token => '[personal_access_token]!')
</span>
<span class='comment'># Fetch the current user
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span>
</code></pre>
<h3>Additional Query Parameters</h3>
<p>When passing additional parameters to GET based request use the following syntax:</p>
<pre class="code ruby"><code class="ruby"> <span class='comment'># query: { parameter_name: 'value' }
</span> <span class='comment'># Example: Get repository listing by owner in ascending order
</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_repos'>repos</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='label'>type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>owner</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>sort:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>asc</span><span class='tstring_end'>'</span></span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='comment'># Example: Get contents of a repository by ref
</span> <span class='comment'># https://api.github.com/repos/octokit/octokit.rb/contents/path/to/file.rb?ref=some-other-branch
</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_contents'>contents</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>octokit/octokit.rb</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>path/to/file.rb</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='label'>ref:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>some-other-branch</span><span class='tstring_end'>'</span></span><span class='rbrace'>}</span><span class='rparen'>)</span>
</code></pre>
<h3>Consuming resources</h3>
<p>Most methods return a <code>Resource</code> object which provides dot notation and <code>[]</code>
access for fields returned in the API response.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span>
<span class='comment'># Fetch a user
</span><span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>jbarnette</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
<span class='comment'># => "John Barnette"
</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span>
<span class='comment'># => <Set: {:login, :id, :gravatar_id, :type, :name, :company, :blog, :location, :email, :hireable, :bio, :public_repos, :followers, :following, :created_at, :updated_at, :public_gists}>
</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_user'>user</span><span class='lbracket'>[</span><span class='symbol'>:company</span><span class='rbracket'>]</span>
<span class='comment'># => "GitHub"
</span><span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_rels'>rels</span><span class='lbracket'>[</span><span class='symbol'>:gists</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_href'>href</span>
<span class='comment'># => "https://api.github.com/users/jbarnette/gists"
</span></code></pre>
<p><strong>Note:</strong> URL fields are culled into a separate <code>.rels</code> collection for easier
<a href="#Hypermedia_agent">Hypermedia</a> support.</p>
<h3>Accessing HTTP responses</h3>
<p>While most methods return a <code>Resource</code> object or a Boolean, sometimes you may
need access to the raw HTTP response headers. You can access the last HTTP
response with <code>Client#last_response</code>:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>andrewpthorp</span><span class='tstring_end'>'</span></span>
<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_last_response'>last_response</span>
<span class='id identifier rubyid_etag'>etag</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='symbol'>:etag</span><span class='rbracket'>]</span>
</code></pre>
<h2>Authentication</h2>
<p>Octokit supports the various <a href="http://developer.github.com/v3/#Authentication">Authentication methods supported by the GitHub
API</a>:</p>
<h3>Basic Authentication</h3>
<p>Using your GitHub username and password is the easiest way to get started
making authenticated requests:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='symbol'>:login</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>defunkt</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:password</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>c0d3b4ssssss!</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span>
<span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_login'>login</span>
<span class='comment'># => "defunkt"
</span></code></pre>
<p>While Basic Authentication allows you to get started quickly, OAuth access
tokens are the preferred way to authenticate on behalf of users.</p>
<h3>OAuth access tokens</h3>
<p><a href="http://developer.github.com/v3/oauth/">OAuth access tokens</a> provide two main benefits over using your username
and password:</p>
<ul>
<li><strong>Revokable access</strong>. Access tokens can be revoked, removing access for only
that token without having to change your password everywhere.</li>
<li><strong>Limited access</strong>. Access tokens have <a href="http://developer.github.com/v3/oauth/#scopes">access scopes</a> which allow for more
granular access to API resources. For instance, you can grant a third party
access to your gists but not your private repositories.</li>
</ul>
<p>To use an access token with the Octokit client, pass your token in the
<code>:access_token</code> options parameter in lieu of your username and password:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='symbol'>:access_token</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><your 40 char token></span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span>
<span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_login'>login</span>
<span class='comment'># => "defunkt"
</span></code></pre>
<p>You can <a href="https://help.github.com/articles/creating-an-access-token-for-command-line-use">create access tokens through your GitHub Account Settings</a>
or with a basic authenticated Octokit client:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='symbol'>:login</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>defunkt</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:password</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>c0d3b4ssssss!</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_create_authorization'>create_authorization</span><span class='lparen'>(</span><span class='symbol'>:scopes</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>user</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:note</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Name of token</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='comment'># => <your new oauth token>
</span></code></pre>
<h3>Two-Factor Authentication</h3>
<p><a href="https://help.github.com/articles/about-two-factor-Authentication">Two-Factor Authentication</a> brings added security to the account by requiring more information to login.</p>
<p>Using two-factor Authentication for API calls is as simple as adding the <a href="http://developer.github.com/v3/auth/#working-with-two-factor-Authentication">required header</a> as an option:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span> \
<span class='symbol'>:login</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>defunkt</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
<span class='symbol'>:password</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>c0d3b4ssssss!</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>defunkt</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:headers</span> <span class='op'>=></span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>X-GitHub-OTP</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><your 2FA token></span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='rparen'>)</span>
</code></pre>
<p>As you can imagine, this gets annoying quick since two-factor auth tokens are very short lived. So it is recommended to create an oauth token for the user to communicate with the API:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span> \
<span class='symbol'>:login</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>defunkt</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
<span class='symbol'>:password</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>c0d3b4ssssss!</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_create_authorization'>create_authorization</span><span class='lparen'>(</span><span class='symbol'>:scopes</span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>user</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:note</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Name of token</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='symbol'>:headers</span> <span class='op'>=></span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>X-GitHub-OTP</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><your 2FA token></span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='comment'># => <your new oauth token>
</span></code></pre>
<h3>Using a .netrc file</h3>
<p>Octokit supports reading credentials from a netrc file (defaulting to
<code>~/.netrc</code>). Given these lines in your netrc:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_machine'>machine</span> <span class='id identifier rubyid_api'>api</span><span class='period'>.</span><span class='id identifier rubyid_github'>github</span><span class='period'>.</span><span class='id identifier rubyid_com'>com</span>
<span class='id identifier rubyid_login'>login</span> <span class='id identifier rubyid_defunkt'>defunkt</span>
<span class='id identifier rubyid_password'>password</span> <span class='id identifier rubyid_c0d3b4ssssss!'>c0d3b4ssssss!</span>
</code></pre>
<p>You can now create a client with those credentials:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='symbol'>:netrc</span> <span class='op'>=></span> <span class='kw'>true</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_login'>login</span>
<span class='comment'># => "defunkt"
</span></code></pre>
<p>But <em>I want to use OAuth</em> you say. Since the GitHub API supports using an OAuth
token as a Basic password, you totally can:</p>
<pre class="code ruby"><code class="ruby">machine api.github.com
login defunkt
password <your 40 char token>
</code></pre>
<p><strong>Note:</strong> Support for netrc requires adding the <a href="https://rubygems.org/gems/netrc">netrc gem</a> to your Gemfile
or <code>.gemspec</code>.</p>
<h3>Application Authentication</h3>
<p>Octokit also supports application-only Authentication <a href="http://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications">using OAuth application client
credentials</a>. Using application credentials will result in making
anonymous API calls on behalf of an application in order to take advantage of
the higher rate limit.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span> \
<span class='symbol'>:client_id</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><your 20 char id></span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='symbol'>:client_secret</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><your 40 char secret></span><span class='tstring_end'>"</span></span>
<span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>defunkt</span><span class='tstring_end'>'</span></span>
</code></pre>
<h2>Default results per_page</h2>
<p>Default results from the GitHub API are 30, if you wish to add more you must do so during Octokit configuration.</p>
<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>access_token:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><your 40 char token></span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>per_page:</span> <span class='int'>100</span><span class='rparen'>)</span>
</code></pre>
<h2>Pagination</h2>
<p>Many GitHub API resources are <a href="http://developer.github.com/v3/#Pagination">paginated</a>. While you may be tempted to start
adding <code>:page</code> parameters to your calls, the API returns links to the next,
previous, and last pages for you in the <code>Link</code> response header as <a href="#Hypermedia_agent">Hypermedia
link relations</a>.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_issues'>issues</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_issues'>issues</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rails/rails</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_issues'>issues</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_last_response'>last_response</span><span class='period'>.</span><span class='id identifier rubyid_rels'>rels</span><span class='lbracket'>[</span><span class='symbol'>:next</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span>
</code></pre>
<h3>Auto Pagination</h3>
<p>For smallish resource lists, Octokit provides auto Pagination. When this is
enabled, calls for paginated resources will fetch and concatenate the results
from every page into a single array:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_auto_paginate'>auto_paginate</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='id identifier rubyid_issues'>issues</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_issues'>issues</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rails/rails</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_issues'>issues</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
<span class='comment'># => 702
</span></code></pre>
<p>You can also enable auto Pagination for all Octokit client instances:</p>
<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="Octokit/Configurable.html#configure-instance_method" title="Octokit::Configurable#configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_auto_paginate'>auto_paginate</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
</code></pre>
<p><strong>Note:</strong> While Octokit auto Pagination will set the page size to the maximum
<code>100</code>, and seek to not overstep your rate limit, you probably want to use a
custom pattern for traversing large lists.</p>
<h2>Working with GitHub Enterprise</h2>
<p>With a bit of setup, you can also use Octokit with your Github Enterprise instance.</p>
<h3>Interacting with the GitHub.com APIs in GitHub Enterprise</h3>
<p>To interact with the "regular" GitHub.com APIs in GitHub Enterprise, simply configure the <code>api_endpoint</code> to match your hostname. For example:</p>
<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="Octokit/Configurable.html#configure-instance_method" title="Octokit::Configurable#configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_api_endpoint'>api_endpoint</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://<hostname>/api/v3/</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='symbol'>:access_token</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><your 40 char token></span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
</code></pre>
<h3>Interacting with the GitHub Enterprise Admin APIs</h3>
<p>The GitHub Enterprise Admin APIs are under a different client: <code>EnterpriseAdminClient</code>. You'll need to have an administrator account in order to use these APIs.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_admin_client'>admin_client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/EnterpriseAdminClient.html" title="Octokit::EnterpriseAdminClient (class)">EnterpriseAdminClient</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/EnterpriseAdminClient.html#initialize-instance_method" title="Octokit::EnterpriseAdminClient#initialize (method)">new</a></span></span><span class='lparen'>(</span>
<span class='symbol'>:access_token</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><your 40 char token></span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
<span class='symbol'>:api_endpoint</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://<hostname>/api/v3/</span><span class='tstring_end'>"</span></span>
<span class='rparen'>)</span>
<span class='comment'># or
</span><span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="Octokit/Configurable.html#configure-instance_method" title="Octokit::Configurable#configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_api_endpoint'>api_endpoint</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://<hostname>/api/v3/</span><span class='tstring_end'>"</span></span>
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><your 40 char token></span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_admin_client'>admin_client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='period'>.</span><span class='id identifier rubyid_enterprise_admin_client'><span class='object_link'><a href="Octokit.html#enterprise_admin_client-class_method" title="Octokit.enterprise_admin_client (method)">enterprise_admin_client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
</code></pre>
<h3>Interacting with the GitHub Enterprise Management Console APIs</h3>
<p>The GitHub Enterprise Management Console APIs are also under a separate client: <code>EnterpriseManagementConsoleClient</code>. In order to use it, you'll need to provide both your management console password as well as the endpoint to your management console. This is different than the API endpoint provided above.</p>
<pre class="code ruby"><code class="ruby">management_console_client = Octokit::EnterpriseManagementConsoleClient.new(
:management_console_password => "secret",
:management_console_endpoint = "https://hostname:8633"
)
# or
Octokit.configure do |c|
c.management_console_endpoint = "https://hostname:8633"
c.management_console_password = "secret"
end
management_console_client = Octokit.enterprise_management_console_client.new
</code></pre>
<h3>SSL Connection Errors</h3>
<p>You <em>may</em> need to disable SSL temporarily while first setting up your GitHub Enterprise install. You can do that with the following configuration:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_connection_options'>connection_options</span><span class='lbracket'>[</span><span class='symbol'>:ssl</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:verify</span> <span class='op'>=></span> <span class='kw'>false</span> <span class='rbrace'>}</span>
</code></pre>
<p>Do remember to turn <code>:verify</code> back to <code>true</code>, as it's important for secure communication.</p>
<h2>Configuration and defaults</h2>
<p>While <code>Octokit::Client</code> accepts a range of options when creating a new client
instance, Octokit's configuration API allows you to set your configuration
options at the module level. This is particularly handy if you're creating a
number of client instances based on some shared defaults. Changing options
affects new instances only and will not modify existing <code>Octokit::Client</code>
instances created with previous options.</p>
<h3>Configuring module defaults</h3>
<p>Every writable attribute in <span class='object_link'><a href="Octokit/Configurable.html" title="Octokit::Configurable (module)">Octokit::Configurable</a></span> can be set one at a time:</p>
<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='period'>.</span><span class='id identifier rubyid_api_endpoint'><span class='object_link'><a href="Octokit/Configurable.html#api_endpoint-instance_method" title="Octokit::Configurable#api_endpoint (method)">api_endpoint</a></span></span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://api.github.dev</span><span class='tstring_end'>'</span></span>
<span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='period'>.</span><span class='id identifier rubyid_web_endpoint'><span class='object_link'><a href="Octokit/Configurable.html#web_endpoint-instance_method" title="Octokit::Configurable#web_endpoint (method)">web_endpoint</a></span></span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://github.dev</span><span class='tstring_end'>'</span></span>
</code></pre>
<p>or in batch:</p>
<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="Octokit/Configurable.html#configure-instance_method" title="Octokit::Configurable#configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_api_endpoint'>api_endpoint</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://api.github.dev</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_web_endpoint'>web_endpoint</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>http://github.dev</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
</code></pre>
<h3>Using ENV variables</h3>
<p>Default configuration values are specified in <span class='object_link'><a href="Octokit/Default.html" title="Octokit::Default (module)">Octokit::Default</a></span>. Many
attributes will look for a default value from the ENV before returning
Octokit's default.</p>
<pre class="code ruby"><code class="ruby"><span class='comment'># Given $OCTOKIT_API_ENDPOINT is "http://api.github.dev"
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_api_endpoint'>api_endpoint</span>
<span class='comment'># => "http://api.github.dev"
</span></code></pre>
<p>Deprecation warnings and API endpoints in development preview warnings are
printed to STDOUT by default, these can be disabled by setting the ENV
<code>OCTOKIT_SILENT=true</code>.</p>
<h2>Hypermedia agent</h2>
<p>Starting in version 2.0, Octokit is <a href="http://en.wikipedia.org/wiki/Hypermedia">hypermedia</a>-enabled. Under the hood,
<span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Octokit::Client</a></span> uses <a href="https://github.com/lostisland/sawyer">Sawyer</a>, a hypermedia client built on <a href="https://github.com/lostisland/faraday">Faraday</a>.</p>
<h3>Hypermedia in Octokit</h3>
<p>Resources returned by Octokit methods contain not only data but hypermedia
link relations:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>technoweenie</span><span class='tstring_end'>'</span></span>
<span class='comment'># Get the repos rel, returned from the API
</span><span class='comment'># as repos_url in the resource
</span><span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_rels'>rels</span><span class='lbracket'>[</span><span class='symbol'>:repos</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_href'>href</span>
<span class='comment'># => "https://api.github.com/users/technoweenie/repos"
</span>
<span class='id identifier rubyid_repos'>repos</span> <span class='op'>=</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_rels'>rels</span><span class='lbracket'>[</span><span class='symbol'>:repos</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span>
<span class='id identifier rubyid_repos'>repos</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
<span class='comment'># => "faraday-zeromq"
</span></code></pre>
<p>When processing API responses, all <code>*_url</code> attributes are culled in to the link
relations collection. Any <code>url</code> attribute becomes <code>.rels[:self]</code>.</p>
<h3>URI templates</h3>
<p>You might notice many link relations have variable placeholders. Octokit
supports <a href="http://tools.ietf.org/html/rfc6570">URI Templates</a> for parameterized URI expansion:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_repo'>repo</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_repo'>repo</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>pengwynn/pingwynn</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_rel'>rel</span> <span class='op'>=</span> <span class='id identifier rubyid_repo'>repo</span><span class='period'>.</span><span class='id identifier rubyid_rels'>rels</span><span class='lbracket'>[</span><span class='symbol'>:issues</span><span class='rbracket'>]</span>
<span class='comment'># => #<Sawyer::Relation: issues: get https://api.github.com/repos/pengwynn/pingwynn/issues{/number}>
</span>
<span class='comment'># Get a page of issues
</span><span class='id identifier rubyid_rel'>rel</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span>
<span class='comment'># Get issue #2
</span><span class='id identifier rubyid_rel'>rel</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='symbol'>:uri</span> <span class='op'>=></span> <span class='lbrace'>{</span><span class='symbol'>:number</span> <span class='op'>=></span> <span class='int'>2</span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span>
</code></pre>
<h3>The Full Hypermedia Experience™</h3>
<p>If you want to use Octokit as a pure hypermedia API client, you can start at
the API root and follow link relations from there:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_root'>root</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_root'>root</span>
<span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_rels'>rels</span><span class='lbracket'>[</span><span class='symbol'>:repository</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span> <span class='symbol'>:uri</span> <span class='op'>=></span> <span class='lbrace'>{</span><span class='symbol'>:owner</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>octokit</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:repo</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>octokit.rb</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_root'>root</span><span class='period'>.</span><span class='id identifier rubyid_rels'>rels</span><span class='lbracket'>[</span><span class='symbol'>:user_repositories</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span> <span class='symbol'>:uri</span> <span class='op'>=></span> <span class='lbrace'>{</span> <span class='symbol'>:user</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>octokit</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='comma'>,</span>
<span class='symbol'>:query</span> <span class='op'>=></span> <span class='lbrace'>{</span> <span class='symbol'>:type</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>owner</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
</code></pre>
<p>Octokit 3.0 aims to be hypermedia-driven, removing the internal URL
construction currently used throughout the client.</p>
<h2>Upgrading guide</h2>
<p>Version 4.0</p>
<ul>
<li><strong>removes support for a <a href="https://github.com/octokit/octokit.rb/commit/e48e91f736d5fce51e3bf74d7c9022aaa52f5c5c">long-deprecated overload</a> for
passing state as a positional argument</strong> when listing pull requests. Instead,
pass <code>state</code> in the method options.</li>
<li><strong>drops support for Ruby < 2.0</strong>.</li>
<li>adds support for new <a href="#Working_with_github_enterprise">Enterprise-only APIs</a>.</li>
<li>adds support for <a href="https://developer.github.com/changes/2015-05-26-repository-redirects-are-coming/">Repository redirects</a>.</li>
</ul>
<p>Version 3.0 includes a couple breaking changes when upgrading from v2.x.x:</p>
<p>The <a href="https://developer.github.com/changes/2014-01-07-upcoming-change-to-default-media-type/">default media type</a> is now <code>v3</code> instead of <code>beta</code>. If
you need to request the older media type, you can set the default media type
for the client:</p>
<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='period'>.</span><span class='id identifier rubyid_default_media_type'><span class='object_link'><a href="Octokit/Configurable.html#default_media_type-instance_method" title="Octokit::Configurable#default_media_type (method)">default_media_type</a></span></span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>application/vnd.github.beta+json</span><span class='tstring_end'>"</span></span>
</code></pre>
<p>or per-request</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_emails'>emails</span><span class='lparen'>(</span><span class='symbol'>:accept</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>application/vnd.github.beta+json</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
</code></pre>
<p>The long-deprecated <code>Octokit::Client#create_download</code> method has been removed.</p>
<h3>Upgrading from 1.x.x</h3>
<p>Version 2.0 includes a completely rewritten <code>Client</code> factory that now memoizes
client instances based on unique configuration options. Breaking changes also
include:</p>
<ul>
<li><code>:oauth_token</code> is now <code>:access_token</code></li>
<li><code>:auto_traversal</code> is now <code>:auto_paginate</code></li>
<li><code>Hashie::Mash</code> has been removed. Responses now return a <code>Sawyer::Resource</code>
object. This new type behaves mostly like a Ruby <code>Hash</code>, but does not fully
support the <code>Hashie::Mash</code> API.</li>
<li>Two new client error types are raised where appropriate:
<code>Octokit::TooManyRequests</code> and <code>Octokit::TooManyLoginAttempts</code></li>
<li>The <code>search_*</code> methods from v1.x are now found at <code>legacy_search_*</code></li>
<li>Support for netrc requires including the <a href="https://rubygems.org/gems/netrc">netrc gem</a> in your Gemfile or
gemspec.</li>
<li>DateTime fields are now proper <code>DateTime</code> objects. Previous versions outputted DateTime fields as 'String' objects.</li>
</ul>
<h2>Advanced usage</h2>
<p>Since Octokit employs <a href="https://github.com/lostisland/faraday">Faraday</a> under the hood, some behavior can be
extended via middleware.</p>
<h3>Debugging</h3>
<p>Often, it helps to know what Octokit is doing under the hood. You can add a
logger to the middleware that enables you to peek into the underlying HTTP
traffic:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_stack'>stack</span> <span class='op'>=</span> <span class='const'>Faraday</span><span class='op'>::</span><span class='const'>RackBuilder</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_builder'>builder</span><span class='op'>|</span>
<span class='id identifier rubyid_builder'>builder</span><span class='period'>.</span><span class='id identifier rubyid_use'>use</span> <span class='const'>Faraday</span><span class='op'>::</span><span class='const'>Request</span><span class='op'>::</span><span class='const'>Retry</span><span class='comma'>,</span> <span class='label'>exceptions:</span> <span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/ServerError.html" title="Octokit::ServerError (class)">ServerError</a></span></span><span class='rbracket'>]</span>
<span class='id identifier rubyid_builder'>builder</span><span class='period'>.</span><span class='id identifier rubyid_use'>use</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Middleware.html" title="Octokit::Middleware (module)">Middleware</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Middleware/FollowRedirects.html" title="Octokit::Middleware::FollowRedirects (class)">FollowRedirects</a></span></span>
<span class='id identifier rubyid_builder'>builder</span><span class='period'>.</span><span class='id identifier rubyid_use'>use</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'>Response</span><span class='op'>::</span><span class='const'>RaiseError</span>
<span class='id identifier rubyid_builder'>builder</span><span class='period'>.</span><span class='id identifier rubyid_use'>use</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'>Response</span><span class='op'>::</span><span class='const'>FeedParser</span>
<span class='id identifier rubyid_builder'>builder</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span> <span class='symbol'>:logger</span>
<span class='id identifier rubyid_builder'>builder</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='kw'>end</span>
<span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='period'>.</span><span class='id identifier rubyid_middleware'><span class='object_link'><a href="Octokit/Configurable.html#middleware-instance_method" title="Octokit::Configurable#middleware (method)">middleware</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_stack'>stack</span>
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Octokit/Client.html" title="Octokit::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Octokit/Client.html#initialize-instance_method" title="Octokit::Client#initialize (method)">new</a></span></span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_user'>user</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>pengwynn</span><span class='tstring_end'>'</span></span>
</code></pre>
<pre class="code ruby"><code class="ruby">I, [2013-08-22T15:54:38.583300 #88227] INFO -- : get https://api.github.com/users/pengwynn
D, [2013-08-22T15:54:38.583401 #88227] DEBUG -- request: Accept: "application/vnd.github.beta+json"
User-Agent: "Octokit Ruby Gem 2.0.0.rc4"
I, [2013-08-22T15:54:38.843313 #88227] INFO -- Status: 200
D, [2013-08-22T15:54:38.843459 #88227] DEBUG -- response: server: "GitHub.com"
date: "Thu, 22 Aug 2013 20:54:40 GMT"
content-type: "application/json; charset=utf-8"
transfer-encoding: "chunked"
connection: "close"
status: "200 OK"
x-ratelimit-limit: "60"
x-ratelimit-remaining: "39"
x-ratelimit-reset: "1377205443"
...
</code></pre>
<p>See the <a href="https://github.com/lostisland/faraday">Faraday README</a> for more middleware magic.</p>
<h3>Caching</h3>
<p>If you want to boost performance, stretch your API rate limit, or avoid paying
the hypermedia tax, you can use <a href="https://github.com/plataformatec/faraday-http-cache">Faraday Http Cache</a>.</p>
<p>Add the gem to your Gemfile</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>faraday-http-cache</span><span class='tstring_end'>'</span></span>
</code></pre>
<p>Next, construct your own Faraday middleware:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_stack'>stack</span> <span class='op'>=</span> <span class='const'>Faraday</span><span class='op'>::</span><span class='const'>RackBuilder</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_builder'>builder</span><span class='op'>|</span>
<span class='id identifier rubyid_builder'>builder</span><span class='period'>.</span><span class='id identifier rubyid_use'>use</span> <span class='const'>Faraday</span><span class='op'>::</span><span class='const'>HttpCache</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='const'>Marshal</span><span class='comma'>,</span> <span class='label'>shared_cache:</span> <span class='kw'>false</span>
<span class='id identifier rubyid_builder'>builder</span><span class='period'>.</span><span class='id identifier rubyid_use'>use</span> <span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='op'>::</span><span class='const'>Response</span><span class='op'>::</span><span class='const'>RaiseError</span>
<span class='id identifier rubyid_builder'>builder</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='kw'>end</span>
<span class='const'><span class='object_link'><a href="Octokit.html" title="Octokit (module)">Octokit</a></span></span><span class='period'>.</span><span class='id identifier rubyid_middleware'><span class='object_link'><a href="Octokit/Configurable.html#middleware-instance_method" title="Octokit::Configurable#middleware (method)">middleware</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_stack'>stack</span>
</code></pre>
<p>Once configured, the middleware will store responses in cache based on ETag
fingerprint and serve those back up for future <code>304</code> responses for the same
resource. See the <a href="https://github.com/plataformatec/faraday-http-cache">project README</a> for advanced usage.</p>
<h2>Hacking on Octokit.rb</h2>
<p>If you want to hack on Octokit locally, we try to make <a href="http://wynnnetherland.com/linked/2013012801/bootstrapping-consistency">bootstrapping the
project</a> as painless as possible. To start hacking, clone and run:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_script'>script</span><span class='op'>/</span><span class='id identifier rubyid_bootstrap'>bootstrap</span>
</code></pre>
<p>This will install project dependencies and get you up and running. If you want
to run a Ruby console to poke on Octokit, you can crank one up with:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_script'>script</span><span class='op'>/</span><span class='id identifier rubyid_console'>console</span>
</code></pre>
<p>Using the scripts in <code>./scripts</code> instead of <code>bundle exec rspec</code>, <code>bundle
console</code>, etc. ensures your dependencies are up-to-date.</p>
<h3>Running and writing new tests</h3>
<p>Octokit uses <a href="https://github.com/vcr/vcr">VCR</a> for recording and playing back API fixtures during test
runs. These cassettes (fixtures) are part of the Git project in the <code>spec/cassettes</code>
folder. If you're not recording new cassettes you can run the specs with existing
cassettes with:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_script'>script</span><span class='op'>/</span><span class='id identifier rubyid_test'>test</span>
</code></pre>
<p>Octokit uses environmental variables for storing credentials used in testing.
If you are testing an API endpoint that doesn't require Authentication, you
can get away without any additional configuration. For the most part, tests
use an authenticated client, using a token stored in <code>ENV['OCTOKIT_TEST_GITHUB_TOKEN']</code>.
There are several different authenticating method's used across the api.
Here is the full list of configurable environmental variables for testing
Octokit:</p>
<table><thead>
<tr>
<th style="text-align: left">ENV Variable</th>
<th style="text-align: left">Description</th>
</tr>
</thead><tbody>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_LOGIN</code></td>
<td style="text-align: left">GitHub login name (preferably one created specifically for testing against).</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_PASSWORD</code></td>
<td style="text-align: left">Password for the test GitHub login.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_TOKEN</code></td>
<td style="text-align: left"><a href="https://github.com/blog/1509-personal-api-tokens">Personal Access Token</a> for the test GitHub login.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_CLIENT_ID</code></td>
<td style="text-align: left">Test OAuth application client id.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_CLIENT_SECRET</code></td>
<td style="text-align: left">Test OAuth application client secret.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_REPOSITORY</code></td>
<td style="text-align: left">Test repository to perform destructive actions against, this should not be set to any repository of importance. <strong>Automatically created by the test suite if nonexistent</strong> Default: <code>api-sandbox</code></td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_ORGANIZATION</code></td>
<td style="text-align: left">Test organization.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_ENTERPRISE_LOGIN</code></td>
<td style="text-align: left">GitHub Enterprise login name.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_ENTERPRISE_TOKEN</code></td>
<td style="text-align: left">GitHub Enterprise token.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_ENTERPRISE_MANAGEMENT_CONSOLE_PASSWORD</code></td>
<td style="text-align: left">GitHub Enterprise management console password.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_ENTERPRISE_ENDPOINT</code></td>
<td style="text-align: left">GitHub Enterprise hostname.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_ENTERPRISE_MANAGEMENT_CONSOLE_ENDPOINT</code></td>
<td style="text-align: left">GitHub Enterprise Management Console endpoint.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_INTEGRATION</code></td>
<td style="text-align: left"><a href="https://developer.github.com/early-access/integrations/">GitHub Integration</a> owned by your test organization.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_GITHUB_INTEGRATION_INSTALLATION</code></td>
<td style="text-align: left">Installation of the GitHub Integration specified above.</td>
</tr>
<tr>
<td style="text-align: left"><code>OCTOKIT_TEST_INTEGRATION_PEM_KEY</code></td>
<td style="text-align: left">File path to the private key generated from your integration.</td>
</tr>
</tbody></table>
<p>Since we periodically refresh our cassettes, please keep some points in mind
when writing new specs.</p>
<ul>
<li><strong>Specs should be idempotent</strong>. The HTTP calls made during a spec should be
able to be run over and over. This means deleting a known resource prior to
creating it if the name has to be unique.</li>
<li><strong>Specs should be able to be run in random order.</strong> If a spec depends on
another resource as a fixture, make sure that's created in the scope of the
spec and not depend on a previous spec to create the data needed.</li>
<li><strong>Do not depend on authenticated user info.</strong> Instead of asserting
actual values in resources, try to assert the existence of a key or that a
response is an Array. We're testing the client, not the API.</li>
</ul>
<h2>Supported Ruby Versions</h2>
<p>This library aims to support and is <a href="https://travis-ci.org/octokit/octokit.rb">tested against</a> the following Ruby
implementations:</p>
<ul>
<li>Ruby 2.0</li>
<li>Ruby 2.1</li>
<li>Ruby 2.2</li>
<li>Ruby 2.3</li>
<li>Ruby 2.4</li>
<li>Ruby 2.5</li>
</ul>
<p>If something doesn't work on one of these Ruby versions, it's a bug.</p>
<p>This library may inadvertently work (or seem to work) on other Ruby
implementations, but support will only be provided for the versions listed
above.</p>
<p>If you would like this library to support another Ruby version, you may
volunteer to be a maintainer. Being a maintainer entails making sure all tests
run and pass on that implementation. When something breaks on your
implementation, you will be responsible for providing patches in a timely
fashion. If critical issues for a particular implementation exist at the time
of a major release, support for that Ruby version may be dropped.</p>
<h2>Versioning</h2>
<p>This library aims to adhere to <a href="http://semver.org/">Semantic Versioning 2.0.0</a>. Violations
of this scheme should be reported as bugs. Specifically, if a minor or patch
version is released that breaks backward compatibility, that version should be
immediately yanked and/or a new version should be immediately released that
restores compatibility. Breaking changes to the public API will only be
introduced with new major versions. As a result of this policy, you can (and
should) specify a dependency on this gem using the <a href="http://guides.rubygems.org/patterns/#pessimistic-version-constraint">Pessimistic Version
Constraint</a> with two digits of precision. For example:</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_spec'>spec</span><span class='period'>.</span><span class='id identifier rubyid_add_dependency'>add_dependency</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>octokit</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>~> 3.0</span><span class='tstring_end'>'</span></span>
</code></pre>
<p>The changes made between versions can be seen on the <a href="https://github.com/octokit/octokit.rb/releases">project releases page</a>.</p>
<h2>License</h2>
<p>Copyright (c) 2009-2014 Wynn Netherland, Adam Stacoviak, Erik Michaels-Ober</p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, subLicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:</p>
<p>The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
</div></div>
<div id="footer">
Generated on Thu Aug 30 11:17:17 2018 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.16 (ruby-2.5.1).
</div>
</div>
</body>
</html>