Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 105 lines (79 sloc) 5.423 kB
b240710 @sferik Condense build status and dependency status [ci skip]
sferik authored
1 # Octokit [![Build Status](https://secure.travis-ci.org/pengwynn/octokit.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/pengwynn/octokit.png?travis)][gemnasium]
d77d774 @paulmillr Add "v3" to README.
paulmillr authored
2 Simple Ruby wrapper for the GitHub v2 & v3 API.
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
3
5fce6ae @sferik Make status images more consistent [ci skip]
sferik authored
4 [travis]: http://travis-ci.org/pengwynn/octokit
ec78d11 @sferik Add dependency status [ci skip]
sferik authored
5 [gemnasium]: https://gemnasium.com/pengwynn/octokit
6
b240710 @sferik Condense build status and dependency status [ci skip]
sferik authored
7 ## <a name="installation"></a>Installation
8 gem install octokit
9
0448b10 @sferik Don't wrap text in anchors [ci skip]
sferik authored
10 ## <a name="documentation"></a>Documentation
67c9f48 @sferik Reformat [ci skip]
sferik authored
11 [http://rdoc.info/gems/octokit][documentation]
12
13 [documentation]: http://rdoc.info/gems/octokit
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
14
0448b10 @sferik Don't wrap text in anchors [ci skip]
sferik authored
15 ## <a name="examples"></a>Examples
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
16 ### Show a user
17 Octokit.user("sferik")
695dc8a @sferik Correctly show response as a Rash (not a Mash)
sferik authored
18 => <#Hashie::Rash blog="http://twitter.com/sferik" company="Code for America" created_at="2008/05/14 13:36:12 -0700" email="sferik@gmail.com" followers_count=177 following_count=83 gravatar_id="1f74b13f1e5c6c69cb5d7fbaabb1e2cb" id=10308 location="San Francisco" login="sferik" name="Erik Michaels-Ober" permission=nil public_gist_count=16 public_repo_count=30 type="User">
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
19
20 ### Show who a user follows
21 Octokit.following("sferik")
22 => ["rails", "puls", "wycats", "dhh", "jm3", "joshsusser", "nkallen", "technoweenie", "blaine", "al3x", "defunkt", "schacon", "bmizerany", "rtomayko", "jpr5", "lholden", "140proof", "ephramzerb", "carlhuda", "carllerche", "jnunemaker", "josh", "hoverbird", "jamiew", "jeremyevans", "brynary", "mojodna", "mojombo", "joshbuddy", "igrigorik", "perplexes", "joearasin", "hassox", "nickmarden", "pengwynn", "mmcgrana", "reddavis", "reinh", "mzsanford", "aanand", "pjhyett", "kneath", "tekkub", "adamstac", "timtrueman", "aaronblohowiak", "josevalim", "kaapa", "hurrycane", "jackdempsey", "drogus", "cameronpriest", "danmelton", "marcel", "r", "atmos", "mbleigh", "isaacs", "maxogden", "codeforamerica", "chadk", "laserlemon", "gruber", "lsegal", "bblimke", "wayneeseguin", "brixen", "dkubb", "bhb", "bcardarella", "elliottcable", "fbjork", "mlightner", "dianakimball", "amerine", "danchoi", "develop", "dmfrancisco", "unruthless", "trotter", "hannestyden", "codahale", "ry"]
23
24 ### Repositories
25 For convenience, methods that require a repoistory argument may be passed in any of the following forms:
26
27 * "pengwynn/octokit"
28 * {:username => "pengwynn", :name => "octokit"}
29 * {:username => "pengwynn", :repo => "octokit"}
30 * instance of `Repository`
31
32 Octokit.repo("pengwynn/octokit")
695dc8a @sferik Correctly show response as a Rash (not a Mash)
sferik authored
33 => <#Hashie::Rash created_at="2009/12/10 13:41:49 -0800" description="Simple Ruby wrapper for the GitHub v2 API and feeds" fork=false forks=25 has_downloads=true has_issues=true has_wiki=true homepage="http://wynnnetherland.com/projects/octokit" integrate_branch="master" language="Ruby" name="octokit" open_issues=8 owner="pengwynn" private=false pushed_at="2011/05/05 10:48:57 -0700" size=1804 url="https://github.com/pengwynn/octokit" watchers=92>
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
34
0448b10 @sferik Don't wrap text in anchors [ci skip]
sferik authored
35 ## <a name="authenticated_requests"></a>Authenticated Requests
32c6aa1 @sferik Update README to reflect removal of deprecated API token auth
sferik authored
36 For methods that require authentication, you'll need to setup a client with
37 your login and password.
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
38
32c6aa1 @sferik Update README to reflect removal of deprecated API token auth
sferik authored
39 client = Octokit::Client.new(:login => "me", :password => "sekret")
40 client.follow!("sferik")
41
42 Alternately, you can authenticate with a GitHub OAuth2 token. Note: this is
67c9f48 @sferik Reformat [ci skip]
sferik authored
43 **NOT** the GitHub API token on your [account page][account].
44
45 [account]: https://github.com/account
32c6aa1 @sferik Update README to reflect removal of deprecated API token auth
sferik authored
46
47 client = Octokit::Client.new(:login => "me", :oauth_token => "oauth2token")
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
48 client.follow!("sferik")
49
0448b10 @sferik Don't wrap text in anchors [ci skip]
sferik authored
50 ## <a name="pulls"></a>Submitting a Pull Request
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
51 1. Fork the project.
52 2. Create a topic branch.
53 3. Implement your feature or bug fix.
54 4. Add documentation for your feature or bug fix.
67c9f48 @sferik Reformat [ci skip]
sferik authored
55 5. Run `bundle exec rake doc:yard`. If your changes are not 100% documented, go
56 back to step 4.
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
57 6. Add specs for your feature or bug fix.
67c9f48 @sferik Reformat [ci skip]
sferik authored
58 7. Run `bundle exec rake spec`. If your changes are not 100% covered, go back
59 to step 6.
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
60 8. Commit and push your changes.
67c9f48 @sferik Reformat [ci skip]
sferik authored
61 9. Submit a pull request. Please do not include changes to the version or
62 gemspec. (If you want to create your own version for some reason, please do
63 so in a separate commit.)
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
64
0448b10 @sferik Don't wrap text in anchors [ci skip]
sferik authored
65 ## <a name="versions"></a>Supported Ruby Versions
5fce6ae @sferik Make status images more consistent [ci skip]
sferik authored
66 This library aims to support and is [tested against][travis] the following Ruby
3135e36 @sferik Add section on Supported Rubies
sferik authored
67 implementations:
68
69 * Ruby 1.8.7
70 * Ruby 1.9.2
ec78d11 @sferik Add dependency status [ci skip]
sferik authored
71 * Ruby 1.9.3
67c9f48 @sferik Reformat [ci skip]
sferik authored
72 * [JRuby][]
73 * [Rubinius][]
74 * [Ruby Enterprise Edition][ree]
75
76 [jruby]: http://www.jruby.org/
77 [rubinius]: http://rubini.us/
78 [ree]: http://www.rubyenterpriseedition.com/
3135e36 @sferik Add section on Supported Rubies
sferik authored
79
80 If something doesn't work on one of these interpreters, it should be considered
81 a bug.
82
83 This library may inadvertently work (or seem to work) on other Ruby
84 implementations, however support will only be provided for the versions listed
85 above.
86
87 If you would like this library to support another Ruby version, you may
88 volunteer to be a maintainer. Being a maintainer entails making sure all tests
89 run and pass on that implementation. When something breaks on your
90 implementation, you will be personally responsible for providing patches in a
91 timely fashion. If critical issues for a particular implementation exist at the
92 time of a major release, support for that Ruby version may be dropped.
93
0448b10 @sferik Don't wrap text in anchors [ci skip]
sferik authored
94 ## <a name="inspiration"></a>Inspiration
67c9f48 @sferik Reformat [ci skip]
sferik authored
95 Octokit was inspired by [Octopi][] and aims to be a lightweight,
96 less-ActiveResourcey alternative.
97
98 [octopi]: https://github.com/fcoury/octopi
3d56c37 @sferik Replace manual changelog with links to compare views
sferik authored
99
0448b10 @sferik Don't wrap text in anchors [ci skip]
sferik authored
100 ## <a name="copyright"></a>Copyright
67c9f48 @sferik Reformat [ci skip]
sferik authored
101 Copyright (c) 2011 Wynn Netherland, Adam Stacoviak, Erik Michaels-Ober. See
102 [LICENSE][] for details.
103
104 [license]: https://github.com/pengwynn/octokit/blob/master/LICENSE
Something went wrong with that request. Please try again.