acclimate 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e41ee6465765dca494bcc999a2e8cd628670d715
4
- data.tar.gz: c1996192310f7d97be234f5d4dbc35d9d77c7bec
3
+ metadata.gz: f9a4c3bc077579e2648e609b4651dc0142ed3bd6
4
+ data.tar.gz: 105a9552237ea3a41d39f8f98b9730cf61344b98
5
5
  SHA512:
6
- metadata.gz: c7d1d0e384747f13e557db035427f8d03362bde65ee24f289b76f6658947662735d13f396d5ba3e1cb04cc1cb9bf8dd64de6094e2d16abf95153713e0c2d2373
7
- data.tar.gz: b9ced6240405fadc345335efa888807bdb1becd60aae8c418e373e427967e55405d77df57c8ddf8be3940d2cc13f23a3930c41de201009b70ad62cf8d94f1550
6
+ metadata.gz: 24dcc0983a6b2e0b0685874d4dd05a7c59146e617f6e81e670660b4fd589a6d4414443a587281b9d24cdf5f6e98c6630f4b1cb81eec12ff407d4240244f6219c
7
+ data.tar.gz: 4d3db4edf6f1d2528670b263e8cddf62449cb07b89823f226007fab5b7b48a829ae0a276b83e6b2adb5b3859dc212776079409d3d4e75ca5375a39b2cd61d1d2
@@ -3,6 +3,8 @@ require 'command_line_reporter'
3
3
  module Acclimate
4
4
  class Formatter
5
5
 
6
+ extend Autoloaded
7
+
6
8
  include CommandLineReporter
7
9
 
8
10
  def render
@@ -0,0 +1,56 @@
1
+ module Acclimate
2
+ class Formatter
3
+ class EntityTable < Acclimate::Formatter
4
+
5
+ def render
6
+ renderred
7
+ end
8
+
9
+ protected
10
+
11
+ def renderred
12
+ @renderred ||= capture do
13
+ table do
14
+ attributes.each do |attr|
15
+ row do
16
+ column label_column_value( attr ), label_column_options
17
+ column val_column_value( attr ), val_column_options
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ def label_column_value( attr )
25
+ attr
26
+ end
27
+
28
+ def label_column_options
29
+ {
30
+ align: 'right',
31
+ color: :cyan,
32
+ width: col_width
33
+ }
34
+ end
35
+
36
+ def val_column_value( attr )
37
+ send( attr )
38
+ end
39
+
40
+ def val_column_options
41
+ {
42
+ width: 50
43
+ }
44
+ end
45
+
46
+ def attributes
47
+ raise NotImplementedError
48
+ end
49
+
50
+ def col_width
51
+ @col_width ||= attributes.map( &:size ).max + 0
52
+ end
53
+
54
+ end
55
+ end
56
+ end
@@ -1,3 +1,5 @@
1
+ require 'command_line_reporter'
2
+
1
3
  module Acclimate
2
4
  module ShellHelper
3
5
 
@@ -1,3 +1,3 @@
1
1
  module Acclimate
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acclimate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - C. Jason Harrelson (midas )
@@ -159,6 +159,7 @@ files:
159
159
  - lib/acclimate/env.rb
160
160
  - lib/acclimate/error.rb
161
161
  - lib/acclimate/formatter.rb
162
+ - lib/acclimate/formatter/entity_table.rb
162
163
  - lib/acclimate/output.rb
163
164
  - lib/acclimate/shell_helper.rb
164
165
  - lib/acclimate/version.rb