Class: Bitbucket::Repository
- Inherits:
-
Base
- Object
- Base
- Bitbucket::Repository
show all
- Defined in:
- lib/bitbucket/repository.rb
Instance Attribute Summary
Attributes inherited from Base
#access_token
Instance Method Summary
collapse
Methods inherited from Base
#delete, #get, #initialize, #post
Instance Method Details
#create(reponame, is_private = true, scm = 'git') ⇒ Object
10
11
12
13
14
15
16
17
|
# File 'lib/bitbucket/repository.rb', line 10
def create reponame, is_private = true, scm = 'git'
data = {
name: reponame,
scm: scm,
is_private: is_private ? 'True' : 'False',
}
self.post("/api/1.0/repositories/", data)
end
|
#destroy(username, reponame) ⇒ Object
19
20
21
|
# File 'lib/bitbucket/repository.rb', line 19
def destroy username, reponame
self.delete("/api/1.0/repositories/#{username}/#{reponame}/")
end
|
#repositories ⇒ Object
2
3
4
|
# File 'lib/bitbucket/repository.rb', line 2
def repositories
self.get('/api/1.0/user/repositories/')
end
|
#repository(username, reponame) ⇒ Object
6
7
8
|
# File 'lib/bitbucket/repository.rb', line 6
def repository username, reponame
self.get("/api/1.0/repositories/#{username}/#{reponame}/")
end
|