Class: Pronto::Formatter::GithubPullRequestReviewFormatter
- Inherits:
-
PullRequestFormatter
- Object
- Base
- GitFormatter
- PullRequestFormatter
- Pronto::Formatter::GithubPullRequestReviewFormatter
- Defined in:
- lib/pronto/formatter/github_pull_request_review_formatter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #client_module ⇒ Object
- #line_number(message, patches) ⇒ Object
- #pretty_name ⇒ Object
- #submit_comments(client, comments) ⇒ Object
Methods inherited from PullRequestFormatter
Methods inherited from GitFormatter
Methods inherited from Base
Class Method Details
.name ⇒ Object
4 5 6 |
# File 'lib/pronto/formatter/github_pull_request_review_formatter.rb', line 4 def self.name 'github_pr_review' end |
Instance Method Details
#client_module ⇒ Object
8 9 10 |
# File 'lib/pronto/formatter/github_pull_request_review_formatter.rb', line 8 def client_module Github end |
#line_number(message, patches) ⇒ Object
22 23 24 25 |
# File 'lib/pronto/formatter/github_pull_request_review_formatter.rb', line 22 def line_number(, patches) line = patches.find_line(.full_path, .line.new_lineno) line.position end |
#pretty_name ⇒ Object
12 13 14 |
# File 'lib/pronto/formatter/github_pull_request_review_formatter.rb', line 12 def pretty_name 'GitHub' end |
#submit_comments(client, comments) ⇒ Object
16 17 18 19 20 |
# File 'lib/pronto/formatter/github_pull_request_review_formatter.rb', line 16 def submit_comments(client, comments) client.publish_pull_request_comments(comments) rescue Octokit::UnprocessableEntity, HTTParty::Error => e $stderr.puts "Failed to post: #{e.}" end |