text-table 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,13 @@
1
+ === 1.0.1 (2009-12-21)
2
+
3
+ * Initial stable release.
4
+
5
+ === 1.1.0 (2009-12-28)
6
+
7
+ * Centered headers by default.
8
+ * Revamped specs and made them more extensive.
9
+
10
+ === 1.2.0 (2010-01-05)
11
+
12
+ * Added an easy way to align columns.
13
+ * Fixed compatibility with Ruby 1.8.6
@@ -9,6 +9,8 @@ Allows you to easily create and format plain text tables,
9
9
  useful when working with the terminal
10
10
  or when you want to quickly print formatted tables to a dot-matrix printer.
11
11
 
12
+ Text::Table is compatible with Ruby 1.8.6, 1.8.7 and 1.9.1 and includes a comprehensive test suite.
13
+
12
14
  This project was heavily inspired by visionmedia's terminal-table, and to a lesser-extent, by prawn, ruport and hirb.
13
15
  I initially wanted to add more features to terminal-table (footer, separators between rows, etc)
14
16
  and to fix a then alignment issue with spanned columns.
@@ -129,6 +131,27 @@ Cells and footers are aligned to the left by default, while headers are centered
129
131
  # | a4 |
130
132
  # +-----------+-----------+
131
133
 
134
+ There's also an easy way to align columns:
135
+
136
+ table = Text::Table.new :rows => [%w(a bb), %w(aa bbb), %w(aaa b)]
137
+ puts table
138
+
139
+ # +-----+-----+
140
+ # | a | bb |
141
+ # | aa | bbb |
142
+ # | aaa | b |
143
+ # +-----+-----+
144
+
145
+ table.align_column 2, :right
146
+
147
+ # +-----+-----+
148
+ # | a | bb |
149
+ # | aa | bbb |
150
+ # | aaa | b |
151
+ # +-----+-----+
152
+
153
+ Note that headers, spanned cells and cells with explicit alignments are not affected by <tt>align_column</tt>.
154
+
132
155
 
133
156
  == Adding a Separator
134
157
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -1,3 +1,3 @@
1
- %w(table row cell enumerable).each do |lib|
1
+ %w(table row cell enumerable symbol).each do |lib|
2
2
  require File.join(File.dirname(__FILE__), 'text-table', lib)
3
3
  end
@@ -39,11 +39,11 @@ module Text #:nodoc:
39
39
  end
40
40
 
41
41
  def column_index #:nodoc:
42
- row.cells[0...row.cells.index(self)].map(&:colspan).reduce(0, :+)
42
+ row.cells[0...row.cells.index(self)].map(&:colspan).inject(0, &:+)
43
43
  end
44
44
 
45
45
  def cell_width #:nodoc:
46
- colspan.times.map {|i| table.column_widths[column_index + i]}.reduce(:+) + (colspan - 1)*(2*table.horizontal_padding + table.horizontal_boundary.length)
46
+ (0...colspan).map {|i| table.column_widths[column_index + i]}.inject(&:+) + (colspan - 1)*(2*table.horizontal_padding + table.horizontal_boundary.length)
47
47
  end
48
48
 
49
49
  end
@@ -21,7 +21,7 @@ module Text #:nodoc:
21
21
  table.separator
22
22
  else
23
23
  ([table.horizontal_boundary] * 2).join(
24
- cells.map(&:to_s).join table.horizontal_boundary
24
+ cells.map(&:to_s).join(table.horizontal_boundary)
25
25
  ) + "\n"
26
26
  end
27
27
  end
@@ -0,0 +1,14 @@
1
+ unless :to_proc.respond_to?(:to_proc)
2
+ class Symbol
3
+ # Turns the symbol into a simple proc, which is especially useful for enumerations. Examples:
4
+ #
5
+ # # The same as people.collect { |p| p.name }
6
+ # people.collect(&:name)
7
+ #
8
+ # # The same as people.select { |p| p.manager? }.collect { |p| p.salary }
9
+ # people.select(&:manager?).collect(&:salary)
10
+ def to_proc
11
+ Proc.new { |*args| args.shift.__send__(self, *args) }
12
+ end
13
+ end
14
+ end
@@ -134,9 +134,8 @@ module Text #:nodoc:
134
134
  end
135
135
 
136
136
  def text_table_head #:nodoc:
