buildkit 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a85af6bb40a281c219a2837700833cbb6f32d99
4
- data.tar.gz: dc2cd54f37470feb90fda6c37a3ae3d8855b43bf
3
+ metadata.gz: 1c6dff3c82bb149b2cdc144fd406166383677156
4
+ data.tar.gz: 546b10638c5c057c039938453c91f950c39762a6
5
5
  SHA512:
6
- metadata.gz: 4df322a711ba16b8a5abe274195af31a2caff1891b57593fcb6f077a584c35d7ed28e618dbba2638672c860309990664b30f072c4e309b6d0a20053e49b6c1f1
7
- data.tar.gz: 27c8787d3ce593c0cc038ec527d73ed7ff0dba2810b1d674f78d80ec8cd741a8f5e042f28a85eba6b97e8b4f07339851627709c7a1ff83d0a654bdbd8e1a6846
6
+ metadata.gz: fc285edc5ef194f29f87ffbe771fcd624d1f629d651c90f119a077d22a3fbf4b6393a1c2bb8d3e16a5ab0876be5ac3f35490fcb856d8d24e78ad6ccbf18ca8d8
7
+ data.tar.gz: 91d612ddcc59751858f38788fd8e882847ff03863149aaa00534cdeebb85b07635ce0f040a87526cf817d7bc9f6db1812cefff92d6ffb5c83eb1c99798a3694a
data/Rakefile CHANGED
@@ -7,13 +7,13 @@ require 'rubocop/rake_task'
7
7
  RuboCop::RakeTask.new
8
8
 
9
9
  task test: :spec
10
- task default: [:spec, :rubocop]
10
+ task default: %i[spec rubocop]
11
11
 
12
12
  namespace :doc do
13
13
  require 'yard'
14
14
  YARD::Rake::YardocTask.new do |task|
15
- task.files = %w(LICENSE.md lib/**/*.rb)
16
- task.options = %w(--output-dir doc/yard --markup markdown)
15
+ task.files = %w[LICENSE.md lib/**/*.rb]
16
+ task.options = %w[--output-dir doc/yard --markup markdown]
17
17
  end
18
18
  task default: :yard
19
19
  end
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'buildkit/version'
@@ -19,7 +19,7 @@ module Buildkit
19
19
  DEFAULT_ENDPOINT = 'https://api.buildkite.com/v2/'.freeze
20
20
 
21
21
  # Header keys that can be passed in options hash to {#get},{#head}
22
- CONVENIENCE_HEADERS = Set.new([:accept, :content_type])
22
+ CONVENIENCE_HEADERS = Set.new(%i[accept content_type])
23
23
 
24
24
  # In Faraday 0.9, Faraday::Builder was renamed to Faraday::RackBuilder
25
25
  RACK_BUILDER_CLASS = defined?(Faraday::RackBuilder) ? Faraday::RackBuilder : Faraday::Builder
@@ -31,6 +31,20 @@ module Buildkit
31
31
  def job_env(org, pipeline, build, job, options = {})
32
32
  get("/v2/organizations/#{org}/pipelines/#{pipeline}/builds/#{build}/jobs/#{job}/env", options)
33
33
  end
34
+
35
+ # Get a job's log output
36
+ #
37
+ # @param org [String] Organization slug.
38
+ # @param pipeline [String] Pipeline slug.
39
+ # @param build [Integer] Build number.
40
+ # @param job [String] Job id.
41
+ # @return [Sawyer::Resource] Hash representing the Buildkit job log output.
42
+ # @see https://buildkite.com/docs/rest-api/jobs#get-a-jobs-log-output
43
+ # @example
44
+ # Buildkit.job_log('my-great-org', 'great-pipeline', 123, 'my-job-id')
45
+ def job_log(org, pipeline, build, job, options = {})
46
+ get("/v2/organizations/#{org}/pipelines/#{pipeline}/builds/#{build}/jobs/#{job}/log", options)
47
+ end
34
48
  end
35
49
  end
36
50
  end
@@ -105,7 +105,7 @@ module Buildkit
105
105
  end
106
106
 
107
107
  def redact_url(url_string)
108
- %w(client_secret access_token).each do |token|
108
+ %w[client_secret access_token].each do |token|
109
109
  url_string.gsub!(/#{token}=\S+/, "#{token}=(redacted)") if url_string.include? token
110
110
  end
111
111
  url_string
@@ -1,3 +1,3 @@
1
1
  module Buildkit
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-27 00:00:00.000000000 Z
11
+ date: 2018-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sawyer
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.5.2
91
+ rubygems_version: 2.6.14
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Ruby toolkit for working with the Buildkite API