wavefront-cli 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY.md +3 -0
- data/lib/wavefront-cli/commands/message.rb +1 -0
- data/lib/wavefront-cli/display/message.rb +16 -0
- data/lib/wavefront-cli/message.rb +13 -1
- data/lib/wavefront-cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c539521ac7ac6ee23a27b7034e6354e5720ae33ff41ee507d6a2540ff7c09acf
|
4
|
+
data.tar.gz: f1ebb6ccaa31ab48bdc3acaa27015ca640c9a15e9b17f553a6973e4336e0214d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13e9b36104f6f51c9ca6d6d487dd0228d2c593dd9998bcd6094a75a4d2570c30250722bd9600983264ddfe9fb5a00a8d06bf0444d5ac7e5200e7194239291633
|
7
|
+
data.tar.gz: 10ebea3cd6845a068c9effa2eb2545a84f6a2ef4893c649e6cbc79fc1e05a7bf664b53cd092f32a9292881c113b622bbe9992ba105715614e40daf33fe9b95e9
|
data/HISTORY.md
CHANGED
@@ -8,5 +8,21 @@ module WavefrontDisplay
|
|
8
8
|
def do_list_brief
|
9
9
|
multicolumn(:id, :title)
|
10
10
|
end
|
11
|
+
|
12
|
+
def do_read
|
13
|
+
abort 'Message not found.' if data.empty?
|
14
|
+
|
15
|
+
puts message_title, data.content.fold(TW, 0), message_sender
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def message_title
|
21
|
+
format("\n%s\n%s\n", data.title, '-' * data.title.length)
|
22
|
+
end
|
23
|
+
|
24
|
+
def message_sender
|
25
|
+
format("\n%#{TW - 2}s\n", data.source)
|
26
|
+
end
|
11
27
|
end
|
12
28
|
end
|
@@ -5,13 +5,25 @@ module WavefrontCli
|
|
5
5
|
# CLI coverage for the v2 'message' API.
|
6
6
|
#
|
7
7
|
class Message < WavefrontCli::Base
|
8
|
-
|
8
|
+
def no_api_response
|
9
|
+
%w[do_read]
|
10
|
+
end
|
11
|
+
|
9
12
|
# There's an extra flag to "list" that no other commands have.
|
10
13
|
#
|
11
14
|
def do_list
|
12
15
|
wf.list(options[:offset] || 0, options[:limit] || 100, !options[:all])
|
13
16
|
end
|
14
17
|
|
18
|
+
def do_read
|
19
|
+
resp = wf.list(0, :all, false).response.items.select do |msg|
|
20
|
+
msg[:id] == options[:'<id>']
|
21
|
+
end
|
22
|
+
|
23
|
+
do_mark
|
24
|
+
resp.first
|
25
|
+
end
|
26
|
+
|
15
27
|
def do_mark
|
16
28
|
wf.read(options[:'<id>'])
|
17
29
|
end
|
@@ -1 +1 @@
|
|
1
|
-
WF_CLI_VERSION = '3.0
|
1
|
+
WF_CLI_VERSION = '3.1.0'.freeze
|
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.0
|
4
|
+
version: 3.1.0
|
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-03
|
11
|
+
date: 2019-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docopt
|