class Gitlab::Client # Defines methods related to repositories. module Repositories # Gets a list of project repository tags. # # @example # Gitlab.tags(42) # Gitlab.repo_tags('gitlab') # # @param [Integer, String] project The ID or code name of a project. # @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] def tags(project, options={}) get("/projects/#{project}/repository/tags", :query => options) end alias :repo_tags :tags # Gets a list of project repositiory branches. # # @example # Gitlab.branches(42) # Gitlab.repo_branches('gitlab') # # @param [Integer, String] project The ID or code name of a project. # @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] def branches(project, options={}) get("/projects/#{project}/repository/branches", :query => options) end alias :repo_branches :branches # Gets information about a repository branch. # # @example # Gitlab.branch(3, 'api') # Gitlab.repo_branch(5, 'master') # # @param [Integer, String] project The ID or code name of a project. # @param [String] branch The name of the branch. # @return [Gitlab::ObjectifiedHash] def branch(project, branch) get("/projects/#{project}/repository/branches/#{branch}") end alias :repo_branch :branch # Gets a list of project commits. # # @example # Gitlab.commits('viking') # Gitlab.repo_commits('gitlab', :ref_name => 'api') # # @param [String] project The name of a project. # @param [Hash] options A customizable set of options. # @option options [String] :ref_name The branch or tag name of a project repository. # @option options [Integer] :page The page number. # @option options [Integer] :per_page The number of results per page. # @return [Array] def commits(project, options={}) get("/projects/#{project}/repository/commits", :query => options) end alias :repo_commits :commits end end