awsome 0.0.62 → 0.0.63

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.
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: