Class: Pronto::BitbucketServer

Inherits:
Bitbucket show all
Defined in:
lib/pronto/bitbucket_server.rb

Instance Method Summary collapse

Methods inherited from Bitbucket

#commit_comments, #create_commit_comment, #create_pull_comment

Methods inherited from Client

#env_pull_id, #initialize

Constructor Details

This class inherits a constructor from Pronto::Client

Instance Method Details

#pull_comments(sha) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/pronto/bitbucket_server.rb', line 3

def pull_comments(sha)
  @comment_cache["#{pull_id}/#{sha}"] ||= begin
    client.pull_comments(slug, pull_id).map do |comment|
      anchor = comment['commentAnchor']
      if anchor
        Comment.new(sha, comment['comment']['text'],
                    anchor['path'], anchor['line'])
      end
    end.compact
  end
end