Skip to content

HowToUse Repository

hirakiuc edited this page Aug 31, 2014 · 4 revisions

How To use Repository.

Repository

# get repository model.
repo = bucket.repo('owner', 'slug')

# just call `load` method if you need more attributes
repo.load

create repository

Not Emplemented Yet...

destroy

Not Implemented Yet...

association methods

pull_requests

list = repo.pull_requests

# iterate all of pull requests of the repository.
list.each do |pull_request|
  p pull_request
end

pull_request

pull_request = repo.pull_request(pull_request_id)

watchers

watchers = repo.watchers

forks

forks = repo.forks

commits

commits = repo.commits

commit

commit = repo.commit(commit_id)

branch_restrictions

restrictions = repo.branch_restrictions

branch_restriction

restriction = repo.branch_restriction(restriction_id)

diff

diff = repo.diff(spec)

spec means that A specification such as a branch name, revision, or commit SHA.

patch

patch = repo.patch(spec)

spec means that A specification such as a branch name, revision, or commit SHA.

Clone this wiki locally