#!/usr/bin/env ruby require "bundler/setup" require "unofficial_buildkite_client" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. client = UnofficialBuildkiteClient.new(org_slug: "rails", pipeline_slug: "rails") builds = client.fetch_builds(created_at_from: "2019-04-19T07:00", first: 1, state: ["FAILED", "PASSED"]) build = client.fetch_build(number: builds.first[:number]) job = build[:jobs].first log = client.fetch_log(build_number: job[:build_number], job_id: job[:id]) Bundler.require Pry.start