Module: Gerry::Api::Projects
- Included in:
- Client
- Defined in:
- lib/gerry/api/projects.rb
Instance Method Summary collapse
- #create_project_access(project, permissions) ⇒ Object
-
#find_project(name) ⇒ Hash
Get the projects that start with the specified prefix and accessible by the caller.
-
#get_head(project) ⇒ String
Get the symbolic HEAD ref for the specified project.
-
#project_access(project) ⇒ Object
lists the access rights for signle project.
-
#project_commit(project, commit_id) ⇒ Object
Retrieves a commit of a project.
- #project_file(project, commit_id, file_id) ⇒ Object
-
#projects ⇒ Hash
Get the projects accessible by the caller.
- #remove_project_access(project, permissions) ⇒ Object
-
#set_head(project, branch) ⇒ String
Set the symbolic HEAD ref for the specified project to point to the specified branch.
Instance Method Details
#create_project_access(project, permissions) ⇒ Object
48 49 50 51 52 53 |
# File 'lib/gerry/api/projects.rb', line 48 def create_project_access(project, ) access = { 'add' => } post("/projects/#{project}/access", access) end |
#find_project(name) ⇒ Hash
Get the projects that start with the specified prefix and accessible by the caller.
16 17 18 |
# File 'lib/gerry/api/projects.rb', line 16 def find_project(name) get("/projects/#{name}") end |
#get_head(project) ⇒ String
Get the symbolic HEAD ref for the specified project.
24 25 26 |
# File 'lib/gerry/api/projects.rb', line 24 def get_head(project) get("/projects/#{project}/HEAD") end |
#project_access(project) ⇒ Object
lists the access rights for signle project
44 45 46 |
# File 'lib/gerry/api/projects.rb', line 44 def project_access(project) get("/projects/#{project}/access") end |
#project_commit(project, commit_id) ⇒ Object
Retrieves a commit of a project.
64 65 66 |
# File 'lib/gerry/api/projects.rb', line 64 def project_commit(project, commit_id) get("/projects/#{project}/commits/#{commit_id}") end |
#project_file(project, commit_id, file_id) ⇒ Object
68 69 70 |
# File 'lib/gerry/api/projects.rb', line 68 def project_file(project, commit_id, file_id) get("/projects/#{project}/commits/#{commit_id}/files/#{file_id}/content") end |
#projects ⇒ Hash
Get the projects accessible by the caller.
7 8 9 |
# File 'lib/gerry/api/projects.rb', line 7 def projects get('/projects/') end |
#remove_project_access(project, permissions) ⇒ Object
55 56 57 58 59 60 |
# File 'lib/gerry/api/projects.rb', line 55 def remove_project_access(project, ) access = { 'remove' => } post("/projects/#{project}/access", access) end |
#set_head(project, branch) ⇒ String
Set the symbolic HEAD ref for the specified project to point to the specified branch.
34 35 36 37 38 39 40 |
# File 'lib/gerry/api/projects.rb', line 34 def set_head(project, branch) url = "/projects/#{project}/HEAD" body = { ref: 'refs/heads/' + branch } put(url, body) end |