lib/gitlab/client/repositories.rb in gitlab-3.5.0 vs lib/gitlab/client/repositories.rb in gitlab-3.6.0
- old
+ new
@@ -11,11 +11,11 @@
# @param [Hash] options A customizable set of options.
# @option options [Integer] :page The page number.
# @option options [Integer] :per_page The number of results per page.
# @return [Array<Gitlab::ObjectifiedHash>]
def tags(project, options={})
- get("/projects/#{project}/repository/tags", :query => options)
+ get("/projects/#{project}/repository/tags", query: options)
end
alias_method :repo_tags, :tags
# Creates a new project repository tag.
#
@@ -27,11 +27,11 @@
# @param [String] tag_name The name of the new tag.
# @param [String] ref The ref (commit sha, branch name, or another tag) the tag will point to.
# @param [String] message Optional message for tag, creates annotated tag if specified.
# @return [Gitlab::ObjectifiedHash]
def create_tag(project, tag_name, ref, message='')
- post("/projects/#{project}/repository/tags", body: {tag_name: tag_name, ref: ref, message: message})
+ post("/projects/#{project}/repository/tags", body: { tag_name: tag_name, ref: ref, message: message })
end
alias_method :repo_create_tag, :create_tag
# Get the contents of a file
#
@@ -41,16 +41,16 @@
#
# @param [Integer] project The ID of a project.
# @param [String] filepath The relative path of the file in the repository
# @param [String] ref The name of a repository branch or tag or if not given the default branch.
# @return [String]
- def file_contents(project, filepath, ref = 'master')
+ 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
+ format: nil,
+ headers: { Accept: 'text/plain' },
+ parser: ::Gitlab::Request::Parser
end
alias_method :repo_file_contents, :file_contents
# Get file tree project (root level).
#
@@ -77,10 +77,10 @@
# @param [Integer] project The ID of a project.
# @param [String] from The commit SHA or branch name of from branch.
# @param [String] to The commit SHA or branch name of to branch.
# @return [Gitlab::ObjectifiedHash]
def compare(project, from, to)
- get("/projects/#{project}/repository/compare", :query => {:from => from, :to => to})
+ get("/projects/#{project}/repository/compare", query: { from: from, to: to })
end
alias_method :repo_compare, :compare
end
end