137
- defaults = {:align => :center}
138
137
  Row.new(
139
- head.map {|h| defaults.merge(h.is_a?(Hash) ? h : {:value => h})},
138
+ head.map {|h| hashify(h, {:align => :center})},
140
139
  self
141
140
  ) if head
142
141
  end
@@ -160,7 +159,7 @@ module Text #:nodoc:
160
159
 
161
160
  def separator #:nodoc:
162
161
  ([@boundary_intersection] * 2).join(
163
- column_widths.map {|column_width| @vertical_boundary * (column_width + 2*@horizontal_padding)}.join @boundary_intersection
162
+ column_widths.map {|column_width| @vertical_boundary * (column_width + 2*@horizontal_padding)}.join(@boundary_intersection)
164
163
  ) + "\n"
165
164
  end
166
165
 
@@ -173,5 +172,44 @@ module Text #:nodoc:
173
172
  rendered_rows.join
174
173
  end
175
174
 
175
+ # Aligns the cells and the footer of a column.
176
+ #
177
+ # table = Text::Table.new :rows => [%w(a bb), %w(aa bbb), %w(aaa b)]
178
+ # puts table
179
+ #
180
+ # # +-----+-----+
181
+ # # | a | bb |
182
+ # # | aa | bbb |
183
+ # # | aaa | b |
184
+ # # +-----+-----+
185
+ #
186
+ # table.align_column 2, :right
187
+ #
188
+ # # +-----+-----+
189
+ # # | a | bb |
190
+ # # | aa | bbb |
191
+ # # | aaa | b |
192
+ # # +-----+-----+
193
+ #
194
+ # Note that headers, spanned cells and cells with explicit alignments are not affected by <tt>align_column</tt>.
195
+ #
196
+ def align_column(column_number, alignment)
197
+ set_alignment = Proc.new do |row, column_number, alignment|
198
+ cell = row.find do |cell|
199
+ row[0...row.index(cell)].map {|cell| cell.is_a?(Hash) ? cell[:colspan] || 1 : 1}.inject(0, &:+) == column_number - 1
200
+ end
201
+ row[row.index(cell)] = hashify(cell, {:align => alignment}) if cell and not (cell.is_a?(Hash) && cell[:colspan].to_i > 0)
202
+ end
203
+ rows.each do |row|
204
+ set_alignment.call(row, column_number, alignment)
205
+ end
206
+ set_alignment.call(foot, column_number, alignment) if foot
207
+ return self
208
+ end
209
+
210
+ def hashify(cell, defaults = {}) #:nodoc:
211
+ defaults.merge(cell.is_a?(Hash) ? cell : {:value => cell})
212
+ end
213
+
176
214
  end
177
215
  end
@@ -1,20 +1,15 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe Enumerable do
4
- before(:each) do
5
- @arr = [
6
- [11, 2, 3333],
7
- [44, 56, 6],
8
- [7, 888, 99],
9
- ]
10
- @hsh = {
11
- :k => 'vv',
12
- :kk => 'v',
13
- 'k' => :vv
14
- }
15
- end
16
-
17
4
  describe Array do
5
+ before(:each) do
6
+ @arr = [
7
+ [11, 2, 3333],
8
+ [44, 56, 6],
9
+ [7, 888, 99],
10
+ ]
11
+ end
12
+
18
13
  it "to Text::Table" do
19
14
  @arr.to_text_table.to_s.should == <<-EOS.deindent
20
15
  +----+-----+------+
@@ -59,35 +54,38 @@ describe Enumerable do
59
54
  end
60
55
 
61
56
  describe Hash do
57
+ before(:each) do
58
+ @hsh = {
59
+ :k => 'vv',
60
+ 'k' => :vv
61
+ }
62
+ end
62
63
  it "to Text::Table" do
63
64
  @hsh.to_text_table.to_s.should == <<-EOS.deindent
64
- +----+----+
65
- | k | vv |
66
- | kk | v |
67
- | k | vv |
68
- +----+----+
65
+ +---+----+
66
+ | k | vv |
67
+ | k | vv |
68
+ +---+----+
69
69
  EOS
70
70
  end
71
71
 
72
72
  it "to Text::Table, setting first row as head" do
73
73
  @hsh.to_text_table(:first_row_is_head => true).to_s.should == <<-EOS.deindent
