Sha256: fec86665b3ca84a1858481d3b2c522fe618be49c5fe77f9a5e92589bfc1da580

Contents?: true

Size: 592 Bytes

Versions: 2

Compression:

Stored size: 592 Bytes

Contents

module Pronto
  module Formatter
    class GithubPullRequestReviewFormatter < PullRequestFormatter
      def client_module
        Github
      end

      def pretty_name
        'GitHub'
      end

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pronto-0.11.1 lib/pronto/formatter/github_pull_request_review_formatter.rb
pronto-0.11.0 lib/pronto/formatter/github_pull_request_review_formatter.rb