Class: Saddler::Reporter::Github::PullRequestComment
- Inherits:
-
Object
- Object
- Saddler::Reporter::Github::PullRequestComment
- Includes:
- Helper, Support
- Defined in:
- lib/saddler/reporter/github/pull_request_comment.rb
Instance Method Summary collapse
Methods included from Helper
#build_comments_with_patches, #concat_body
Instance Method Details
#report(messages, _options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/saddler/reporter/github/pull_request_comment.rb', line 9 def report(, ) repo_path = '.' repo = ::Saddler::Reporter::Support::Git::Repository.new(repo_path) data = parse() client = Client.new(repo) # fetch pull_request_comments(issue) pull_request_comments = client.issue_comments # build comment body = concat_body(data) return if body.empty? comment = Comment.new(sha1 = nil, body, path = nil, position = nil) # compare pull_request_comments.include?(comment) return if pull_request_comments.include?(comment) # create pull_request_comment client.create_issue_comment(comment) end |