74
- +----+----+
75
- | k | vv |
76
- +----+----+
77
- | kk | v |
78
- | k | vv |
79
- +----+----+
74
+ +---+----+
75
+ | k | vv |
76
+ +---+----+
77
+ | k | vv |
78
+ +---+----+
80
79
  EOS
81
80
  end
82
81
 
83
82
  it "to Text::Table, setting last row as foot" do
84
83
  @hsh.to_text_table(:last_row_is_foot => true).to_s.should == <<-EOS.deindent
85
- +----+----+
86
- | k | vv |
87
- | kk | v |
88
- +----+----+
89
- | k | vv |
90
- +----+----+
84
+ +---+----+
85
+ | k | vv |
86
+ +---+----+
87
+ | k | vv |
88
+ +---+----+
91
89
  EOS
92
90
  end
93
91
  end
@@ -52,6 +52,8 @@ describe Text::Table do
52
52
  EOS
53
53
  end
54
54
 
55
+ it 'rows with unequal number of cells'
56
+
55
57
  it 'headers' do
56
58
  @table = Text::Table.new :rows => @rows, :head => @head
57
59
  @table.to_s.should == <<-EOS.deindent
@@ -279,89 +281,89 @@ describe Text::Table do
279
281
  describe '2 cells aligned to the' do
280
282
  it 'left' do
281
283
  @table.rows << ['a', 'b', {:value => 'x', :colspan => 2}]
282
- @table.to_s.should == <<-EOS.deindent
283
- +------+------+------+------+
284
- | a | bb | ccc | dddd |
285
- +------+------+------+------+
286
- | aa | bbb | cccc | d |
287
- | aaa | bbbb | c | dd |
288
- | a | b | x |
289
- +------+------+------+------+
290
- | aaaa | b | cc | ddd |
291
- +------+------+------+------+
292
- EOS
284
+ @table.to_s.should == <<-EOS.deindent
285
+ +------+------+------+------+
286
+ | a | bb | ccc | dddd |
287
+ +------+------+------+------+
288
+ | aa | bbb | cccc | d |
289
+ | aaa | bbbb | c | dd |
290
+ | a | b | x |
291
+ +------+------+------+------+
292
+ | aaaa | b | cc | ddd |
293
+ +------+------+------+------+
294
+ EOS
293
295
  end
294
296
  it 'center' do
295
297
  @table.rows << ['a', 'b', {:value => 'x', :colspan => 2, :align => :center}]
296
- @table.to_s.should == <<-EOS.deindent
297
- +------+------+------+------+
298
- | a | bb | ccc | dddd |
299
- +------+------+------+------+
300
- | aa | bbb | cccc | d |
301
- | aaa | bbbb | c | dd |
302
- | a | b | x |
303
- +------+------+------+------+
304
- | aaaa | b | cc | ddd |
305
- +------+------+------+------+
306
- EOS
298
+ @table.to_s.should == <<-EOS.deindent
299
+ +------+------+------+------+
300
+ | a | bb | ccc | dddd |
301
+ +------+------+------+------+
302
+ | aa | bbb | cccc | d |
303
+ | aaa | bbbb | c | dd |
304
+ | a | b | x |
305
+ +------+------+------+------+
306
+ | aaaa | b | cc | ddd |
307
+ +------+------+------+------+
308
+ EOS
307
309
  end
308
310
  it 'right' do
309
311
  @table.rows << ['a', 'b', {:value => 'x', :colspan => 2, :align => :right}]
310
- @table.to_s.should == <<-EOS.deindent
311
- +------+------+------+------+
312
- | a | bb | ccc | dddd |
313
- +------+------+------+------+
314
- | aa | bbb | cccc | d |
315
- | aaa | bbbb | c | dd |
316
- | a | b | x |
317
- +------+------+------+------+
318
- | aaaa | b | cc | ddd |
319
- +------+------+------+------+
320
- EOS
312
+ @table.to_s.should == <<-EOS.deindent
313
+ +------+------+------+------+
314
+ | a | bb | ccc | dddd |
315
+ +------+------+------+------+
316
+ | aa | bbb | cccc | d |
317
+ | aaa | bbbb | c | dd |
318
+ | a | b | x |
319
+ +------+------+------+------+
320
+ | aaaa | b | cc | ddd |
321
+ +------+------+------+------+
322
+ EOS
321
323
  end
322
324
  end
323
325
  describe '3 cells aligned to the' do
324
326
  it 'left' do
325
327
  @table.rows << ['a', {:value => 'x', :colspan => 3}]
