Class: Saddler::Reporter::Github::CommitReviewComment
- Inherits:
-
Object
- Object
- Saddler::Reporter::Github::CommitReviewComment
- Includes:
- Helper, Support
- Defined in:
- lib/saddler/reporter/github/commit_review_comment.rb
Instance Method Summary collapse
Methods included from Helper
#build_comments_with_patches, #concat_body
Instance Method Details
#report(messages, options) ⇒ void
This method returns an undefined value.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/saddler/reporter/github/commit_review_comment.rb', line 17 def report(, ) repo_path = '.' repo = Repository.new(repo_path) sha = ['sha'] || repo.head.sha data = parse() client = Client.new(repo) # fetch commit_comments commit_comments = client.commit_comments(sha) patches = client.commit_patches(sha) # build comment comments = build_comments_with_patches(data, patches) return if comments.empty? posting_comments = comments - commit_comments return if posting_comments.empty? # create commit_comment posting_comments.each do |posting| client.create_commit_comment(posting) end end |