Module: Gitlab::Client::Repositories
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/repositories.rb
Overview
Defines methods related to repositories.
Instance Method Summary collapse
-
#compare(project, from, to) ⇒ Gitlab::ObjectifiedHash
(also: #repo_compare)
Compares branches, tags or commits.
-
#create_tag(project, tag_name, ref, message = '') ⇒ Gitlab::ObjectifiedHash
(also: #repo_create_tag)
Creates a new project repository tag.
-
#file_contents(project, filepath, ref = 'master') ⇒ String
(also: #repo_file_contents)
Get the contents of a file.
-
#tags(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
(also: #repo_tags)
Gets a list of project repository tags.
-
#tree(project, options = {}) ⇒ Gitlab::ObjectifiedHash
(also: #repo_tree)
Get file tree project (root level).
Instance Method Details
#compare(project, from, to) ⇒ Gitlab::ObjectifiedHash Also known as: repo_compare
Compares branches, tags or commits.
81 82 83 |
# File 'lib/gitlab/client/repositories.rb', line 81 def compare(project, from, to) get("/projects/#{project}/repository/compare", :query => {:from => from, :to => to}) end |
#create_tag(project, tag_name, ref, message = '') ⇒ Gitlab::ObjectifiedHash Also known as: repo_create_tag
Creates a new project repository tag.
31 32 33 |
# File 'lib/gitlab/client/repositories.rb', line 31 def create_tag(project, tag_name, ref, ='') post("/projects/#{project}/repository/tags", body: {tag_name: tag_name, ref: ref, message: }) end |
#file_contents(project, filepath, ref = 'master') ⇒ String Also known as: repo_file_contents
Get the contents of a file
46 47 48 49 50 51 52 |
# File 'lib/gitlab/client/repositories.rb', line 46 def file_contents(project, filepath, ref = 'master') ref = URI.encode(ref, /\W/) get "/projects/#{project}/repository/blobs/#{ref}?filepath=#{filepath}", format: nil, headers: { Accept: 'text/plain' }, parser: ::Gitlab::Request::Parser end |
#tags(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash> Also known as:
Gets a list of project repository tags.
15 16 17 |
# File 'lib/gitlab/client/repositories.rb', line 15 def (project, ={}) get("/projects/#{project}/repository/tags", :query => ) end |
#tree(project, options = {}) ⇒ Gitlab::ObjectifiedHash Also known as: repo_tree
Get file tree project (root level).
66 67 68 |
# File 'lib/gitlab/client/repositories.rb', line 66 def tree(project, ={}) get("/projects/#{project}/repository/tree", query: ) end |