awsome 0.0.62 → 0.0.63
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/awsome.rb +12 -3
- metadata +1 -1
data/lib/awsome.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'terminal-table'
|
2
|
+
|
1
3
|
module Awsome
|
2
4
|
def self.config
|
3
5
|
@@config ||= Config.new
|
@@ -21,9 +23,16 @@ module Awsome
|
|
21
23
|
ensure
|
22
24
|
if verbose && options[:output] != false
|
23
25
|
puts '-' * description.length
|
24
|
-
|
25
|
-
|
26
|
-
|
26
|
+
if result.is_a?(Array)
|
27
|
+
if result.any?
|
28
|
+
headings = result.first.collect(&:first)
|
29
|
+
rows = result.collect{|r| headings.collect{|h| r[h]}}
|
30
|
+
puts Terminal::Table.new headings: headings, rows: rows
|
31
|
+
else
|
32
|
+
puts Terminal::Table.new title: 'No Results'
|
33
|
+
end
|
34
|
+
else
|
35
|
+
puts result
|
27
36
|
end
|
28
37
|
end
|
29
38
|
if config.stacks
|