buildkit 1.4.2 → 1.4.3

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
  SHA256:
3
- metadata.gz: cb6ca6eafcc3ad71c019207e36894e60ee31b31053ec2e3aee60930a5d6998b0
4
- data.tar.gz: 9eb250b35103fad340404e0b08ece58be85e76158c8ece673cc9e8d733654374
3
+ metadata.gz: e0d8ad5ef2805dc0580084a0bb934c5e013740b7b02dfd6747941014293958b6
4
+ data.tar.gz: edf69422089f0ddca1c75969a575e546617be02db8989703b9804624d91553b1
5
5
  SHA512:
6
- metadata.gz: fd6916b102128b7bd3d6b0627d9f57462a14c565811732d56137691faf96778078536c1011ef3a633c06b499daf0711a9ea3edff4bd7d6689c9342f33ac98cc0
7
- data.tar.gz: e5caef77cd0cb5016a7794b040445562456daab5b29a3f344598fe04345d47e259e674a6b3ff0964d22e6dc5e89958004cb6a4dccc1695caefcb9e2b3228cc0c
6
+ metadata.gz: 0d7efe3865fbbbeffa1280491a0babafd410aeabd4552824f68ed86ff3bd841c274612f71133a5ba512b2473f2680472458638b1517a0eb05a2262522b83570a
7
+ data.tar.gz: 3967182cd91e643ac31237bc27496bb67b8f125a3b5f18ad457f900b5a63a2b3622376f17c3b5196ac9cd5507f4c0e76c4f44269ccafbe48e21b207dbe616f71
@@ -89,26 +89,34 @@ module Buildkit
89
89
  def response_error_summary
90
90
  return nil unless data.is_a?(Hash) && !Array(data[:errors]).empty?
91
91
 
92
- summary = "\nError summary:\n"
93
- summary << data[:errors].map do |hash|
92
+ errors = data[:errors].map do |hash|
94
93
  hash.map { |k, v| " #{k}: #{v}" }
95
- end.join("\n")
94
+ end
96
95
 
97
- summary
96
+ <<~MSG.chomp
97
+ Error summary:
98
+ #{errors.join("\n")}
99
+ MSG
98
100
  end
99
101
 
100
102
  def build_error_message
101
103
  return nil if @response.nil?
102
104
 
103
- message = +"#{@response[:method].to_s.upcase} #{redact_url(@response[:url].to_s)}: #{@response[:status]} - "
104
- message << "#{response_message}#{response_error}#{response_error_summary}"
105
- message << " // See: #{documentation_url}" unless documentation_url.nil?
106
- message
105
+ documentation_text = if documentation_url
106
+ "// See: #{documentation_url}"
107
+ else
108
+ ""
109
+ end
110
+
111
+ <<~MSG.strip
112
+ #{@response[:method].to_s.upcase} #{redact_url(@response[:url].to_s)}: #{@response[:status]} - #{response_message}#{response_error}#{response_error_summary}
113
+ #{documentation_text}
114
+ MSG
107
115
  end
108
116
 
109
117
  def redact_url(url_string)
110
118
  %w[client_secret access_token].each do |token|
111
- url_string.gsub!(/#{token}=\S+/, "#{token}=(redacted)") if url_string.include? token
119
+ url_string = url_string.gsub(/#{token}=\S+/, "#{token}=(redacted)") if url_string.include? token
112
120
  end
113
121
  url_string
114
122
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Buildkit
4
- VERSION = '1.4.2'
4
+ VERSION = '1.4.3'
5
5
  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.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-03 00:00:00.000000000 Z
11
+ date: 2021-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sawyer