326
- @table.to_s.should == <<-EOS.deindent
327
- +------+------+------+------+
328
- | a | bb | ccc | dddd |
329
- +------+------+------+------+
330
- | aa | bbb | cccc | d |
331
- | aaa | bbbb | c | dd |
332
- | a | x |
333
- +------+------+------+------+
334
- | aaaa | b | cc | ddd |
335
- +------+------+------+------+
336
- EOS
328
+ @table.to_s.should == <<-EOS.deindent
329
+ +------+------+------+------+
330
+ | a | bb | ccc | dddd |
331
+ +------+------+------+------+
332
+ | aa | bbb | cccc | d |
333
+ | aaa | bbbb | c | dd |
334
+ | a | x |
335
+ +------+------+------+------+
336
+ | aaaa | b | cc | ddd |
337
+ +------+------+------+------+
338
+ EOS
337
339
  end
338
340
  it 'center' do
339
341
  @table.rows << ['a', {:value => 'x', :colspan => 3, :align => :center}]
340
- @table.to_s.should == <<-EOS.deindent
341
- +------+------+------+------+
342
- | a | bb | ccc | dddd |
343
- +------+------+------+------+
344
- | aa | bbb | cccc | d |
345
- | aaa | bbbb | c | dd |
346
- | a | x |
347
- +------+------+------+------+
348
- | aaaa | b | cc | ddd |
349
- +------+------+------+------+
350
- EOS
342
+ @table.to_s.should == <<-EOS.deindent
343
+ +------+------+------+------+
344
+ | a | bb | ccc | dddd |
345
+ +------+------+------+------+
346
+ | aa | bbb | cccc | d |
347
+ | aaa | bbbb | c | dd |
348
+ | a | x |
349
+ +------+------+------+------+
350
+ | aaaa | b | cc | ddd |
351
+ +------+------+------+------+
352
+ EOS
351
353
  end
352
354
  it 'right' do
353
355
  @table.rows << ['a', {:value => 'x', :colspan => 3, :align => :right}]
354
- @table.to_s.should == <<-EOS.deindent
355
- +------+------+------+------+
356
- | a | bb | ccc | dddd |
357
- +------+------+------+------+
358
- | aa | bbb | cccc | d |
359
- | aaa | bbbb | c | dd |
360
- | a | x |
361
- +------+------+------+------+
362
- | aaaa | b | cc | ddd |
363
- +------+------+------+------+
364
- EOS
356
+ @table.to_s.should == <<-EOS.deindent
357
+ +------+------+------+------+
358
+ | a | bb | ccc | dddd |
359
+ +------+------+------+------+
360
+ | aa | bbb | cccc | d |
361
+ | aaa | bbbb | c | dd |
362
+ | a | x |
363
+ +------+------+------+------+
364
+ | aaaa | b | cc | ddd |
365
+ +------+------+------+------+
366
+ EOS
365
367
  end
366
368
  end
367
369
  end
@@ -369,91 +371,116 @@ describe Text::Table do
369
371
  describe '2 cells aligned to the' do
370
372
  it 'left' do
371
373
  @table.rows << [{:value => 'x', :colspan => 2}, 'c', 'd']
372
- @table.to_s.should == <<-EOS.deindent
373
- +------+------+------+------+
374
- | a | bb | ccc | dddd |
375
- +------+------+------+------+
376
- | aa | bbb | cccc | d |
377
- | aaa | bbbb | c | dd |
378
- | x | c | d |
379
- +------+------+------+------+
380
- | aaaa | b | cc | ddd |
381
- +------+------+------+------+
382
- EOS
374
+ @table.to_s.should == <<-EOS.deindent
375
+ +------+------+------+------+
376
+ | a | bb | ccc | dddd |
377
+ +------+------+------+------+
378
+ | aa | bbb | cccc | d |
379
+ | aaa | bbbb | c | dd |
380
+ | x | c | d |
381
+ +------+------+------+------+
382
+ | aaaa | b | cc | ddd |
383
+ +------+------+------+------+
384
+ EOS
383
385
  end
384
386
  it 'center' do
385
387
  @table.rows << [{:value => 'x', :colspan => 2, :align => :center}, 'c', 'd']
