Sha256: 183c5065a7e4de85555b52c8aca386c3985548e53dbdc4963136913777364bd2

Contents?: true

Size: 1.82 KB

Versions: 3

Compression:

Stored size: 1.82 KB

Contents

# encoding: utf-8

module GithubCLI
  class Commands::Followers < Command

    namespace :follower

    desc 'list', "Lists an authenticated user's followers"
    method_option :user, :type => :string, :aliases => ["-u"],
                  :desc => 'List a <user> followers',
                  :banner => '<user>'
    def list
      global_options = options.dup
      params = options[:params].dup
      Util.hash_without!(global_options, params.keys + ['params', 'user'])
      Follower.all options[:user], params, global_options
    end

    desc 'following', 'List who a user/the authenticated user is following'
    method_option :user, :type => :string, :aliases => ["-u"],
                  :desc => 'List who a <user> is following',
                  :banner => '<user>'
    def following
      global_options = options.dup
      params = options[:params].dup
      Util.hash_without!(global_options, params.keys + ['params', 'user'])
      Follower.following options[:user], params, global_options
    end

    desc 'follower <user>', 'Check if you are following a user'
    def follower(user)
      global_options = options.dup
      params = options[:params].dup
      Util.hash_without!(global_options, params.keys + ['params'])
      Follower.follower user, params, global_options
    end

    desc 'follow <user>', 'Follow a user'
    def follow(user)
      global_options = options.dup
      params = options[:params].dup
      Util.hash_without!(global_options, params.keys + ['params'])
      Follower.follow user, params, global_options
    end

    desc 'unfollow <user>', 'Unfollow a user'
    def unfollow(user)
      global_options = options.dup
      params = options[:params].dup
      Util.hash_without!(global_options, params.keys + ['params'])
      Follower.unfollow user, params, global_options
    end

  end # Followers
end # GithubCLI

Version data entries

3 entries across 3 versions & 1 rubygems

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