Sha256: 82eafd3ecbebed038997002cc85e42416211913aee0a0b1a83645e90443df4b0
Contents?: true
Size: 566 Bytes
Versions: 11
Compression:
Stored size: 566 Bytes
Contents
require "faraday" module Danger class CircleAPI attr_accessor :circle_token def initialize(circle_token = nil) self.circle_token = circle_token end def client @client ||= Faraday.new(url: "https://circleci.com/api/v1") end def fetch_build(repo_slug, build_number) url = "project/#{repo_slug}/#{build_number}" params = { "circle-token" => circle_token } response = client.get url, params, accept: "application/json" json = JSON.parse(response.body, symbolize_names: true) json end end end
Version data entries
11 entries across 11 versions & 1 rubygems