Sha256: 0e872caec930f4358b38e838391a864dda29e35970b028be30372ca824bf9196

Contents?: true

Size: 1.71 KB

Versions: 3

Compression:

Stored size: 1.71 KB

Contents

# encoding: utf-8

module GithubCLI
  class Commands::Starring < Command

    namespace :star

    desc 'list <user> <repo>', 'Lists stargazers'
    def list(user, repo)
      global_options = options.dup
      params = options[:params].dup
      Util.hash_without!(global_options, params.keys + ['params'])
      Starring.list user, repo, params, global_options
    end

    desc 'starred', 'Lists repos being starred by a user'
    method_option :user, :type => :string, :aliases => ["-u"],
                  :desc => 'Starred repositories for <user>'
    def starred
      params = options[:params].dup
      global_options = options.dup
      if options[:user]
        params['user'] = options[:user]
      end
      Util.hash_without!(global_options, params.keys + ['params', 'user'])
      Starring.starred params, global_options
    end

    desc 'starring <user> <repo>', 'Check if you are starring a repository'
    def starring(user, repo)
      global_options = options.dup
      params = options[:params].dup
      Util.hash_without!(global_options, params.keys + ['params'])
      Starring.starring? user, repo, params, global_options
    end

    desc 'star <user> <repo>', 'Star a repository'
    def star(user, repo)
      global_options = options.dup
      params = options[:params].dup
      Util.hash_without!(global_options, params.keys + ['params'])
      Starring.star user, repo, params, global_options
    end

    desc 'unstar <user> <repo>', 'Unstar a repository'
    def unstar(user, repo)
      global_options = options.dup
      params = options[:params].dup
      Util.hash_without!(global_options, params.keys + ['params'])
      Starring.unstar user, repo, params, global_options
    end

  end # Starring
end # GithubCLI

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
github_cli-0.6.2 lib/github_cli/commands/starring.rb
github_cli-0.6.1 lib/github_cli/commands/starring.rb
github_cli-0.6.0 lib/github_cli/commands/starring.rb