Module: Gerry::Client::Projects
- Included in:
- Gerry::Client
- Defined in:
- lib/gerry/client/projects.rb
Instance Method Summary collapse
-
#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.
-
#projects ⇒ Hash
Get the projects accessible by the caller.
-
#set_head(project, branch) ⇒ String
Set the symbolic HEAD ref for the specified project to point to the specified branch.
Instance Method Details
#find_project(name) ⇒ Hash
Get the projects that start with the specified prefix and accessible by the caller.
16 17 18 |
# File 'lib/gerry/client/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/client/projects.rb', line 24 def get_head(project) get("/projects/#{project}/HEAD") end |
#projects ⇒ Hash
Get the projects accessible by the caller.
7 8 9 |
# File 'lib/gerry/client/projects.rb', line 7 def projects get('/projects/') 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/client/projects.rb', line 34 def set_head(project, branch) url = "/projects/#{project}/HEAD" body = { ref: 'refs/heads/' + branch } put(url, body) end |