Class: GitHelper::GitLabClient

Inherits:
Object
  • Object
show all
Defined in:
lib/git_helper/gitlab_client.rb

Instance Method Summary collapse

Instance Method Details

#accept_merge_request(project_name, merge_request_id, options) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/git_helper/gitlab_client.rb', line 18

def accept_merge_request(project_name, merge_request_id, options)
  opts_as_string = format_options(options)
  run(
    'PUT',
    "/projects/#{url_encode(project_name)}/merge_requests/#{merge_request_id}/merge#{opts_as_string}"
  )
end

#create_merge_request(project_name, options) ⇒ Object



13
14
15
16
# File 'lib/git_helper/gitlab_client.rb', line 13

def create_merge_request(project_name, options)
  opts_as_string = format_options(options)
  run('POST', "/projects/#{url_encode(project_name)}/merge_requests#{opts_as_string}")
end

#merge_request(project_name, merge_request_id) ⇒ Object



9
10
11
# File 'lib/git_helper/gitlab_client.rb', line 9

def merge_request(project_name, merge_request_id)
  run('GET', "/projects/#{url_encode(project_name)}/merge_requests/#{merge_request_id}")
end

#project(project_name) ⇒ Object



5
6
7
# File 'lib/git_helper/gitlab_client.rb', line 5

def project(project_name)
  run('GET', "/projects/#{url_encode(project_name)}")
end