Sha256: 2c7d5bf7a874be97bd801e6391a50767c35e317a62bcd380d776cbc800ffe364

Contents?: true

Size: 996 Bytes

Versions: 18

Compression:

Stored size: 996 Bytes

Contents

#!/usr/bin/env ruby
#
# Ad-hoc script for updating a pull request using our service.
#
# Usage:
#
#   $ OAUTH_TOKEN="..." bundle exec ruby pull_request_test.rb
#
#     OAUTH_TOKEN: Personal GitHub access token
#
#         GitHub >
#         Account settings >
#         Applications >
#         Personal access tokens >
#         Generate new token
#
###
require "cc/services"
CC::Service.load_services

class WithResponseLogging
  def initialize(invocation)
    @invocation = invocation
  end

  def call
    @invocation.call.tap { |r| p r }
  end
end

service = CC::Service::GitHubPullRequests.new(
  {
    oauth_token: ENV.fetch("OAUTH_TOKEN"),
  },
  name: "pull_request",
  # https://github.com/codeclimate/nillson/pull/33
  state: "success",
  github_slug: "codeclimate/nillson",
  issue_comparison_counts: { "new" => 0, "fixed" => 0 },
  number: 33,
  commit_sha: "986ec903b8420f4e8c8d696d8950f7bd0667ff0c",
)

CC::Service::Invocation.new(service) do |i|
  i.wrap(WithResponseLogging)
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
codeclimate-services-1.11.4 pull_request_test.rb
codeclimate-services-1.11.3 pull_request_test.rb
codeclimate-services-1.11.2 pull_request_test.rb
codeclimate-services-1.11.1 pull_request_test.rb
codeclimate-services-1.11.0 pull_request_test.rb
codeclimate-services-1.10.1 pull_request_test.rb
codeclimate-services-1.10.0 pull_request_test.rb
codeclimate-services-1.9.8 pull_request_test.rb
codeclimate-services-1.9.7 pull_request_test.rb
codeclimate-services-1.9.6 pull_request_test.rb
codeclimate-services-1.9.5 pull_request_test.rb
codeclimate-services-1.9.4 pull_request_test.rb
codeclimate-services-1.9.3 pull_request_test.rb
codeclimate-services-1.9.2 pull_request_test.rb
codeclimate-services-1.9.1 pull_request_test.rb
codeclimate-services-1.9.0 pull_request_test.rb
codeclimate-services-1.8.0 pull_request_test.rb
codeclimate-services-1.7.0 pull_request_test.rb