Class: Pronto::Gitlab
- Inherits:
-
Object
- Object
- Pronto::Gitlab
- Defined in:
- lib/pronto/gitlab.rb
Instance Method Summary collapse
- #commit_comments(sha) ⇒ Object
- #create_commit_comment(comment) ⇒ Object
-
#initialize(repo) ⇒ Gitlab
constructor
A new instance of Gitlab.
Constructor Details
Instance Method Details
#commit_comments(sha) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/pronto/gitlab.rb', line 9 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
17 18 19 20 21 22 |
# File 'lib/pronto/gitlab.rb', line 17 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 |