Sha256: fc6196ec3cf8ad0d331ced343a0f2a3f71538f75c267cb8cfc533eb5d0e0e957

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

# encoding: utf-8

module GithubCLI
  class Commands::Collaborators < Command

    namespace :collab

    desc 'list <user> <repo>', 'Lists collaborators'
    method_option :params, :type => :hash, :default => {},
                  :desc => 'Additional request parameters e.i per_page:100'
    def list(user, repo)
      Collaborator.all user, repo, options[:params], options[:format]
    end

    desc 'add <user> <repo> <collab>', 'Add a collaborator'
    method_option :params, :type => :hash, :default => {},
                  :desc => 'Additional request parameters e.i per_page:100'
    def add(user, repo, collab)
      Collaborator.add user, repo, collab, options[:params], options[:format]
    end

    desc 'collab <user> <repo> <collab>', 'Checks if user is a collaborator on a given repo'
    method_option :params, :type => :hash, :default => {},
                  :desc => 'Additional request parameters e.i per_page:100'
    def collab(user, repo, collab)
      Collaborator.collaborator? user, repo, collab, options[:params], options[:format]
    end

    desc 'remove <user> <repo> <id>', 'Remove a collaborator'
    method_option :params, :type => :hash, :default => {},
                  :desc => 'Additonal request parameters e.i per_page:100'
    def remove(user, repo, collab)
      Collaborator.remove user, repo, collab, options[:params]. options[:format]
    end

  end # Collaborators
end # GithubCLI

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
github_cli-0.4.0 lib/github_cli/commands/collaborators.rb
github_cli-0.3.1 lib/github_cli/commands/collaborators.rb
github_cli-0.3.0 lib/github_cli/commands/collaborators.rb