-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #8.
- Loading branch information
Showing
28 changed files
with
205 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,69 @@ | ||
# octopussy | ||
|
||
<img src='http://upload.wikimedia.org/wikipedia/en/b/bb/007Octopussyposter.jpg' style='float: right; margin: 0 0 10px 10px'/> | ||
|
||
Octokit | ||
======= | ||
Simple Ruby wrapper for the GitHub v2 API. | ||
|
||
## Installation | ||
|
||
sudo gem install octopussy | ||
Installation | ||
------------ | ||
gem install octokit | ||
|
||
## Some examples | ||
Some examples | ||
------------- | ||
|
||
### Show a user | ||
|
||
Octopussy.user('pengwynn') | ||
Octokit.user('pengwynn') | ||
=> <#Hashie::Mash blog="http://wynnnetherland.com" company="Orrka" created_at="2008/02/25 10:24:19 -0800" email="wynn.netherland@gmail.com" followers_count=21 following_count=55 id=865 location="Dallas, TX" login="pengwynn" name="Wynn Netherland" public_gist_count=4 public_repo_count=16> | ||
|
||
### Show who a user follows | ||
|
||
Octopussy.following('pengwynn') | ||
Octokit.following('pengwynn') | ||
=> ["cglee", "bryansray", "rails", "zachinglis", "wycats", "obie", "mully", "squeejee", "jderrett", "Shopify", "ReinH", "technoweenie", "errfree", "defunkt", "joshsusser", "hashrocket", "newbamboo", "bigtiger", "github", "jamis", "jeresig", "thoughtbot", "therealadam", "jnunemaker", "seaofclouds", "choan", "llimllib", "kwhinnery", "marshall", "handcrafted", "adamstac", "jashkenas", "dan", "remy", "hayesdavis", "documentcloud", "imathis", "mdeiters", "njonsson", "asenchi", "mattsa", "marclove", "webiest", "brogers", "polomasta", "stephp", "mchelen", "piyush", "davidnorth", "rmetzler", "jferris", "madrobby", "zh", "erikvold", "desandro"] | ||
|
||
## Working with repositories | ||
|
||
Working with repositories | ||
------------------------- | ||
For convenience, methods that require a repo argument may be passed in any of the following forms | ||
|
||
* "pengwynn/linked" | ||
* {:username => 'pengwynn', :name => 'linkedin'} | ||
* {:username => 'pengwynn', :repo => 'linkedin'} | ||
* instance of Repo | ||
* instance of Repository | ||
|
||
### Show a repo | ||
|
||
Octopussy.repo("pengwynn/linkedin") | ||
Octokit.repo("pengwynn/linkedin") | ||
=> <#Hashie::Mash description="Ruby wrapper for the LinkedIn API" fork=false forks=1 homepage="http://bit.ly/ruby-linkedin" name="linkedin" open_issues=2 owner="pengwynn" private=false url="http://github.com/pengwynn/linkedin" watchers=36> | ||
|
||
## Authenticated requests | ||
|
||
Authenticated requests | ||
---------------------- | ||
Some methods require authentication so you'll need to pass a login and an api_token. You can find your GitHub API token on your [account page](https://github.com/account) | ||
|
||
client = Octopussy::Client.new(:login => 'pengwynn', :token => 'OU812') | ||
client = Octokit::Client.new(:login => 'pengwynn', :token => 'OU812') | ||
client.follow!('adamstac') | ||
|
||
Read the full [docs](http://rdoc.info/projects/pengwynn/octopussy) or check out the [examples](http://github.com/pengwynn/octopussy/tree/master/examples) | ||
|
||
## TODO | ||
Read the full [docs](http://rdoc.info/projects/pengwynn/octokit) | ||
|
||
TODO | ||
---- | ||
* Feed parsing | ||
* More examples | ||
|
||
## Note on Patches/Pull Requests | ||
|
||
* Fork the project. | ||
* Make your feature addition or bug fix. | ||
* Add tests for it. This is important so I don't break it in a | ||
future version unintentionally. | ||
* Commit, do not mess with rakefile, version, or history. | ||
(if you want to have your own version, that is fine but | ||
bump version in a commit by itself I can ignore when I pull) | ||
* Send me a pull request. Bonus points for topic branches. | ||
|
||
## Credits | ||
|
||
Octopussy is inspired by [Octopi](http://github.com/fcoury/octopi) and aims to be a lightweight, less active-resourcey alternative. | ||
|
||
## Copyright | ||
|
||
Copyright (c) 2009 [Wynn Netherland](http://wynnnetherland.com), [Adam Stacoviak](http://adamstacoviak.com/). See LICENSE for details. | ||
Submitting a Pull Request | ||
------------------------- | ||
1. Fork the project. | ||
2. Create a topic branch. | ||
3. Implement your feature or bug fix. | ||
4. Add documentation for your feature or bug fix. | ||
5. Run <tt>bundle exec rake doc:yard</tt>. If your changes are not 100% documented, go back to step 4. | ||
6. Add specs for your feature or bug fix. | ||
7. Run <tt>bundle exec rake spec</tt>. If your changes are not 100% covered, go back to step 6. | ||
8. Commit and push your changes. | ||
9. Submit a pull request. Please do not include changes to the version or gemspec. (If you want to create your own version for some reason, please do so in a separate commit.) | ||
|
||
Credits | ||
------- | ||
Octokit is inspired by [Octopi](http://github.com/fcoury/octopi) and aims to be a lightweight, less active-resourcey alternative. | ||
|
||
Copyright | ||
--------- | ||
Copyright (c) 2011 [Wynn Netherland](http://wynnnetherland.com), [Adam Stacoviak](http://adamstacoviak.com/), [Erik Michaels-Ober](https://github.com/sferik). | ||
See [LICENSE](https://github.com/pengwynn/octokit/blob/master/LICENSE) for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require File.expand_path('../event', __FILE__) | ||
require File.expand_path('../repository', __FILE__) | ||
Dir[File.expand_path('../client/*.rb', __FILE__)].each{|file| require file} | ||
|
||
module Octokit | ||
class Client | ||
attr_accessor *Configuration::VALID_OPTIONS_KEYS | ||
|
||
def initialize(options={}) | ||
options = Octokit.options.merge(options) | ||
Configuration::VALID_OPTIONS_KEYS.each do |key| | ||
send("#{key}=", options[key]) | ||
end | ||
end | ||
|
||
include Octokit::Client::Authentication | ||
include Octokit::Client::Connection | ||
include Octokit::Client::Request | ||
|
||
include Octokit::Client::Commits | ||
include Octokit::Client::Issues | ||
include Octokit::Client::Network | ||
include Octokit::Client::Objects | ||
include Octokit::Client::Organizations | ||
include Octokit::Client::Pulls | ||
include Octokit::Client::Repositories | ||
include Octokit::Client::Timelines | ||
include Octokit::Client::Users | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
lib/octopussy/client/authentication.rb → lib/octokit/client/authentication.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Client | ||
module Authentication | ||
def authentication | ||
|
2 changes: 1 addition & 1 deletion
2
lib/octopussy/client/commits.rb → lib/octokit/client/commits.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Client | ||
module Commits | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
lib/octopussy/client/connection.rb → lib/octokit/client/connection.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Client | ||
module Issues | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
lib/octopussy/client/network.rb → lib/octokit/client/network.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Client | ||
module Network | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
lib/octopussy/client/objects.rb → lib/octokit/client/objects.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Client | ||
module Objects | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
lib/octopussy/client/organizations.rb → lib/octokit/client/organizations.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Client | ||
module Organizations | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Client | ||
module Pulls | ||
def create_pull_request(repo, options={}) | ||
|
2 changes: 1 addition & 1 deletion
2
lib/octopussy/client/repositories.rb → lib/octokit/client/repositories.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Client | ||
module Repositories | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
lib/octopussy/client/request.rb → lib/octokit/client/request.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/octopussy/client/timelines.rb → lib/octokit/client/timelines.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Client | ||
module Timelines | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Client | ||
module Users | ||
EMAIL_RE = /[\w.!#\$%+-]+@[\w-]+(?:\.[\w-]+)+/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Octopussy | ||
module Octokit | ||
class Event | ||
|
||
def self.load_from_atom(entry) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
require 'addressable/uri' | ||
|
||
module Octopussy | ||
module Octokit | ||
class Repository | ||
attr_accessor :username, :name | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Octokit | ||
VERSION = "0.3.0".freeze unless defined?(Octokit::VERSION) | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.