Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
NARKOZ committed Mar 9, 2015
1 parent 468c10a commit f6532d5
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 3 deletions.
16 changes: 16 additions & 0 deletions lib/gitlab/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
class Gitlab::CLI
extend Helpers

# Start a new CLI session.
#
# @example
# Gitlab::CLI.start(['help'])
# Gitlab::CLI.start(['help', 'issues'])
#
# @param [Array] args The command and it's optional arguments.
def self.start(args)
command = args.shift.strip rescue 'help'
run(command, args)
end

# Processes a CLI command and outputs a result to the stream (stdout).
#
# @example
# Gitlab::CLI.run('help')
# Gitlab::CLI.run('help', ['issues'])
#
# @param [String] cmd The name of a command.
# @param [Array] args The optional arguments for a command.
# @return [nil]
def self.run(cmd, args=[])
case cmd
when 'help'
Expand Down
2 changes: 1 addition & 1 deletion lib/gitlab/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Client < API
include Branches
include Groups
include Issues
include Labels
include MergeRequests
include Milestones
include Notes
Expand All @@ -15,6 +16,5 @@ class Client < API
include Snippets
include SystemHooks
include Users
include Labels
end
end
3 changes: 2 additions & 1 deletion lib/gitlab/client/branches.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Gitlab::Client
# Defines methods related to repositories.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/branches.md
module Branches
# Gets a list of project repositiory branches.
#
Expand Down Expand Up @@ -28,7 +29,7 @@ def branches(project, options={})
def branch(project, branch)
get("/projects/#{project}/repository/branches/#{branch}")
end

alias_method :repo_branch, :branch

# Protects a repository branch.
Expand Down
1 change: 1 addition & 0 deletions lib/gitlab/client/groups.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Gitlab::Client
# Defines methods related to groups.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md
module Groups
# Gets a list of groups.
#
Expand Down
1 change: 1 addition & 0 deletions lib/gitlab/client/issues.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Gitlab::Client
# Defines methods related to issues.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md
module Issues
# Gets a list of user's issues.
# Will return a list of project's issues if project ID passed.
Expand Down
2 changes: 2 additions & 0 deletions lib/gitlab/client/labels.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class Gitlab::Client
# Defines methods related to labels.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/labels.md
module Labels
# Gets a list of project's labels.
#
Expand Down
1 change: 1 addition & 0 deletions lib/gitlab/client/merge_requests.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Gitlab::Client
# Defines methods related to merge requests.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/merge_requests.md
module MergeRequests
# Gets a list of project merge requests.
#
Expand Down
3 changes: 2 additions & 1 deletion lib/gitlab/client/milestones.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Gitlab::Client
# Defines methods related to milestones.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/milestones.md
module Milestones
# Gets a list of project's milestones.
#
Expand All @@ -26,7 +27,7 @@ def milestones(project, options={})
def milestone(project, id)
get("/projects/#{project}/milestones/#{id}")
end

# Gets the issues of a given milestone.
#
# @example
Expand Down
1 change: 1 addition & 0 deletions lib/gitlab/client/notes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Gitlab::Client
# Defines methods related to notes.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/notes.md
module Notes
# Gets a list of projects notes.
#
Expand Down
1 change: 1 addition & 0 deletions lib/gitlab/client/projects.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Gitlab::Client
# Defines methods related to projects.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md
module Projects
# Gets a list of projects owned by the authenticated user.
#
Expand Down
1 change: 1 addition & 0 deletions lib/gitlab/client/repositories.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Gitlab::Client
# Defines methods related to repositories.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/repositories.md
module Repositories
# Gets a list of project repository tags.
#
Expand Down
1 change: 1 addition & 0 deletions lib/gitlab/client/repository_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class Gitlab::Client
# Defines methods related to repository files.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/repository_files.md
module RepositoryFiles
# Creates a new repository file.
#
Expand Down
1 change: 1 addition & 0 deletions lib/gitlab/client/snippets.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Gitlab::Client
# Defines methods related to snippets.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/project_snippets.md
module Snippets
# Gets a list of project's snippets.
#
Expand Down
1 change: 1 addition & 0 deletions lib/gitlab/client/system_hooks.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Gitlab::Client
# Defines methods related to system hooks.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/system_hooks.md
module SystemHooks
# Gets a list of system hooks.
#
Expand Down
2 changes: 2 additions & 0 deletions lib/gitlab/client/users.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
class Gitlab::Client
# Defines methods related to users.
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/users.md
# @see https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/session.md
module Users
# Gets a list of users.
#
Expand Down

0 comments on commit f6532d5

Please sign in to comment.