awful 0.0.89 → 0.0.90
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awful/cloudformation.rb +27 -6
- 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: 0af2c04aa7bdcb37394fa8960eebe2d839afa5dc
|
4
|
+
data.tar.gz: b26a823916aa559e7dd3c61e3ff30ce5adfe73ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a87d45f4f50406a40890247b1b08e0c9b49972ded2a10aeabc8ad404ffaa9fe9479c4ab61cc017a45564186128a45b78f9703198014d258eee9c0bff7324901
|
7
|
+
data.tar.gz: 4e125878e9629242ccd577e80a2a856afb9a69cf968b392ce2b8dcc6601b565bf415fa9dfd4f4c340df331c5bb8c04b269548d7c8e3abc991a8fae9f4f7f8351
|
data/lib/awful/cloudformation.rb
CHANGED
@@ -31,26 +31,47 @@ module Awful
|
|
31
31
|
def color(string)
|
32
32
|
set_color(string, COLORS.fetch(string.downcase.to_sym, :blue))
|
33
33
|
end
|
34
|
+
|
35
|
+
## get list of stacks
|
36
|
+
def stack_summaries(next_token = nil)
|
37
|
+
response = cf.list_stacks(next_token: next_token)
|
38
|
+
summaries = response.stack_summaries
|
39
|
+
if response.next_token # recurse to get more data
|
40
|
+
summaries += stack_summaries(response.next_token)
|
41
|
+
else
|
42
|
+
summaries
|
43
|
+
end
|
44
|
+
end
|
34
45
|
end
|
35
46
|
|
36
47
|
desc 'ls [PATTERN]', 'list cloudformation stacks matching PATTERN'
|
37
48
|
method_option :long, aliases: '-l', default: false, desc: 'Long listing'
|
38
49
|
method_option :all, aliases: '-a', default: false, desc: 'Show all, including stacks in DELETE_COMPLETE'
|
39
50
|
def ls(name = /./)
|
40
|
-
stacks =
|
41
|
-
stack.stack_name.match(name)
|
42
|
-
end
|
51
|
+
stacks = stack_summaries
|
43
52
|
|
44
53
|
## skip deleted stacks unless -a given
|
45
54
|
unless options[:all]
|
46
55
|
stacks = stacks.select { |stack| stack.stack_status != 'DELETE_COMPLETE' }
|
47
56
|
end
|
48
57
|
|
49
|
-
|
58
|
+
## match on given arg
|
59
|
+
stacks = stacks.select do |stack|
|
60
|
+
stack.stack_name.match(name)
|
61
|
+
end
|
62
|
+
|
63
|
+
stacks.tap do |list|
|
50
64
|
if options[:long]
|
51
|
-
print_table
|
65
|
+
print_table list.map { |s|
|
66
|
+
[
|
67
|
+
s.stack_name,
|
68
|
+
s.creation_time,
|
69
|
+
color(s.stack_status),
|
70
|
+
s.template_description,
|
71
|
+
]
|
72
|
+
}.sort
|
52
73
|
else
|
53
|
-
puts
|
74
|
+
puts list.map(&:stack_name).sort
|
54
75
|
end
|
55
76
|
end
|
56
77
|
end
|
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.90
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|