Sha256: 963a11f387654b7cb4ce79392b655b97aba3b0c581c1380ef96be4046f935732

Contents?: true

Size: 1.72 KB

Versions: 3

Compression:

Stored size: 1.72 KB

Contents

# encoding: utf-8

module GithubCLI
  class Commands::Keys < Command

    namespace :key

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

    desc 'get <user> <repo> <id>', 'Get a key'
    method_option :params, :type => :hash, :default => {},
                  :desc => 'Additional request parameters e.i per_page:100'
    def get(user, repo, id)
      Key.get user, repo, id, options[:params], options[:format]
    end

    desc 'create <user> <repo>', 'Create a new key'
    long_desc <<-DESC
      Inputs

      title - Required string. \n
      key - Required string.
    DESC
    method_option :params, :type => :hash, :default => {},
                  :desc => 'Additonal request parameters e.i per_page:100'
    def create(user, repo)
      Key.create user, repo, options[:params], options[:format]
    end

    desc 'edit <user> <repo> <id>', 'Edit a key'
    long_desc <<-DESC
      Inputs

      title - Required string. \n
      key - Required string.
    DESC
    method_option :params, :type => :hash, :default => {},
                  :desc => 'Additonal request parameters e.i per_page:100'
    def edit(user, repo, id)
      Key.edit user, repo, id, options[:params], options[:format]
    end

    desc 'delete <user> <repo> <id>', 'Delete a key'
    method_option :params, :type => :hash, :default => {},
                  :desc => 'Additonal request parameters e.i per_page:100'
    def delete(user, repo, id)
      Key.delete user, repo, id, options[:params], options[:format]
    end

  end # Keys
end # GithubCLI

Version data entries

3 entries across 3 versions & 1 rubygems

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