Sha256: 7ab29da4bea938719eaa8a98aeb3784ec4d0850264bec136b10a4079a5fd3ad1

Contents?: true

Size: 368 Bytes

Versions: 5

Compression:

Stored size: 368 Bytes

Contents

class PullBranchLister

  PULL_EXTRACTOR = ->(pull){ pull.head.label }
  GIT_COMMAND_EXTRACTOR = ->(pull_info){ pull_info.split(':') }

  def initialize(user, repo)
    @client = ClientResolver.client
    @user = user
    @repo = repo
  end

  def list
    pulls = @client.pulls "#{@user}/#{@repo}"
    pulls.map(&PULL_EXTRACTOR).map(&GIT_COMMAND_EXTRACTOR)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
brown_noser-0.2.4 lib/pull_branch_lister.rb
brown_noser-0.2.3 lib/pull_branch_lister.rb
brown_noser-0.2.2 lib/pull_branch_lister.rb
brown_noser-0.2.1 lib/pull_branch_lister.rb
brown_noser-0.2.0 lib/pull_branch_lister.rb