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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afd4a73cf4aa6dde2f68aaeb303e938002afefa72232cff090dc65ae391f9a2d
4
- data.tar.gz: 329caeec19b802914ad11083f9bde97f9b5153dcb3e6ee02323e03a03d50fd4a
3
+ metadata.gz: c539521ac7ac6ee23a27b7034e6354e5720ae33ff41ee507d6a2540ff7c09acf
4
+ data.tar.gz: f1ebb6ccaa31ab48bdc3acaa27015ca640c9a15e9b17f553a6973e4336e0214d
5
5
  SHA512:
6
- metadata.gz: 18486fdb1defc5a2ef082c490242cae914dc74abd02e280def9e371558c53b51b647f565fef860966a14d2eaacd57c474f057debfbb95337dd030c5be228938f
7
- data.tar.gz: e96022d0383f14c788394ab1784cc4eec242d2bf2a1cdffaca3f8ad75cb213f1200cf4902e03259f6d4bc39d67d50a53734102730e4e1e130688a909dd22bbbe
6
+ metadata.gz: 13e9b36104f6f51c9ca6d6d487dd0228d2c593dd9998bcd6094a75a4d2570c30250722bd9600983264ddfe9fb5a00a8d06bf0444d5ac7e5200e7194239291633
7
+ data.tar.gz: 10ebea3cd6845a068c9effa2eb2545a84f6a2ef4893c649e6cbc79fc1e05a7bf664b53cd092f32a9292881c113b622bbe9992ba105715614e40daf33fe9b95e9
data/HISTORY.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.1.0 (02/04/2019)
4
+ * Add `message read` command.
5
+
3
6
  ## 3.0.1 (23/03/2019)
4
7
  * Fix `config about` bug.
5
8
 
@@ -9,6 +9,7 @@ class WavefrontCommandMessage < WavefrontCommandBase
9
9
 
10
10
  def _commands
11
11
  ["list #{CMN} [-al] [-O fields] [-o offset] [-L limit]",
12
+ "read #{CMN} <id>",
12
13
  "mark #{CMN} <id>"]
13
14
  end
14
15
 
@@ -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'.freeze
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.1
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-23 00:00:00.000000000 Z
11
+ date: 2019-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt