wavefront-cli 2.1.5 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wavefront-cli/base.rb +2 -8
- data/lib/wavefront-cli/controller.rb +3 -3
- data/lib/wavefront-cli/display/base.rb +27 -3
- data/lib/wavefront-cli/version.rb +1 -1
- data/wavefront-cli.gemspec +2 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f2e02d1e31da1b3ad2fd05c895813c97349e833c270b7bc843c63591b428d82
|
4
|
+
data.tar.gz: bdcf1886e4f5a28387e0ff8a669ebb8517e3d794bee15c0fc6ec19262e9844b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e48473c939d7be914f2effa82f5542a0395baa3cd7150a5e3f80d27a6b08e34bb026ce41f8623ccec15cb7044f7e256c5685a058d0c903725623a04c972ed43d
|
7
|
+
data.tar.gz: f2443319167863a1cbb90201dd6db6ce711233b2877af8b4841df3311ba9691f6adaea1eb242bf209d231bf0a3c86a4e140dbe62efdb143e49b83a8724f2627d
|
data/lib/wavefront-cli/base.rb
CHANGED
@@ -180,13 +180,7 @@ module WavefrontCli
|
|
180
180
|
abort "API #{data.status.code}: #{data.status.message}."
|
181
181
|
end
|
182
182
|
|
183
|
-
|
184
|
-
data.response.items
|
185
|
-
else
|
186
|
-
data.response
|
187
|
-
end
|
188
|
-
|
189
|
-
handle_response(resp, format_var, method)
|
183
|
+
handle_response(data.response, format_var, method)
|
190
184
|
end
|
191
185
|
|
192
186
|
def check_status(status)
|
@@ -291,7 +285,7 @@ module WavefrontCli
|
|
291
285
|
end
|
292
286
|
|
293
287
|
def do_update
|
294
|
-
k, v = options[:'<key=value>'].split('=')
|
288
|
+
k, v = options[:'<key=value>'].split('=', 2)
|
295
289
|
wf.update(options[:'<id>'], k => v)
|
296
290
|
end
|
297
291
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# For development against a local checkout of the SDK, uncomment
|
2
2
|
# this block
|
3
3
|
#
|
4
|
-
dir = Pathname.new(__FILE__).dirname.realpath.parent.parent.parent
|
5
|
-
|
6
|
-
|
4
|
+
#dir = Pathname.new(__FILE__).dirname.realpath.parent.parent.parent
|
5
|
+
#$LOAD_PATH.<< dir + 'lib'
|
6
|
+
#$LOAD_PATH.<< dir + 'wavefront-sdk' + 'lib'
|
7
7
|
|
8
8
|
require 'pathname'
|
9
9
|
require 'pp'
|
@@ -14,13 +14,21 @@ module WavefrontDisplay
|
|
14
14
|
class Base
|
15
15
|
include WavefrontCli::Constants
|
16
16
|
|
17
|
-
attr_reader :data, :options
|
17
|
+
attr_reader :raw, :data, :options
|
18
18
|
|
19
|
-
# @param
|
19
|
+
# @param raw_response [Map, Hash, Array] the data returned by the SDK
|
20
20
|
# response.
|
21
21
|
# @param options [Hash] options from docopt
|
22
22
|
#
|
23
|
-
def initialize(
|
23
|
+
def initialize(raw_response, options = {})
|
24
|
+
@raw = raw_response
|
25
|
+
|
26
|
+
data = if raw_response.respond_to?(:items)
|
27
|
+
raw_response.items
|
28
|
+
else
|
29
|
+
raw_response
|
30
|
+
end
|
31
|
+
|
24
32
|
@data = data.is_a?(Map) ? Map(put_id_first(data)) : data
|
25
33
|
@options = options
|
26
34
|
end
|
@@ -98,12 +106,28 @@ module WavefrontDisplay
|
|
98
106
|
else
|
99
107
|
require_relative 'printer/long'
|
100
108
|
puts WavefrontDisplayPrinter::Long.new(data, fields, modified_data)
|
109
|
+
pagination_line
|
101
110
|
end
|
102
111
|
end
|
103
112
|
|
104
113
|
def multicolumn(*columns)
|
105
114
|
require_relative 'printer/terse'
|
106
115
|
puts WavefrontDisplayPrinter::Terse.new(data, *columns)
|
116
|
+
pagination_line
|
117
|
+
end
|
118
|
+
|
119
|
+
# if this is a section of a larger dataset, say so
|
120
|
+
#
|
121
|
+
def pagination_line
|
122
|
+
if raw.respond_to?(:moreItems) && raw.moreItems == true
|
123
|
+
if raw.respond_to?(:offset) && raw.respond_to?(:limit)
|
124
|
+
enditem = raw.limit > 0 ? raw.offset + raw.limit - 1 : 0
|
125
|
+
puts format('Showing items %d to %d. Use -o and -L for more.',
|
126
|
+
raw.offset, enditem)
|
127
|
+
else
|
128
|
+
puts 'Showing paginated output. Use -o and -L for more.'
|
129
|
+
end
|
130
|
+
end
|
107
131
|
end
|
108
132
|
|
109
133
|
# Give it a key-value hash, and it will return the size of the first
|
@@ -1 +1 @@
|
|
1
|
-
WF_CLI_VERSION = '2.1.
|
1
|
+
WF_CLI_VERSION = '2.1.6'.freeze
|
data/wavefront-cli.gemspec
CHANGED
@@ -28,9 +28,9 @@ Gem::Specification.new do |gem|
|
|
28
28
|
gem.add_development_dependency 'bundler', '~> 1.3'
|
29
29
|
gem.add_development_dependency 'rake', '~> 12.0'
|
30
30
|
gem.add_development_dependency 'yard', '~> 0.9.5'
|
31
|
-
gem.add_development_dependency 'rubocop', '~> 0.
|
31
|
+
gem.add_development_dependency 'rubocop', '~> 0.52.0'
|
32
32
|
gem.add_development_dependency 'webmock', '~> 3.0'
|
33
|
-
gem.add_development_dependency 'minitest', '~> 5.
|
33
|
+
gem.add_development_dependency 'minitest', '~> 5.11', '>= 5.11.0'
|
34
34
|
gem.add_development_dependency 'spy', '~> 0.4.0'
|
35
35
|
|
36
36
|
gem.required_ruby_version = Gem::Requirement.new('>= 2.2.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: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Fisher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docopt
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.
|
95
|
+
version: 0.52.0
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.
|
102
|
+
version: 0.52.0
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: webmock
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,20 +120,20 @@ dependencies:
|
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '5.
|
123
|
+
version: '5.11'
|
124
124
|
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
version: 5.
|
126
|
+
version: 5.11.0
|
127
127
|
type: :development
|
128
128
|
prerelease: false
|
129
129
|
version_requirements: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
131
|
- - "~>"
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: '5.
|
133
|
+
version: '5.11'
|
134
134
|
- - ">="
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: 5.
|
136
|
+
version: 5.11.0
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: spy
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|
@@ -289,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
291
|
rubyforge_project:
|
292
|
-
rubygems_version: 2.7.
|
292
|
+
rubygems_version: 2.7.4
|
293
293
|
signing_key:
|
294
294
|
specification_version: 4
|
295
295
|
summary: CLI for Wavefront API v2
|