wavefront-cli 3.2.1 → 3.2.2

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: 0cbeefd7b752bca0b1a5a3b886219b8ff0df8d6407ac1c3589e21f04faa1df7e
4
- data.tar.gz: 36bbb2c1753d13d5911f91c0959af065d250e2d582b503d5731bd067ea1eebc9
3
+ metadata.gz: 44fde207ab6a5e7bf248febda0e17efc39c06750170a1ff72c0c950b0a563c36
4
+ data.tar.gz: d33649c503ad6b8e872dd403ae1a322648b53f5ca5b020eaefe53638dbec5927
5
5
  SHA512:
6
- metadata.gz: c9a1cb2a6a26f242fb5a992497e4346d4844395d34c74958c03575116a6cdcbe712a4364bb6bf7a23fd8bb73d356b3905e4aa722305e3df228cdf84d28bf4613
7
- data.tar.gz: 4f48260461f4222092f383dbd175d90ce4e0a1c58b7ff78260035b106abd14e86e71a6cf98f3d4e3b34bcefd7532db938f8c770fcdbf506f78ef3ca524a9daea
6
+ metadata.gz: db13f2c6d065396b2f9c3e54c92e3eddae9b81c1e768ade86d0c39791477f5a5bd190f7253aae3cb7db7256cd09275e80df015f8fcd0e8a465a90c2cfb04cf46
7
+ data.tar.gz: 7b39265f2824d4f039d86b64dcabdd2c4e5c97edf404b5c15b9b26d446428fd7cc650422edb639c1485ee45807c99133650a5830fea6347bc187f683d91de09f
data/HISTORY.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.2.2 (16/05/2019)
4
+ * Smarter error messages.
5
+ * Require 3.3.1 of [the SDK](https://github.com/snltd/wavefront-sdk).
6
+
3
7
  ## 3.2.1 (09/05/2019)
4
8
  * Fix for new API ACL format.
5
9
  * Require 3.3.0 of [the SDK](https://github.com/snltd/wavefront-sdk).
@@ -229,17 +229,23 @@ module WavefrontCli
229
229
  end
230
230
  # rubocop:enable Metrics/AbcSize
231
231
 
232
+ # Classes can provide methods which give the user information on
233
+ # a given error code. They are named #handle_errcode_xxx, and
234
+ # return a string.
232
235
  # @param status [Map] status object from SDK response
233
236
  # @return System exit
234
237
  #
235
238
  def display_api_error(status)
236
- if status.code == 404
237
- abort 'API path not found. Perhaps your account does not ' \
238
- 'support this feature.'
239
- end
239
+ method = format('handle_errcode_%s', status.code).to_sym
240
+
241
+ msg = if respond_to?(method)
242
+ send(method, status)
243
+ else
244
+ status.message || 'No further information'
245
+ end
240
246
 
241
- msg = status.message || 'No further information'
242
- abort format('ERROR: API code %s: %s.', status.code, msg.chomp('.'))
247
+ abort format('ERROR: API code %s. %s.', status.code,
248
+ msg.chomp('.')).fold(TW, 7)
243
249
  end
244
250
 
245
251
  def display_no_api_response(data, method)
@@ -1,7 +1,7 @@
1
1
  # For development against a local checkout of the SDK, uncomment
2
2
  # this definition
3
3
  #
4
- DEVELOPMENT = true
4
+ # DEVELOPMENT = true
5
5
 
6
6
  if defined?(DEVELOPMENT)
7
7
  dir = Pathname.new(__FILE__).dirname.realpath.parent.parent.parent
@@ -117,5 +117,9 @@ module WavefrontCli
117
117
  line.to_s.start_with?('q_')
118
118
  end
119
119
  end
120
+
121
+ def handle_errcode_404(_status)
122
+ 'Perhaps metric does not exist for given host.'
123
+ end
120
124
  end
121
125
  end
@@ -1 +1 @@
1
- WF_CLI_VERSION = '3.2.1'.freeze
1
+ WF_CLI_VERSION = '3.2.2'.freeze
@@ -24,7 +24,7 @@ Gem::Specification.new do |gem|
24
24
 
25
25
  gem.add_runtime_dependency 'docopt', '~> 0.6.0'
26
26
  gem.add_runtime_dependency 'inifile', '~> 3.0'
27
- gem.add_runtime_dependency 'wavefront-sdk', '~> 3.3', '>= 3.3.0'
27
+ gem.add_runtime_dependency 'wavefront-sdk', '~> 3.3', '>= 3.3.1'
28
28
 
29
29
  gem.add_development_dependency 'minitest', '~> 5.11', '>= 5.11.0'
30
30
  gem.add_development_dependency 'rake', '~> 12.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wavefront-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Fisher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-09 00:00:00.000000000 Z
11
+ date: 2019-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -42,22 +42,22 @@ dependencies:
42
42
  name: wavefront-sdk
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 3.3.0
48
45
  - - "~>"
49
46
  - !ruby/object:Gem::Version
50
47
  version: '3.3'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 3.3.1
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: 3.3.0
58
55
  - - "~>"
59
56
  - !ruby/object:Gem::Version
60
57
  version: '3.3'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 3.3.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: minitest
63
63
  requirement: !ruby/object:Gem::Requirement