Sha256: 8357f8771ba1232d507069b6c1c4af9c4f9c407937d3a3ef0b83d403a49b69e2

Contents?: true

Size: 517 Bytes

Versions: 2

Compression:

Stored size: 517 Bytes

Contents

module Pronto
  module Formatter
    class PullRequestFormatter < GitFormatter
      def existing_comments(messages, client, repo)
        sha = repo.head_commit_sha
        comments = client.pull_comments(sha)
        grouped_comments(comments)
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pronto-0.8.2 lib/pronto/formatter/pull_request_formatter.rb
pronto-0.8.1 lib/pronto/formatter/pull_request_formatter.rb