Class: Pronto::Gitlab

Inherits:
Client
  • Object
show all
Defined in:
lib/pronto/gitlab.rb

Instance Method Summary collapse

Methods inherited from Client

#env_pull_id, #initialize

Constructor Details

This class inherits a constructor from Pronto::Client

Instance Method Details

#commit_comments(sha) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/pronto/gitlab.rb', line 3

def commit_comments(sha)
  @comment_cache[sha.to_s] ||= begin
    client.commit_comments(slug, sha, per_page: 500).map do |comment|
      Comment.new(sha, comment.note, comment.path, comment.line)
    end
  end
end

#create_commit_comment(comment) ⇒ Object



11
12
13
14
15
16
# File 'lib/pronto/gitlab.rb', line 11

def create_commit_comment(comment)
  @config.logger.log("Creating commit comment on #{comment.sha}")
  client.create_commit_comment(slug, comment.sha, comment.body,
                               path: comment.path, line: comment.position,
                               line_type: 'new')
end