awful 0.0.166 → 0.0.167
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/lib/awful/sqs.rb +12 -14
- data/lib/awful/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 707724c618d524adbace4d7cb12ecf78a6636412
|
4
|
+
data.tar.gz: 26f835d01f873767fca0758273d5fdc69e024906
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd3a0d6bf3ad77b66324b679d2cc6a3d7003a474b480496f17e751eb2e84107e8a1bfe08cf07771c62a956e1968d75b4994f86c2875016924cbe77ea949831f3
|
7
|
+
data.tar.gz: 50a08de9f3a5181294e9c927594f6fff73d345486c3cb4faa78dcbbe7a0c996c515324e17a220821df0fc9e425599f4edc206d573c869c0d823952afc07b8b64
|
data/lib/awful/sqs.rb
CHANGED
@@ -8,7 +8,7 @@ module Awful
|
|
8
8
|
class SQS < Cli
|
9
9
|
no_commands do
|
10
10
|
def sqs
|
11
|
-
@
|
11
|
+
@_sqs ||= Aws::SQS::Client.new
|
12
12
|
end
|
13
13
|
|
14
14
|
def is_url?(str)
|
@@ -24,22 +24,20 @@ module Awful
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
desc 'ls [
|
28
|
-
method_option :long,
|
29
|
-
|
30
|
-
|
27
|
+
desc 'ls [NAMES]', 'list queues, can limit by list of names or URLs'
|
28
|
+
method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
|
29
|
+
method_option :prefix, aliases: '-p', type: :string, default: nil, desc: 'list by prefix'
|
30
|
+
def ls(*names)
|
31
|
+
if names.empty?
|
32
|
+
queues = sqs.list_queues(queue_name_prefix: options[:prefix]).queue_urls
|
33
|
+
else
|
34
|
+
queues = names.map(&method(:queue_url))
|
35
|
+
end
|
31
36
|
attr = %w[QueueArn ApproximateNumberOfMessages ApproximateNumberOfMessagesNotVisible LastModifiedTimestamp]
|
32
37
|
if options[:long]
|
33
|
-
queues.map do |
|
34
|
-
sqs.get_queue_attributes(queue_url: queue, attribute_names: attr).attributes
|
35
|
-
end.output do |list|
|
38
|
+
queues.map {|q| sqs.get_queue_attributes(queue_url: q, attribute_names: attr).attributes}.output do |list|
|
36
39
|
print_table list.map { |q|
|
37
|
-
[
|
38
|
-
q['QueueArn'].split(':').last,
|
39
|
-
q['ApproximateNumberOfMessages'],
|
40
|
-
q['ApproximateNumberOfMessagesNotVisible'],
|
41
|
-
Time.at(q['LastModifiedTimestamp'].to_i)
|
42
|
-
]
|
40
|
+
[q['QueueArn'].split(':').last, q['ApproximateNumberOfMessages'], q['ApproximateNumberOfMessagesNotVisible'], Time.at(q['LastModifiedTimestamp'].to_i)]
|
43
41
|
}
|
44
42
|
end
|
45
43
|
else
|
data/lib/awful/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.167
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|