table_print 1.5.4 → 1.5.5

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: 9640d93b07847eee78c007820b94ab7b5e8a7aea
4
- data.tar.gz: f6d2a835d026daba780157e4b1ee41bfc532e244
3
+ metadata.gz: 75f0b161cc29a2e227d625e00c76364946cc5e11
4
+ data.tar.gz: 179532ca5df6f983c329cab1f477dc847f35e7ac
5
5
  SHA512:
6
- metadata.gz: d0e22e56b6653bb744541a93075d3183f926580ca0c254b1838ddcf1085d38f4a508f4194af1aa419c39c86505116fbad6d3071240fcc24c5b3734e52230b790
7
- data.tar.gz: 552909c7c725776da8c02e906accbbc4ce7278c9fcdd535bdb78a60be882672a4b47f11a01d08c31359f08a2809c86e0525714b3e247ca77bee1558243108f23
6
+ metadata.gz: 808d2426a172902d3d9bbf7c9b084107f43607927e6e5f9fcd4bca9303158a0a35c921718c7e536b6bdef4b324c32ee510879b448f86b3efd485ad390709daf6
7
+ data.tar.gz: dd0dba14399110e1c2e6f08c5735f812dea8ac22992685dc8ea2e48ee69e0ab98561d32acf5e96efba4a8a56fd30966abc8ff4111e1b52a18463acaf175c3330
@@ -1,9 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
- - 1.9.2
5
- - 1.9.3
6
- - 2.0.0
3
+ - 2.0
4
+ - 2.2.4
7
5
  - jruby-18mode
8
6
  - jruby-19mode
9
7
  - rbx-2
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Chris Doyle
1
+ Copyright (c) 2012-2016 Chris Doyle
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -10,6 +10,8 @@ see exactly the data you care about.
10
10
  This {three minute screencast}[http://tableprintgem.com] will give you a quick overview of table_print's most
11
11
  powerful features and how to use them.
12
12
 
13
+ http://arches.io/tp_example.gif
14
+
13
15
  == Installation
14
16
 
15
17
  # Install as a standalone gem
@@ -13,6 +13,49 @@ Feature: Configuring output
13
13
  ------|-----------------------------------------
14
14
  post! | Ryan Ryan Ryan Ryan Ryan Ryan Ryan Ry...
15
15
  """
16
+
17
+ Scenario: Setting a minimum width for an individual column
18
+ Given a class named Blog
19
+
20
+ Given Blog has attributes title, author
21
+
22
+ When I instantiate a Blog with {:title => "post!", :author => 'Ryan Ryan'}
23
+ And table_print Blog, {:include => {:author => {:min_width => 40}}}
24
+ Then the output should contain
25
+ """
26
+ TITLE | AUTHOR
27
+ ------|-----------------------------------------
28
+ post! | Ryan Ryan
29
+ """
30
+
31
+ Scenario: Setting a fixed width for an individual column, when data width is greater than fixed width
32
+ Given a class named Blog
33
+
34
+ Given Blog has attributes title, author
35
+
36
+ When I instantiate a Blog with {:title => "post!", :author => 'Ryan Ryan Ryan Ryan Ryan Ryan Ryan'}
37
+ And table_print Blog, {:include => {:author => {:fixed_width => 15}}}
38
+ Then the output should contain
39
+ """
40
+ TITLE | AUTHOR
41
+ ------|----------------
42
+ post! | Ryan Ryan Ry...
43
+ """
44
+
45
+ Scenario: Setting a fixed width for an individual column, when data width is less than fixed width
46
+ Given a class named Blog
47
+
48
+ Given Blog has attributes title, author
49
+
50
+ When I instantiate a Blog with {:title => "post!", :author => 'Ryan Ryan'}
51
+ And table_print Blog, {:include => {:author => {:fixed_width => 15}}}
52
+ Then the output should contain
53
+ """
54
+ TITLE | AUTHOR
55
+ ------|----------------
56
+ post! | Ryan Ryan
57
+ """
58
+
16
59
  Scenario: Specifying configuration on a per-object basis
17
60
  Given a class named Blog
18
61
 
@@ -1,7 +1,7 @@
1
1
  module TablePrint
2
2
  class Column
3
3
  attr_reader :formatters
4
- attr_accessor :name, :data, :time_format, :default_width
4
+ attr_accessor :name, :data, :time_format, :default_width, :min_width, :fixed_width
5
5
 
6
6
  def initialize(attr_hash={})
7
7
  @formatters = []
@@ -48,7 +48,10 @@ module TablePrint
48
48
  end
49
49
 
50
50
  def width
51
- [(default_width || max_width), data_width].min
51
+ return fixed_width if fixed_width
52
+
53
+ width = [(default_width || max_width), data_width].min
54
+ [(min_width || 0), width].max
52
55
  end
53
56
 
54
57
  private
@@ -1,4 +1,4 @@
1
1
  module TablePrint
2
- VERSION = "1.5.4"
2
+ VERSION = "1.5.5"
3
3
  end
4
4
 
@@ -5,8 +5,8 @@ Gem::Specification.new do |gem|
5
5
  gem.name = "table_print"
6
6
 
7
7
  gem.authors = ["Chris Doyle"]
8
- gem.email = ["archslide@gmail.com"]
9
- gem.email = "archslide@gmail.com"
8
+ gem.email = ["chris@arches.io"]
9
+ gem.email = "chris@arches.io"
10
10
 
11
11
  gem.description = "TablePrint turns objects into nicely formatted columns for easy reading. Works great in rails console, works on pure ruby objects, autodetects columns, lets you traverse ActiveRecord associations. Simple, powerful."
12
12
  gem.summary = "Turn objects into nicely formatted columns for easy reading"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_print
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Doyle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-12 00:00:00.000000000 Z
11
+ date: 2016-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cat
@@ -69,7 +69,7 @@ dependencies:
69
69
  description: TablePrint turns objects into nicely formatted columns for easy reading.
70
70
  Works great in rails console, works on pure ruby objects, autodetects columns, lets
71
71
  you traverse ActiveRecord associations. Simple, powerful.
72
- email: archslide@gmail.com
72
+ email: chris@arches.io
73
73
  executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  requirements: []
136
136
  rubyforge_project:
137
- rubygems_version: 2.0.14
137
+ rubygems_version: 2.4.8
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: Turn objects into nicely formatted columns for easy reading