table_print 1.0.0.rc3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +44 -0
- data/Gemfile +0 -10
- data/README.rdoc +2 -2
- data/Rakefile +0 -18
- data/lib/table_print.rb +17 -9
- data/lib/{cattr.rb → table_print/cattr.rb} +0 -0
- data/lib/{column.rb → table_print/column.rb} +0 -0
- data/lib/{config.rb → table_print/config.rb} +0 -2
- data/lib/{config_resolver.rb → table_print/config_resolver.rb} +0 -3
- data/lib/{fingerprinter.rb → table_print/fingerprinter.rb} +5 -5
- data/lib/{formatter.rb → table_print/formatter.rb} +0 -2
- data/lib/{hash_extensions.rb → table_print/hash_extensions.rb} +0 -0
- data/lib/{printable.rb → table_print/printable.rb} +0 -0
- data/lib/{returnable.rb → table_print/returnable.rb} +4 -0
- data/lib/{row_group.rb → table_print/row_group.rb} +4 -3
- data/lib/table_print/version.rb +4 -0
- data/spec/column_spec.rb +0 -1
- data/spec/config_resolver_spec.rb +0 -1
- data/spec/config_spec.rb +0 -1
- data/spec/fingerprinter_spec.rb +8 -3
- data/spec/formatter_spec.rb +0 -1
- data/spec/hash_extensions_spec.rb +0 -1
- data/spec/printable_spec.rb +0 -1
- data/spec/returnable_spec.rb +6 -2
- data/spec/row_group_spec.rb +26 -3
- data/spec/spec_helper.rb +2 -0
- data/table_print.gemspec +18 -85
- metadata +65 -76
- data/VERSION +0 -1
- data/lib/kernel_extensions.rb +0 -12
data/.gitignore
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
Gemfile.lock
|
2
|
+
|
3
|
+
# rcov generated
|
4
|
+
coverage
|
5
|
+
|
6
|
+
# rdoc generated
|
7
|
+
rdoc
|
8
|
+
|
9
|
+
# yard generated
|
10
|
+
doc
|
11
|
+
.yardoc
|
12
|
+
|
13
|
+
# bundler
|
14
|
+
.bundle
|
15
|
+
|
16
|
+
# jeweler generated
|
17
|
+
pkg
|
18
|
+
|
19
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
20
|
+
#
|
21
|
+
# * Create a file at ~/.gitignore
|
22
|
+
# * Include files you want ignored
|
23
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
24
|
+
#
|
25
|
+
# After doing this, these files will be ignored in all your git projects,
|
26
|
+
# saving you from having to 'pollute' every project you touch with them
|
27
|
+
#
|
28
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
29
|
+
#
|
30
|
+
# For MacOS:
|
31
|
+
#
|
32
|
+
#.DS_Store
|
33
|
+
#
|
34
|
+
# For TextMate
|
35
|
+
#*.tmproj
|
36
|
+
#tmtags
|
37
|
+
#
|
38
|
+
# For emacs:
|
39
|
+
#*~
|
40
|
+
#\#*
|
41
|
+
#.\#*
|
42
|
+
#
|
43
|
+
# For vim:
|
44
|
+
#*.swp
|
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -11,10 +11,10 @@ it assumes the objects in your array all respond to the same methods.
|
|
11
11
|
== Installation
|
12
12
|
|
13
13
|
# Install as a standalone gem
|
14
|
-
$ gem install table_print
|
14
|
+
$ gem install table_print --pre
|
15
15
|
|
16
16
|
# Install within rails
|
17
|
-
In your Gemfile: gem
|
17
|
+
In your Gemfile: gem "table_print", "~> 1.0.0.rc3
|
18
18
|
$ bundle install
|
19
19
|
|
20
20
|
== Usage
|
data/Rakefile
CHANGED
@@ -9,24 +9,6 @@ rescue Bundler::BundlerError => e
|
|
9
9
|
end
|
10
10
|
require 'rake'
|
11
11
|
|
12
|
-
require 'jeweler'
|
13
|
-
Jeweler::Tasks.new do |gem|
|
14
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
-
gem.name = "table_print"
|
16
|
-
gem.homepage = "http://github.com/arches/table_print"
|
17
|
-
gem.license = "MIT"
|
18
|
-
gem.summary = %Q{Turn objects into nicely formatted columns for easy reading}
|
19
|
-
gem.description = %Q{TablePrint formats an object or array of objects into columns for easy reading. To do this, it assumes the objects in your array all respond to the same methods (vs pretty_print or awesome_print, who can't create columns because your objects could be entirely different).}
|
20
|
-
gem.email = "archslide@gmail.com"
|
21
|
-
gem.authors = ["Chris Doyle"]
|
22
|
-
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
-
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
-
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
-
gem.add_development_dependency 'rspec'
|
26
|
-
gem.add_development_dependency 'cucumber'
|
27
|
-
end
|
28
|
-
Jeweler::RubygemsDotOrgTasks.new
|
29
|
-
|
30
12
|
require 'rspec/core/rake_task'
|
31
13
|
|
32
14
|
desc 'Default: run specs and cucumber features.'
|
data/lib/table_print.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
require '
|
7
|
-
require '
|
8
|
-
require 'printable'
|
9
|
-
require 'row_group'
|
1
|
+
require 'table_print/cattr'
|
2
|
+
require 'table_print/column'
|
3
|
+
require 'table_print/config_resolver'
|
4
|
+
require 'table_print/config'
|
5
|
+
require 'table_print/fingerprinter'
|
6
|
+
require 'table_print/formatter'
|
7
|
+
require 'table_print/hash_extensions'
|
8
|
+
require 'table_print/printable'
|
9
|
+
require 'table_print/row_group'
|
10
|
+
require 'table_print/returnable'
|
10
11
|
|
11
12
|
module TablePrint
|
12
13
|
class Printer
|
@@ -47,3 +48,10 @@ module TablePrint
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
end
|
51
|
+
|
52
|
+
def tp(data=[], *options)
|
53
|
+
start = Time.now
|
54
|
+
printer = TablePrint::Printer.new(data, options)
|
55
|
+
puts printer.table_print unless data.is_a? Class
|
56
|
+
TablePrint::Returnable.new(Time.now - start) # we have to return *something*, might as well be execution time.
|
57
|
+
end
|
File without changes
|
File without changes
|
@@ -1,6 +1,3 @@
|
|
1
|
-
require 'row_group'
|
2
|
-
require 'hash_extensions'
|
3
|
-
|
4
1
|
module TablePrint
|
5
2
|
class Fingerprinter
|
6
3
|
def lift(columns, object)
|
@@ -35,8 +32,11 @@ module TablePrint
|
|
35
32
|
cells = {}
|
36
33
|
handleable_columns(hash).each do |method|
|
37
34
|
display_method = (prefix == "" ? method : "#{prefix}.#{method}")
|
38
|
-
|
39
|
-
|
35
|
+
if method.is_a? Proc
|
36
|
+
cell_value = method.call(target)
|
37
|
+
else
|
38
|
+
cell_value ||= target.send(method)
|
39
|
+
end
|
40
40
|
cells[@column_names_by_display_method[display_method]] = cell_value
|
41
41
|
end
|
42
42
|
|
File without changes
|
File without changes
|
@@ -1,6 +1,3 @@
|
|
1
|
-
require 'formatter'
|
2
|
-
require 'column'
|
3
|
-
|
4
1
|
module TablePrint
|
5
2
|
|
6
3
|
module RowRecursion
|
@@ -151,6 +148,10 @@ module TablePrint
|
|
151
148
|
|
152
149
|
to_absorb.each do |absorbable_group|
|
153
150
|
absorbable_row = absorbable_group.children.shift
|
151
|
+
|
152
|
+
# missing associations create groups with no rows
|
153
|
+
children.delete(absorbable_group) and next unless absorbable_row
|
154
|
+
|
154
155
|
@cells.merge!(absorbable_row.cells)
|
155
156
|
|
156
157
|
i = children.index(absorbable_group)
|
data/spec/column_spec.rb
CHANGED
data/spec/config_spec.rb
CHANGED
data/spec/fingerprinter_spec.rb
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require 'ostruct'
|
3
|
-
require 'fingerprinter'
|
4
|
-
require 'column'
|
5
2
|
|
6
3
|
class TablePrint::Row
|
7
4
|
attr_accessor :groups, :cells
|
@@ -57,6 +54,14 @@ describe Fingerprinter do
|
|
57
54
|
row.children.length.should == 0
|
58
55
|
row.cells.should == {'name' => "dl crng"}
|
59
56
|
end
|
57
|
+
|
58
|
+
it "doesn't puke if a lambda returns nil" do
|
59
|
+
rows = Fingerprinter.new.lift([Column.new(:name => "name", :display_method => lambda { |row| nil })], OpenStruct.new(:name => "dale carnegie"))
|
60
|
+
rows.length.should == 1
|
61
|
+
row = rows.first
|
62
|
+
row.children.length.should == 0
|
63
|
+
row.cells.should == {'name' => nil}
|
64
|
+
end
|
60
65
|
end
|
61
66
|
|
62
67
|
describe "#hash_to_rows" do
|
data/spec/formatter_spec.rb
CHANGED
data/spec/printable_spec.rb
CHANGED
data/spec/returnable_spec.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require 'returnable'
|
3
|
-
require 'config'
|
4
2
|
|
5
3
|
describe TablePrint::Returnable do
|
6
4
|
it "returns its initialized value from its to_s method" do
|
@@ -19,5 +17,11 @@ describe TablePrint::Returnable do
|
|
19
17
|
r = TablePrint::Returnable.new
|
20
18
|
r.clear(Object)
|
21
19
|
end
|
20
|
+
|
21
|
+
it "passes #config_for through to TablePrint::Config.for" do
|
22
|
+
TablePrint::Config.should_receive(:for).with(Object)
|
23
|
+
r = TablePrint::Returnable.new
|
24
|
+
r.config_for(Object)
|
25
|
+
end
|
22
26
|
end
|
23
27
|
|
data/spec/row_group_spec.rb
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require 'ostruct'
|
3
|
-
require 'cat'
|
4
|
-
require "row_group"
|
5
2
|
|
6
3
|
include TablePrint
|
7
4
|
|
@@ -270,6 +267,32 @@ describe TablePrint::Row do
|
|
270
267
|
end
|
271
268
|
end
|
272
269
|
|
270
|
+
# row: foo
|
271
|
+
# group
|
272
|
+
# row: bar
|
273
|
+
# group
|
274
|
+
# => foo | bar |
|
275
|
+
context "for two groups, one of which has no rows (aka, we hit an empty association)" do
|
276
|
+
before(:each) do
|
277
|
+
@row = Row.new
|
278
|
+
@row.set_cell_values(:foo => "foo").add_children([
|
279
|
+
RowGroup.new.add_child(
|
280
|
+
Row.new.set_cell_values(:bar => "bar")
|
281
|
+
),
|
282
|
+
RowGroup.new
|
283
|
+
])
|
284
|
+
@row.collapse!
|
285
|
+
end
|
286
|
+
|
287
|
+
it "pulls the cells from both groups into the parent" do
|
288
|
+
@row.cells.should == {"foo" => "foo", "bar" => "bar"}
|
289
|
+
end
|
290
|
+
|
291
|
+
it "dereferences both now-defunct groups" do
|
292
|
+
@row.children.length.should == 0
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
273
296
|
# row: foo
|
274
297
|
# group
|
275
298
|
# row: bar
|
data/spec/spec_helper.rb
CHANGED
data/table_print.gemspec
CHANGED
@@ -1,91 +1,24 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/table_print/version', __FILE__)
|
5
3
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
s.version = "1.0.0.rc3"
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "table_print"
|
9
6
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
s.description = "TablePrint formats an object or array of objects into columns for easy reading. To do this, it assumes the objects in your array all respond to the same methods (vs pretty_print or awesome_print, who can't create columns because your objects could be entirely different)."
|
14
|
-
s.email = "archslide@gmail.com"
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE.txt",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".rspec",
|
22
|
-
".rvmrc",
|
23
|
-
".travis.yml",
|
24
|
-
"Gemfile",
|
25
|
-
"LICENSE.txt",
|
26
|
-
"README.rdoc",
|
27
|
-
"Rakefile",
|
28
|
-
"VERSION",
|
29
|
-
"features/adding_columns.feature",
|
30
|
-
"features/configuring_output.feature",
|
31
|
-
"features/excluding_columns.feature",
|
32
|
-
"features/sensible_defaults.feature",
|
33
|
-
"features/support/step_definitions/before.rb",
|
34
|
-
"features/support/step_definitions/steps.rb",
|
35
|
-
"lib/cattr.rb",
|
36
|
-
"lib/column.rb",
|
37
|
-
"lib/config.rb",
|
38
|
-
"lib/config_resolver.rb",
|
39
|
-
"lib/fingerprinter.rb",
|
40
|
-
"lib/formatter.rb",
|
41
|
-
"lib/hash_extensions.rb",
|
42
|
-
"lib/kernel_extensions.rb",
|
43
|
-
"lib/printable.rb",
|
44
|
-
"lib/returnable.rb",
|
45
|
-
"lib/row_group.rb",
|
46
|
-
"lib/table_print.rb",
|
47
|
-
"spec/column_spec.rb",
|
48
|
-
"spec/config_resolver_spec.rb",
|
49
|
-
"spec/config_spec.rb",
|
50
|
-
"spec/fingerprinter_spec.rb",
|
51
|
-
"spec/formatter_spec.rb",
|
52
|
-
"spec/hash_extensions_spec.rb",
|
53
|
-
"spec/printable_spec.rb",
|
54
|
-
"spec/returnable_spec.rb",
|
55
|
-
"spec/row_group_spec.rb",
|
56
|
-
"spec/spec_helper.rb",
|
57
|
-
"spec/table_print_spec.rb",
|
58
|
-
"table_print.gemspec"
|
59
|
-
]
|
60
|
-
s.homepage = "http://github.com/arches/table_print"
|
61
|
-
s.licenses = ["MIT"]
|
62
|
-
s.require_paths = ["lib"]
|
63
|
-
s.rubygems_version = "1.8.19"
|
64
|
-
s.summary = "Turn objects into nicely formatted columns for easy reading"
|
7
|
+
gem.authors = ["Chris Doyle"]
|
8
|
+
gem.email = ["archslide@gmail.com"]
|
9
|
+
gem.email = "archslide@gmail.com"
|
65
10
|
|
66
|
-
|
67
|
-
|
11
|
+
gem.description = "TablePrint formats an object or array of objects into columns for easy reading. To do this, it assumes the objects in your array all respond to the same methods (vs pretty_print or awesome_print, who can't create columns because your objects could be entirely different)."
|
12
|
+
gem.summary = "Turn objects into nicely formatted columns for easy reading"
|
13
|
+
gem.homepage = "http://tableprintgem.com"
|
14
|
+
gem.version = TablePrint::VERSION
|
68
15
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
73
|
-
s.add_development_dependency(%q<rspec>, [">= 0"])
|
74
|
-
s.add_development_dependency(%q<relish>, [">= 0"])
|
75
|
-
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
76
|
-
else
|
77
|
-
s.add_dependency(%q<bundler>, ["~> 1.1"])
|
78
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
79
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
80
|
-
s.add_dependency(%q<cucumber>, [">= 0"])
|
81
|
-
s.add_dependency(%q<relish>, [">= 0"])
|
82
|
-
end
|
83
|
-
else
|
84
|
-
s.add_dependency(%q<bundler>, ["~> 1.1"])
|
85
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
86
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
87
|
-
s.add_dependency(%q<cucumber>, [">= 0"])
|
88
|
-
s.add_dependency(%q<relish>, [">= 0"])
|
89
|
-
end
|
90
|
-
end
|
16
|
+
gem.files = `git ls-files`.split($\)
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
91
19
|
|
20
|
+
gem.add_development_dependency 'cat', '~> 0.2.1'
|
21
|
+
gem.add_development_dependency 'cucumber', '~> 1.2.1'
|
22
|
+
gem.add_development_dependency 'rspec', '~> 2.11.0'
|
23
|
+
gem.add_development_dependency 'rake', '~> 0.9.2'
|
24
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
|
11
|
-
- 3
|
12
|
-
version: 1.0.0.rc3
|
10
|
+
version: 1.0.0
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Chris Doyle
|
@@ -17,105 +15,83 @@ autorequire:
|
|
17
15
|
bindir: bin
|
18
16
|
cert_chain: []
|
19
17
|
|
20
|
-
date: 2012-
|
18
|
+
date: 2012-08-03 00:00:00 Z
|
21
19
|
dependencies:
|
22
20
|
- !ruby/object:Gem::Dependency
|
23
|
-
name:
|
21
|
+
name: cat
|
24
22
|
prerelease: false
|
25
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
24
|
none: false
|
27
25
|
requirements:
|
28
26
|
- - ~>
|
29
27
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
28
|
+
hash: 21
|
31
29
|
segments:
|
30
|
+
- 0
|
31
|
+
- 2
|
32
32
|
- 1
|
33
|
-
|
34
|
-
|
35
|
-
type: :runtime
|
33
|
+
version: 0.2.1
|
34
|
+
type: :development
|
36
35
|
version_requirements: *id001
|
37
36
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
37
|
+
name: cucumber
|
39
38
|
prerelease: false
|
40
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
40
|
none: false
|
42
41
|
requirements:
|
43
42
|
- - ~>
|
44
43
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
44
|
+
hash: 29
|
46
45
|
segments:
|
47
46
|
- 1
|
47
|
+
- 2
|
48
48
|
- 1
|
49
|
-
version:
|
49
|
+
version: 1.2.1
|
50
50
|
type: :development
|
51
51
|
version_requirements: *id002
|
52
52
|
- !ruby/object:Gem::Dependency
|
53
|
-
name:
|
53
|
+
name: rspec
|
54
54
|
prerelease: false
|
55
55
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
56
|
none: false
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - ~>
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
hash:
|
60
|
+
hash: 35
|
61
61
|
segments:
|
62
|
+
- 2
|
63
|
+
- 11
|
62
64
|
- 0
|
63
|
-
version:
|
65
|
+
version: 2.11.0
|
64
66
|
type: :development
|
65
67
|
version_requirements: *id003
|
66
68
|
- !ruby/object:Gem::Dependency
|
67
|
-
name:
|
69
|
+
name: rake
|
68
70
|
prerelease: false
|
69
71
|
requirement: &id004 !ruby/object:Gem::Requirement
|
70
72
|
none: false
|
71
73
|
requirements:
|
72
|
-
- -
|
74
|
+
- - ~>
|
73
75
|
- !ruby/object:Gem::Version
|
74
|
-
hash:
|
76
|
+
hash: 63
|
75
77
|
segments:
|
76
78
|
- 0
|
77
|
-
|
79
|
+
- 9
|
80
|
+
- 2
|
81
|
+
version: 0.9.2
|
78
82
|
type: :development
|
79
83
|
version_requirements: *id004
|
80
|
-
- !ruby/object:Gem::Dependency
|
81
|
-
name: relish
|
82
|
-
prerelease: false
|
83
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
-
none: false
|
85
|
-
requirements:
|
86
|
-
- - ">="
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
hash: 3
|
89
|
-
segments:
|
90
|
-
- 0
|
91
|
-
version: "0"
|
92
|
-
type: :development
|
93
|
-
version_requirements: *id005
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: cucumber
|
96
|
-
prerelease: false
|
97
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
|
-
requirements:
|
100
|
-
- - ">="
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
hash: 3
|
103
|
-
segments:
|
104
|
-
- 0
|
105
|
-
version: "0"
|
106
|
-
type: :development
|
107
|
-
version_requirements: *id006
|
108
84
|
description: TablePrint formats an object or array of objects into columns for easy reading. To do this, it assumes the objects in your array all respond to the same methods (vs pretty_print or awesome_print, who can't create columns because your objects could be entirely different).
|
109
85
|
email: archslide@gmail.com
|
110
86
|
executables: []
|
111
87
|
|
112
88
|
extensions: []
|
113
89
|
|
114
|
-
extra_rdoc_files:
|
115
|
-
|
116
|
-
- README.rdoc
|
90
|
+
extra_rdoc_files: []
|
91
|
+
|
117
92
|
files:
|
118
93
|
- .document
|
94
|
+
- .gitignore
|
119
95
|
- .rspec
|
120
96
|
- .rvmrc
|
121
97
|
- .travis.yml
|
@@ -123,25 +99,24 @@ files:
|
|
123
99
|
- LICENSE.txt
|
124
100
|
- README.rdoc
|
125
101
|
- Rakefile
|
126
|
-
- VERSION
|
127
102
|
- features/adding_columns.feature
|
128
103
|
- features/configuring_output.feature
|
129
104
|
- features/excluding_columns.feature
|
130
105
|
- features/sensible_defaults.feature
|
131
106
|
- features/support/step_definitions/before.rb
|
132
107
|
- features/support/step_definitions/steps.rb
|
133
|
-
- lib/cattr.rb
|
134
|
-
- lib/column.rb
|
135
|
-
- lib/config.rb
|
136
|
-
- lib/config_resolver.rb
|
137
|
-
- lib/fingerprinter.rb
|
138
|
-
- lib/formatter.rb
|
139
|
-
- lib/hash_extensions.rb
|
140
|
-
- lib/kernel_extensions.rb
|
141
|
-
- lib/printable.rb
|
142
|
-
- lib/returnable.rb
|
143
|
-
- lib/row_group.rb
|
144
108
|
- lib/table_print.rb
|
109
|
+
- lib/table_print/cattr.rb
|
110
|
+
- lib/table_print/column.rb
|
111
|
+
- lib/table_print/config.rb
|
112
|
+
- lib/table_print/config_resolver.rb
|
113
|
+
- lib/table_print/fingerprinter.rb
|
114
|
+
- lib/table_print/formatter.rb
|
115
|
+
- lib/table_print/hash_extensions.rb
|
116
|
+
- lib/table_print/printable.rb
|
117
|
+
- lib/table_print/returnable.rb
|
118
|
+
- lib/table_print/row_group.rb
|
119
|
+
- lib/table_print/version.rb
|
145
120
|
- spec/column_spec.rb
|
146
121
|
- spec/config_resolver_spec.rb
|
147
122
|
- spec/config_spec.rb
|
@@ -154,9 +129,9 @@ files:
|
|
154
129
|
- spec/spec_helper.rb
|
155
130
|
- spec/table_print_spec.rb
|
156
131
|
- table_print.gemspec
|
157
|
-
homepage: http://
|
158
|
-
licenses:
|
159
|
-
|
132
|
+
homepage: http://tableprintgem.com
|
133
|
+
licenses: []
|
134
|
+
|
160
135
|
post_install_message:
|
161
136
|
rdoc_options: []
|
162
137
|
|
@@ -174,14 +149,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
174
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
150
|
none: false
|
176
151
|
requirements:
|
177
|
-
- - "
|
152
|
+
- - ">="
|
178
153
|
- !ruby/object:Gem::Version
|
179
|
-
hash:
|
154
|
+
hash: 3
|
180
155
|
segments:
|
181
|
-
-
|
182
|
-
|
183
|
-
- 1
|
184
|
-
version: 1.3.1
|
156
|
+
- 0
|
157
|
+
version: "0"
|
185
158
|
requirements: []
|
186
159
|
|
187
160
|
rubyforge_project:
|
@@ -189,5 +162,21 @@ rubygems_version: 1.8.19
|
|
189
162
|
signing_key:
|
190
163
|
specification_version: 3
|
191
164
|
summary: Turn objects into nicely formatted columns for easy reading
|
192
|
-
test_files:
|
193
|
-
|
165
|
+
test_files:
|
166
|
+
- features/adding_columns.feature
|
167
|
+
- features/configuring_output.feature
|
168
|
+
- features/excluding_columns.feature
|
169
|
+
- features/sensible_defaults.feature
|
170
|
+
- features/support/step_definitions/before.rb
|
171
|
+
- features/support/step_definitions/steps.rb
|
172
|
+
- spec/column_spec.rb
|
173
|
+
- spec/config_resolver_spec.rb
|
174
|
+
- spec/config_spec.rb
|
175
|
+
- spec/fingerprinter_spec.rb
|
176
|
+
- spec/formatter_spec.rb
|
177
|
+
- spec/hash_extensions_spec.rb
|
178
|
+
- spec/printable_spec.rb
|
179
|
+
- spec/returnable_spec.rb
|
180
|
+
- spec/row_group_spec.rb
|
181
|
+
- spec/spec_helper.rb
|
182
|
+
- spec/table_print_spec.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.0.0.rc3
|
data/lib/kernel_extensions.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'returnable'
|
2
|
-
|
3
|
-
module Kernel
|
4
|
-
def tp(data=[], *options)
|
5
|
-
start = Time.now
|
6
|
-
printer = TablePrint::Printer.new(data, options)
|
7
|
-
puts printer.table_print unless data.is_a? Class
|
8
|
-
TablePrint::Returnable.new(Time.now - start) # we have to return *something*, might as well be execution time.
|
9
|
-
end
|
10
|
-
|
11
|
-
module_function :tp
|
12
|
-
end
|