table_print 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.rdoc +1 -1
- data/lib/table_print/printable.rb +11 -1
- data/lib/table_print/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmZlY2QyNGI0MGRkYzExMjJhMDE1N2QwNjhkN2EzYjVkODVmNzE3OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzBmY2MwYmY2MDFlMDE1NjcwYjg3NGJjNmEwN2ViMDdiOTgzZWYzYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzcxYjFkMDBlOTZkMmZkYzljZDRkNzI2MmEwOGE4ZjBhY2NhZThjYjRmOWZm
|
10
|
+
OTdmOGNiNjBjMzIwNmM0MzVkMmE0MTdjZTc4Mjc0ZGY4OGE5NWJlMWZjNGU3
|
11
|
+
MmIzYTJmNjEzNmEwZDRjNjRlNGE5MGQxZWNhMWNlYzA1ODMyNjI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Nzg4YzdlNWM0MGRlNjc5ZDE4ZmMyODFlNTc4ZWI5ODhkZDAxYzIxMmUwYjI1
|
14
|
+
MDZmY2EyNDU5YWVjMTYwZTZlODM3MGE2NWFlYTYwOWE0MjVlMjhhZDQ0MGVh
|
15
|
+
M2MyMjgxNzUzZmJiZTJhMzU5NDhjZDcxNjQ1MGUyYzZkM2M3MDA=
|
data/README.rdoc
CHANGED
@@ -84,7 +84,7 @@ Available column options:
|
|
84
84
|
* *display_method* - string/symbol/proc - used to populate the column. Can be a method name or a proc. See below.
|
85
85
|
* *formatters* - array of objects - each will be called in turn as the cells are printed. Must define a 'format' method. See below.
|
86
86
|
* *time_format* - string - passed to strftime[http://www.ruby-doc.org/core-1.9.3/Time.html#method-i-strftime], only affects time columns
|
87
|
-
* *width* - integer - how wide you want your column.
|
87
|
+
* *width* - integer - how wide you want your column.
|
88
88
|
|
89
89
|
==== Display method
|
90
90
|
|
@@ -2,7 +2,17 @@ module TablePrint
|
|
2
2
|
module Printable
|
3
3
|
# Sniff the data class for non-standard methods to use as a baseline for display
|
4
4
|
def self.default_display_methods(target)
|
5
|
-
|
5
|
+
if target.class.respond_to? :columns
|
6
|
+
if target.class.columns.first.respond_to? :name
|
7
|
+
|
8
|
+
# eg ActiveRecord
|
9
|
+
return target.class.columns.collect(&:name)
|
10
|
+
else
|
11
|
+
|
12
|
+
# eg Sequel
|
13
|
+
return target.class.columns
|
14
|
+
end
|
15
|
+
end
|
6
16
|
|
7
17
|
# eg mongoid
|
8
18
|
return target.fields.keys if target.respond_to? :fields and target.fields.is_a? Hash
|
data/lib/table_print/version.rb
CHANGED
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
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Doyle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cat
|