awsome 0.0.62 → 0.0.63

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/awsome.rb +12 -3
  2. metadata +1 -1
@@ -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
- case result
25
- when String then puts result
26
- else ap result # print a table perhaps..
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awsome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.62
4
+ version: 0.0.63
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: