Class: Saddler::Reporter::Github::CommitComment
- Inherits:
-
Object
- Object
- Saddler::Reporter::Github::CommitComment
- Includes:
- Helper, Support
- Defined in:
- lib/saddler/reporter/github/commit_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.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/saddler/reporter/github/commit_comment.rb', line 15 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) # build comment body = concat_body(data) return if body.empty? path = nil position = nil comment = Comment.new(sha, body, path, position) # compare commit_comments.include?(comment) return if commit_comments.include?(comment) # create commit_comment client.create_commit_comment(comment) end |