Class | GitHub::Repo |
In: |
lib/git_hub/repo.rb
|
Parent: | GitHub::Base |
GITHUB_SERVICES | = | { #[github] # user = user # token = token # :donate => {:path => '/edit/donate', :inputs => ['paypal']} # homepage = homepage_url # webhooks => {:path => '/edit/postreceive_urls', :fields => [] #http://rdoc.info/projects/update, http://runcoderun.com/github, http://api.devver.net/github # basecamp = url, username, password, project, category # cia = true # campfire = subdomain, username, password, room, ssl, play_sound # email = arvitallian@gmail.com # fogbugz = cvssubmit_url, fb_version, fb_repoid # friendfeed = nickname, remotekey # irc = server, port, room, password, nick, ssl # jabber = user # lighthouse = subdomain, project_id, token, private # presently = subdomain, group_name, username, password # rubyforge = username, password, grupid # runcoderun = true # trac = url, token # twitter = username, password, digest } |
watchers= | -> | followers= |
watchers | -> | followers |
owner= | -> | username= |
owner | -> | username |
find | -> | show |
find | -> | search |
created | [RW] | |
description | [RW] | |
fork | [RW] | |
forks | [RW] | |
homepage | [RW] | |
id | [RW] | |
language | [RW] | |
name | [RW] | |
open_issues | [RW] | |
owner | [RW] | |
private | [RW] | |
pushed | [RW] | |
score | [RW] | |
size | [RW] | |
type | [RW] | |
url | [RW] | |
watchers | [RW] |
Create new github repo, accepts Hash with :repo, :description, :homepage, :public/:private or repo name as a single parameter
# File lib/git_hub/repo.rb, line 82 def create(opts) repo = opts[:repo] || opts[:repository] || opts[:name] || opts[:project] description = opts[:description] || opts[:descr] || opts[:desc] homepage = opts[:homepage] public = opts[:public] || !opts[:private] # default to true ensure_auth opts convert_to_repo post("/create", 'name' => repo, 'description' => description, 'homepage' => homepage, 'public' => (public ? 1 : 0)) end
Find repo(s) of a (valid) github user. Accepts Hash with keys:
:owner/:user/:username: | Github user name |
:repo/:repository/:project/:name: | Repo name |
:query/:search: | Array of search terms as Strings or Symbols |
# File lib/git_hub/repo.rb, line 65 def find(opts) if opts[:query] query = opts[:query].map(&:to_s).join('+') path = "/search/#{query}" else owner = opts[:owner] || opts[:user] || opts[:username] || opts[:login] || api.auth['login'] || '' repo = opts[:repo] || opts[:repository] || opts[:name] || opts[:project] path = repo ? "/show/#{owner}/#{repo}" : "/show/#{owner}" end convert_to_repo get(path) end
# File lib/git_hub/repo.rb, line 33 def initialize options super raise "Unable to initialize #{self.class} without name" unless @name @url ||= "http://github.com/#{@owner}/#{@name}" @type ||= "repo" end
# File lib/git_hub/repo.rb, line 53 def clone_url url = private? || api.auth['login'] == self.owner ? "git@github.com:" : "git://github.com/" url += "#{self.owner}/#{self.name}.git" end