386
- @table.to_s.should == <<-EOS.deindent
387
- +------+------+------+------+
388
- | a | bb | ccc | dddd |
389
- +------+------+------+------+
390
- | aa | bbb | cccc | d |
391
- | aaa | bbbb | c | dd |
392
- | x | c | d |
393
- +------+------+------+------+
394
- | aaaa | b | cc | ddd |
395
- +------+------+------+------+
396
- EOS
388
+ @table.to_s.should == <<-EOS.deindent
389
+ +------+------+------+------+
390
+ | a | bb | ccc | dddd |
391
+ +------+------+------+------+
392
+ | aa | bbb | cccc | d |
393
+ | aaa | bbbb | c | dd |
394
+ | x | c | d |
395
+ +------+------+------+------+
396
+ | aaaa | b | cc | ddd |
397
+ +------+------+------+------+
398
+ EOS
397
399
  end
398
400
  it 'right' do
399
401
  @table.rows << [{:value => 'x', :colspan => 2, :align => :right}, 'c', 'd']
400
- @table.to_s.should == <<-EOS.deindent
401
- +------+------+------+------+
402
- | a | bb | ccc | dddd |
403
- +------+------+------+------+
404
- | aa | bbb | cccc | d |
405
- | aaa | bbbb | c | dd |
406
- | x | c | d |
407
- +------+------+------+------+
408
- | aaaa | b | cc | ddd |
409
- +------+------+------+------+
410
- EOS
402
+ @table.to_s.should == <<-EOS.deindent
403
+ +------+------+------+------+
404
+ | a | bb | ccc | dddd |
405
+ +------+------+------+------+
406
+ | aa | bbb | cccc | d |
407
+ | aaa | bbbb | c | dd |
408
+ | x | c | d |
409
+ +------+------+------+------+
410
+ | aaaa | b | cc | ddd |
411
+ +------+------+------+------+
412
+ EOS
411
413
  end
412
414
  end
413
415
  describe '3 cells aligned to the' do
414
416
  it 'left' do
415
417
  @table.rows << [{:value => 'x', :colspan => 3}, 'd']
416
- @table.to_s.should == <<-EOS.deindent
417
- +------+------+------+------+
418
- | a | bb | ccc | dddd |
419
- +------+------+------+------+
420
- | aa | bbb | cccc | d |
421
- | aaa | bbbb | c | dd |
422
- | x | d |
423
- +------+------+------+------+
424
- | aaaa | b | cc | ddd |
425
- +------+------+------+------+
426
- EOS
418
+ @table.to_s.should == <<-EOS.deindent
419
+ +------+------+------+------+
420
+ | a | bb | ccc | dddd |
421
+ +------+------+------+------+
422
+ | aa | bbb | cccc | d |
423
+ | aaa | bbbb | c | dd |
424
+ | x | d |
425
+ +------+------+------+------+
426
+ | aaaa | b | cc | ddd |
427
+ +------+------+------+------+
428
+ EOS
427
429
  end
428
430
  it 'center' do
429
431
  @table.rows << [{:value => 'x', :colspan => 3, :align => :center}, 'd']
430
- @table.to_s.should == <<-EOS.deindent
431
- +------+------+------+------+
432
- | a | bb | ccc | dddd |
433
- +------+------+------+------+
434
- | aa | bbb | cccc | d |
435
- | aaa | bbbb | c | dd |
436
- | x | d |
437
- +------+------+------+------+
438
- | aaaa | b | cc | ddd |
439
- +------+------+------+------+
440
- EOS
432
+ @table.to_s.should == <<-EOS.deindent
433
+ +------+------+------+------+
434
+ | a | bb | ccc | dddd |
435
+ +------+------+------+------+
436
+ | aa | bbb | cccc | d |
437
+ | aaa | bbbb | c | dd |
438
+ | x | d |
439
+ +------+------+------+------+
440
+ | aaaa | b | cc | ddd |
441
+ +------+------+------+------+
442
+ EOS
441
443
  end
442
444
  it 'right' do
443
445
  @table.rows << [{:value => 'x', :colspan => 3, :align => :right}, 'd']
