Class: Pronto::Formatter::GithubPullRequestReviewFormatter

Inherits:
PullRequestFormatter show all
Defined in:
lib/pronto/formatter/github_pull_request_review_formatter.rb

Instance Method Summary collapse

Methods inherited from PullRequestFormatter

#existing_comments

Methods inherited from GitFormatter

#format

Methods inherited from Base

#config, name

Instance Method Details

#client_moduleObject



4
5
6
# File 'lib/pronto/formatter/github_pull_request_review_formatter.rb', line 4

def client_module
  Github
end

#line_number(message, patches) ⇒ Object



18
19
20
21
# File 'lib/pronto/formatter/github_pull_request_review_formatter.rb', line 18

def line_number(message, patches)
  line = patches.find_line(message.full_path, message.line.new_lineno)
  line.position
end

#pretty_nameObject



8
9
10
# File 'lib/pronto/formatter/github_pull_request_review_formatter.rb', line 8

def pretty_name
  'GitHub'
end

#submit_comments(client, comments) ⇒ Object



12
13
14
15
16
# File 'lib/pronto/formatter/github_pull_request_review_formatter.rb', line 12

def submit_comments(client, comments)
  client.create_pull_request_review(comments)
rescue Octokit::UnprocessableEntity, HTTParty::Error => e
  $stderr.puts "Failed to post: #{e.message}"
end