Sha256: bfec9900bd6ea03e0997f454b16bf5c98dd13a259ac679ac653596320d25f7e9

Contents?: true

Size: 764 Bytes

Versions: 1

Compression:

Stored size: 764 Bytes

Contents

#!/usr/bin/env ruby

require 'docopt'
require 'stash_pull_request_commenter/inputs/rubocop_json'
require 'logger'
require 'stash/config'
require 'stash/server'

begin
  args = Docopt.docopt(File.read('USAGE'))

  project         = args['<project>']
  repository      = args['<repository>']
  pull_request_id = args['<pull_request_id>']

  input = Inputs::RubocopJson.new

  config = Stash::Config.new
  server = Stash::Server.new(config.host, config.user, config.password, Logger.new(STDOUT))
  repository = server.repository(project, repository)
  pull_request = repository.pull_request(pull_request_id)

  input.comments.each do |comment|
    pull_request.add_comment(comment.file, comment.line, comment.text)
  end
rescue Docopt::Exit => e
  puts e.message
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stash_pull_request_commenter-0.0.1 bin/stash-comment