table_print 1.5.0 → 1.5.1

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTQ1ZjViN2VjOGYxYWYyYjRlN2U5NzM1NzExNzg5YjYxYjk1NzEwNA==
4
+ YmZlY2QyNGI0MGRkYzExMjJhMDE1N2QwNjhkN2EzYjVkODVmNzE3OA==
5
5
  data.tar.gz: !binary |-
6
- NWY1ZGU3OGRmNzQ0OGZiNDRmZmNkYjUyYzRkNjlkN2VjZmQ0MmI5MA==
6
+ MzBmY2MwYmY2MDFlMDE1NjcwYjg3NGJjNmEwN2ViMDdiOTgzZWYzYg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTYxZjUwNjFhYzdlYzViODJmOWViMzE1ODRjMzU0OGQ5ZjlhZjkwOWYwZjRm
10
- NjY4ZmUxNWI4ODljNWQ0YWIyOWQ1MGZkMmNmNWI2ZWJhOTMxNDQ3MzgyNTZi
11
- MjE5NGMwOTdiMGNlOTE1YTc1YzA4ZDk4MGQxNTA4M2ZmNDBmOGI=
9
+ NzcxYjFkMDBlOTZkMmZkYzljZDRkNzI2MmEwOGE4ZjBhY2NhZThjYjRmOWZm
10
+ OTdmOGNiNjBjMzIwNmM0MzVkMmE0MTdjZTc4Mjc0ZGY4OGE5NWJlMWZjNGU3
11
+ MmIzYTJmNjEzNmEwZDRjNjRlNGE5MGQxZWNhMWNlYzA1ODMyNjI=
12
12
  data.tar.gz: !binary |-
13
- N2NlZTk0MWNlNzlkNDExNGJkNDZjZWFiNjI1YmE2OTA5NjIwYTdkMTliYThm
14
- NDExNTU4YzVhMWJmY2FiZDgxNzcxMjQwOTA3NzE5YTAxNDRmY2ZjODk0Mzc2
15
- NzIxNDk2YTA2MDQ5ODVkNWM2YTMwNDE0ZTk1YmJmYTA3NDE5MGE=
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. Currently cannot exceed max_width.
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
- return target.class.columns.collect(&:name) if target.class.respond_to? :columns
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
@@ -1,4 +1,4 @@
1
1
  module TablePrint
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.1"
3
3
  end
4
4
 
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.0
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-12 00:00:00.000000000 Z
11
+ date: 2013-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cat