444
- @table.to_s.should == <<-EOS.deindent
445
- +------+------+------+------+
446
- | a | bb | ccc | dddd |
447
- +------+------+------+------+
448
- | aa | bbb | cccc | d |
449
- | aaa | bbbb | c | dd |
450
- | x | d |
451
- +------+------+------+------+
452
- | aaaa | b | cc | ddd |
453
- +------+------+------+------+
454
- EOS
446
+ @table.to_s.should == <<-EOS.deindent
447
+ +------+------+------+------+
448
+ | a | bb | ccc | dddd |
449
+ +------+------+------+------+
450
+ | aa | bbb | cccc | d |
451
+ | aaa | bbbb | c | dd |
452
+ | x | d |
453
+ +------+------+------+------+
454
+ | aaaa | b | cc | ddd |
455
+ +------+------+------+------+
456
+ EOS
455
457
  end
456
458
  end
457
459
  end
458
460
  end
461
+
462
+ describe 'should easily allow alignment of' do
463
+ it 'columns' do
464
+ @table.rows[1][2] = {:value => 'c', :align => :center}
465
+ @table.rows << [{:value => 'x', :colspan => 2}, 'c', 'd']
466
+ @table.rows << ['a', 'b', {:value => 'x', :colspan => 2}]
467
+ @table.align_column 2, :right
468
+ @table.align_column 3, :right
469
+ @table.to_s.should == <<-EOS.deindent
470
+ +------+------+------+------+
471
+ | a | bb | ccc | dddd |
472
+ +------+------+------+------+
473
+ | aa | bbb | cccc | d |
474
+ | aaa | bbbb | c | dd |
475
+ | x | c | d |
476
+ | a | b | x |
477
+ +------+------+------+------+
478
+ | aaaa | b | cc | ddd |
479
+ +------+------+------+------+
480
+ EOS
481
+ end
482
+ it 'rows'
483
+ it 'headers'
484
+ it 'footers'
485
+ end
459
486
  end
@@ -0,0 +1,65 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{text-table}
8
+ s.version = "1.2.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Aaron Tinio"]
12
+ s.date = %q{2010-01-05}
13
+ s.description = %q{Allows you to easily create and format plain text tables, useful when working with the terminal or when you want to quickly print formatted tables to a dot-matrix printer.}
14
+ s.email = %q{aptinio@yahoo.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "CHANGELOG.rdoc",
23
+ "LICENSE",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "lib/text-table.rb",
28
+ "lib/text-table/cell.rb",
29
+ "lib/text-table/enumerable.rb",
30
+ "lib/text-table/row.rb",
31
+ "lib/text-table/symbol.rb",
32
+ "lib/text-table/table.rb",
33
+ "spec/cell_spec.rb",
34
+ "spec/enumerable_spec.rb",
35
+ "spec/spec.opts",
36
+ "spec/spec_helper.rb",
37
+ "spec/table_spec.rb",
38
+ "text-table.gemspec"
39
+ ]
40
+ s.homepage = %q{http://github.com/aptinio/text-table}
41
+ s.rdoc_options = ["--charset=UTF-8"]
42
+ s.require_paths = ["lib"]
43
+ s.rubygems_version = %q{1.3.5}
44
+ s.summary = %q{A feature-rich, easy-to-use plain text table formatter.}
45
+ s.test_files = [
46
+ "spec/spec_helper.rb",
47
+ "spec/cell_spec.rb",
48
+ "spec/table_spec.rb",
49
+ "spec/enumerable_spec.rb"
50
+ ]
51
+
52
+ if s.respond_to? :specification_version then
53
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
54
+ s.specification_version = 3
55
+
56
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
57
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
58
+ else
59
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
60
+ end
61
+ else
62
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
63
+ end
64
+ end
65
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text-table
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Tinio
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-28 00:00:00 +08:00
12
+ date: 2010-01-05 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -34,6 +34,7 @@ extra_rdoc_files:
34
34
  files:
35
35
  - .document
36
36
  - .gitignore
37
+ - CHANGELOG.rdoc
37
38
  - LICENSE
38
39
  - README.rdoc
39
40
  - Rakefile
@@ -42,12 +43,14 @@ files:
42
43
  - lib/text-table/cell.rb
43
44
  - lib/text-table/enumerable.rb
44
45
  - lib/text-table/row.rb
46
+ - lib/text-table/symbol.rb
45
47
  - lib/text-table/table.rb
46
48
  - spec/cell_spec.rb
47
49
  - spec/enumerable_spec.rb
48
50
  - spec/spec.opts
49
51
  - spec/spec_helper.rb
50
52
  - spec/table_spec.rb
53
+ - text-table.gemspec
51
54
  has_rdoc: true
52
55
  homepage: http://github.com/aptinio/text-table
53
56
  licenses: []