Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Revert "Remove trailing whitespace"

This reverts commit 45331b4.
  • Loading branch information...
commit aae81ba065f5a9bc4465ae8508a3d9acc14c0187 1 parent 307adf1
Brad Ediger authored October 26, 2009

Showing 30 changed files with 414 additions and 414 deletions. Show diff stats Hide diff stats

  1. 8  LICENSE
  2. 20  Rakefile
  3. 10  bugs/resolved_in_prawn/cell_width_miscalculation.rb
  4. 10  bugs/resolved_in_prawn/table_header_overrun.rb
  5. 8  bugs/resolved_in_prawn/table_ignores_align_headers.rb
  6. 8  bugs/resolved_in_prawn/table_in_bounding_box_without_height.rb
  7. 48  bugs/resolved_in_prawn/table_row_background_color_issue.rb
  8. 2  bugs/resolved_in_prawn/table_suppress_newline.rb
  9. 2  examples/example_helper.rb
  10. 4  examples/grid/column_gutter_grid.rb
  11. 4  examples/grid/simple_grid.rb
  12. 32  examples/page_layout/flowing_text_with_header_and_footer.rb
  13. 10  examples/page_layout/lazy_bounding_boxes.rb
  14. 14  examples/table/cell.rb
  15. 32  examples/table/fancy_table.rb
  16. 52  examples/table/table.rb
  17. 2  examples/table/table_border_color.rb
  18. 6  examples/table/table_colspan.rb
  19. 2  examples/table/table_header_color.rb
  20. 2  examples/table/table_header_underline.rb
  21. 10  examples/table/table_widths.rb
  22. 4  lib/prawn/layout.rb
  23. 88  lib/prawn/layout/grid.rb
  24. 62  lib/prawn/layout/page.rb
  25. 162  lib/prawn/table.rb
  26. 74  lib/prawn/table/cell.rb
  27. 24  spec/grid_spec.rb
  28. 40  spec/page_layout_spec.rb
  29. 8  spec/spec_helper.rb
  30. 80  spec/table_spec.rb
8  LICENSE
... ...
@@ -1,4 +1,4 @@
1  
-Prawn::Layout is copyrighted free software produced by Gregory Brown along with
  1
+Prawn::Layout is copyrighted free software produced by Gregory Brown along with 
2 2
 many community contributions (see git log for attribution).
3 3
 
4 4
 Licensing terms follow (License of Ruby 1.8):
@@ -42,11 +42,11 @@ You can redistribute Prawn::Layout and/or modify it under either the terms of th
42 42
        d) make other distribution arrangements with the author.
43 43
 
44 44
   4. You may modify and include the part of the software into any other
45  
-     software (possibly commercial).
  45
+     software (possibly commercial). 
46 46
 
47  
-  5. The scripts and library files supplied as input to or produced as
  47
+  5. The scripts and library files supplied as input to or produced as 
48 48
      output from the software do not automatically fall under the
49  
-     copyright of the software, but belong to whomever generated them,
  49
+     copyright of the software, but belong to whomever generated them, 
50 50
      and may be sold commercially, and may be aggregated with this
51 51
      software.
52 52
 
20  Rakefile
@@ -2,12 +2,12 @@ require 'rubygems'
2 2
 require 'rake'
3 3
 require 'rake/testtask'
4 4
 require "rake/rdoctask"
5  
-require "rake/gempackagetask"
  5
+require "rake/gempackagetask"  
6 6
 
7  
-PRAWN_LAYOUT_VERSION = "0.2.0.1"
  7
+PRAWN_LAYOUT_VERSION = "0.2.0.1" 
8 8
 
9 9
 task :default => [:test]
10  
-
  10
+       
11 11
 desc "Run all tests, test-spec and mocha required"
12 12
 Rake::TestTask.new do |test|
13 13
   test.libs << "spec"
@@ -18,7 +18,7 @@ end
18 18
 desc "Show library's code statistics"
19 19
 task :stats do
20 20
 	require 'code_statistics'
21  
-	CodeStatistics.new( ["prawn-layout", "lib"],
  21
+	CodeStatistics.new( ["prawn-layout", "lib"], 
22 22
 	                    ["Specs", "spec"] ).to_s
23 23
 end
24 24
 
@@ -28,17 +28,17 @@ Rake::RDocTask.new do |rdoc|
28 28
   rdoc.main     = "README"
29 29
   rdoc.rdoc_dir = "doc/html"
30 30
   rdoc.title    = "Prawn Documentation"
31  
-end
  31
+end     
32 32
 
33 33
 desc "run all examples, and then diff them against reference PDFs"
34  
-task :examples do
  34
+task :examples do 
35 35
   mkdir_p "output"
36 36
   examples = Dir["examples/**/*.rb"]
37 37
   t = Time.now
38 38
   puts "Running Examples"
39  
-  examples.each { |file| `ruby -Ilib #{file}` }
40  
-  puts "Ran in #{Time.now - t} s"
41  
-  `mv *.pdf output`
  39
+  examples.each { |file| `ruby -Ilib #{file}` }  
  40
+  puts "Ran in #{Time.now - t} s"        
  41
+  `mv *.pdf output`                     
42 42
 end
43 43
 
44 44
 spec = Gem::Specification.new do |spec|
@@ -49,7 +49,7 @@ spec = Gem::Specification.new do |spec|
49 49
   spec.files =  Dir.glob("{examples,lib,spec,vendor,data}/**/**/*") +
50 50
                       ["Rakefile"]
51 51
   spec.require_path = "lib"
52  
-
  52
+  
53 53
   spec.test_files = Dir[ "test/*_test.rb" ]
54 54
   spec.has_rdoc = true
55 55
   spec.extra_rdoc_files = %w{README}
10  bugs/resolved_in_prawn/cell_width_miscalculation.rb
@@ -11,14 +11,14 @@
11 11
 require "prawn"
12 12
 require "prawn/layout"
13 13
 
14  
-Prawn::Document.generate("broken_table.pdf") do
  14
+Prawn::Document.generate("broken_table.pdf") do 
15 15
   font "#{Prawn::BASEDIR}/data/fonts/comicsans.ttf"
16 16
   table [["foo",    "baaar",             "1" ],
17 17
          ["This is","a sample",          "2" ],
18 18
          ["Table",  "dont\ncha\nknow?",  "3" ]],
19  
-    :font_size => 30,
20  
-    :padding   => 10,
21  
-    :border    => 2,
  19
+    :font_size => 30, 
  20
+    :padding   => 10, 
  21
+    :border    => 2, 
22 22
     :position  => :center
23 23
 end
24  
-
  24
+ 
10  bugs/resolved_in_prawn/table_header_overrun.rb
... ...
@@ -1,4 +1,4 @@
1  
-# Text was overflowing into following cells because of some issues with
  1
+# Text was overflowing into following cells because of some issues with 
2 2
 # floating point numbers in naive wrap.
3 3
 #
4 4
 # Resolved in: 9c357bc488d26e7bbc2e442606106106d349e232
@@ -15,7 +15,7 @@
15 15
   :top_margin => 36,
16 16
   :bottom_margin => 36}
17 17
 
18  
-Prawn::Document.generate("table_header_overrun.pdf", @prawn_document_options) do
  18
+Prawn::Document.generate("table_header_overrun.pdf", @prawn_document_options) do   
19 19
 
20 20
   headers = [ "Customer", "Grand\nHijynx", "Kh", "Red\nCorvette", "Rushmore", "bPnr", "lGh", "retail\nPantaloons", "sRsm", "Total\nBoxes"]
21 21
   data = [[1,0,1,0,1,0,1,0,1,0], [0,1,0,1,0,1,0,1,0,1]]
@@ -26,10 +26,10 @@
26 26
         :horizontal_padding => 5,
27 27
         :vertical_padding => 3,
28 28
         :border => 2,
29  
-        :position => :center)
30  
-
  29
+        :position => :center)  
  30
+        
31 31
   start_new_page
32  
-
  32
+  
33 33
   table [['MyString']], :headers=>['Field1']
34 34
 
35 35
 end
8  bugs/resolved_in_prawn/table_ignores_align_headers.rb
@@ -2,8 +2,8 @@
2 2
 # Prawn ignores :align_headers property in tables
3 3
 # when :border_style => :grid is present (Lighthouse issue #119).
4 4
 #
5  
-# NOTES:
6  
-#
  5
+# NOTES: 
  6
+# 
7 7
 #  * This issue can only be reproduced when :border_style => :grid is used
8 8
 #
9 9
 # Resolved as of 47297900dcf3f16c4765ca817f17c53fb0a5a079
@@ -21,8 +21,8 @@
21 21
   left  = "Left justified"
22 22
   left2 = "left"
23 23
   center = "centered"
24  
-  table [[left, left], [left2, left2]], :headers       => [center, center],
25  
-                                      :align         => :left,
  24
+  table [[left, left], [left2, left2]], :headers       => [center, center], 
  25
+                                      :align         => :left, 
26 26
                                       :align_headers => :center,
27 27
                                       :border_style  => :grid
28 28
 end
8  bugs/resolved_in_prawn/table_in_bounding_box_without_height.rb
... ...
@@ -1,11 +1,11 @@
1  
-# encoding: utf-8
  1
+# encoding: utf-8 
2 2
 #
3 3
 # Issue with tables within stretchy bounding boxes.  Changes to the way
4 4
 # bounding boxes work caused tables to not properly render within stretchy
5  
-# bounding boxes.
  5
+# bounding boxes.  
6 6
 #
7 7
 # A fix in 200fc36455fa3bee0e1e3bb25d1b5bf73dbf3b52 makes it so the bottom
8  
-# of the margin_box will be used as the page boundary in stretchy bounding
  8
+# of the margin_box will be used as the page boundary in stretchy bounding 
9 9
 # boxes.  Ideally, this would instead use the nesting bounding box dimensions
10 10
 # [#80] , but this works for now.
11 11
 #
@@ -14,7 +14,7 @@
14 14
 require "prawn"
15 15
 require "prawn/layout"
16 16
 
17  
-Prawn::Document.generate("table_in_bounding_box_without_height.pdf") do
  17
+Prawn::Document.generate("table_in_bounding_box_without_height.pdf") do 
18 18
   bounding_box bounds.top_left, :width => 200 do
19 19
     table [%w(These should all be), %w(on the same page)]
20 20
   end
48  bugs/resolved_in_prawn/table_row_background_color_issue.rb
... ...
@@ -1,10 +1,10 @@
1 1
 # As of 96f660660345c7c22923ba51d0124022a3a189ab, table is currently not taking
2 2
 # in account border widths when filling in rows with background coloring.  This
3  
-# means the larger the border, the larger the visible gap between rows.
  3
+# means the larger the border, the larger the visible gap between rows.    
4 4
 #
5 5
 # This problem was fixed in 97d9bf083fd9423d17fd1efca36ea675ff34a6d7, but
6 6
 # there remains a very minor issue when the border size is 1 for the headers.
7  
-# Because this almost appears to be a feature display-wise, we will leave it
  7
+# Because this almost appears to be a feature display-wise, we will leave it 
8 8
 # alone for now.
9 9
 #
10 10
 $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
@@ -12,32 +12,32 @@
12 12
 require "prawn"
13 13
 require "prawn/layout"
14 14
 
15  
-Prawn::Document.generate("table_with_background_color_problems.pdf") do
  15
+Prawn::Document.generate("table_with_background_color_problems.pdf") do 
16 16
   font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
17 17
   table [["ὕαλον ϕαγεῖν",    "baaar",             "1" ],
18 18
          ["This is","a sample",          "2" ],
19 19
          ["Table",  "dont\ncha\nknow?",  "3" ],
20  
-         [ "It",    "Rules",             "4" ],
21  
-         [ "It",    "Rules",             "4" ],
22  
-         [ "It",    "Rules",             "4" ],
23  
-         [ "It",    "Rules",             "4" ],
24  
-         [ "It",    "Rules",             "4" ],
25  
-         [ "It",    "Rules",             "4" ],
26  
-         [ "It",    "Rules",             "4" ],
27  
-         [ "It",    "Rules",             "4" ],
28  
-         [ "It",    "Rules",             "4" ],
29  
-         [ "It",    "Rules\nwith an iron fist", "x" ],
30  
-         [ "It",    "Rules",             "4" ],
31  
-         [ "It",    "Rules",             "4" ],
32  
-         [ "It",    "Rules",             "4" ],
33  
-         [ "It",    "Rules",             "4" ],
34  
-         [ "It",    "Rules",             "4" ],
35  
-         [ "It",    "Rules",             "4" ],
36  
-         [ "It",    "Rules",             "4" ],
37  
-         [ "It",    "Rules",             "4" ],
38  
-         [ "It",    "Rules",             "4" ]],
  20
+         [ "It",    "Rules",             "4" ],     
  21
+         [ "It",    "Rules",             "4" ],     
  22
+         [ "It",    "Rules",             "4" ],     
  23
+         [ "It",    "Rules",             "4" ],     
  24
+         [ "It",    "Rules",             "4" ],     
  25
+         [ "It",    "Rules",             "4" ],     
  26
+         [ "It",    "Rules",             "4" ],     
  27
+         [ "It",    "Rules",             "4" ],     
  28
+         [ "It",    "Rules",             "4" ],     
  29
+         [ "It",    "Rules\nwith an iron fist", "x" ],     
  30
+         [ "It",    "Rules",             "4" ],     
  31
+         [ "It",    "Rules",             "4" ],     
  32
+         [ "It",    "Rules",             "4" ],     
  33
+         [ "It",    "Rules",             "4" ],     
  34
+         [ "It",    "Rules",             "4" ],     
  35
+         [ "It",    "Rules",             "4" ],     
  36
+         [ "It",    "Rules",             "4" ],     
  37
+         [ "It",    "Rules",             "4" ],     
  38
+         [ "It",    "Rules",             "4" ]],     
39 39
 
40  
-    :font_size  => 10,
  40
+    :font_size  => 10, 
41 41
     :horizontal_padding => 10,
42 42
     :vertical_padding => 3,
43 43
     :border     => 1,
@@ -49,7 +49,7 @@
49 49
     text "This should appear in the original font size"
50 50
   end
51 51
 
52  
-  table [[ "Wide", "columns", "streeetch"],
  52
+  table [[ "Wide", "columns", "streeetch"], 
53 53
          ["are","mighty fine", "streeeeeeeech"]],
54 54
     :column_widths => { 0 => 200, 1 => 250 }, :position => 5
55 55
 
2  bugs/resolved_in_prawn/table_suppress_newline.rb
@@ -11,6 +11,6 @@
11 11
 Prawn::Document.generate("table_supresses_newlines.pdf") do
12 12
   table [["test\n\naaaa","test\n\nbbbb"],
13 13
         ["test\n\ncccc", "test\n\ndddd"]],  :border_style => :grid
14  
-
  14
+    
15 15
   cell [100,100], :text => "test\n\naaaa"
16 16
 end
2  examples/example_helper.rb
... ...
@@ -1,6 +1,6 @@
1 1
 $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2 2
 require "rubygems"
3  
-require "prawn"
  3
+require "prawn"   
4 4
 require "prawn/layout"
5 5
 
6 6
 Prawn.debug = true
4  examples/grid/column_gutter_grid.rb
... ...
@@ -1,10 +1,10 @@
1  
-# encoding: utf-8
  1
+# encoding: utf-8    
2 2
 
3 3
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
4 4
 
5 5
 Prawn::Document.generate('column_gutter_grid.pdf') do |p|
6 6
   p.define_grid(:columns => 3, :rows => 10, :column_gutter => 10)
7  
-
  7
+  
8 8
   p.grid.rows.times do |i|
9 9
     p.grid.columns.times do |j|
10 10
       b = p.grid(i,j)
4  examples/grid/simple_grid.rb
... ...
@@ -1,10 +1,10 @@
1  
-# encoding: utf-8
  1
+# encoding: utf-8    
2 2
 
3 3
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
4 4
 
5 5
 Prawn::Document.generate('simple_grid.pdf') do |p|
6 6
   p.define_grid(:columns => 5, :rows => 8, :gutter => 10)
7  
-
  7
+  
8 8
   p.grid.rows.times do |i|
9 9
     p.grid.columns.times do |j|
10 10
       b = p.grid(i,j)
32  examples/page_layout/flowing_text_with_header_and_footer.rb
... ...
@@ -1,10 +1,10 @@
@@ -12,25 +12,25 @@
10  examples/page_layout/lazy_bounding_boxes.rb
@@ -7,9 +7,9 @@
7 7
 #
8 8
 # Note that once a lazy bounding box is positioned, it calculates its anchor
9 9
 # relative to its parent bounding box.  It will be positioned at this exact
10  
-# location each time it is redrawn, regardless of the bounds
  10
+# location each time it is redrawn, regardless of the bounds 
11 11
 # LazyBoundingBox#draw is in.
12  
-#
  12
+# 
13 13
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
14 14
 
15 15
 file = "lazy_bounding_boxes.pdf"
@@ -17,11 +17,11 @@
17 17
   point = [bounds.right-50, bounds.bottom + 25]
18 18
   page_counter = lazy_bounding_box(point, :width => 50) do
19 19
     text "Page: #{page_count}"
20  
-  end
21  
-
  20
+  end 
  21
+  
22 22
   10.times do
23 23
     start_new_page
24  
-    text "Some filler text for the page"
  24
+    text "Some filler text for the page"  
25 25
     page_counter.draw
26 26
   end
27 27
 end
14  examples/table/cell.rb
@@ -7,7 +7,7 @@
7 7
 #
8 8
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
9 9
 
10  
-Prawn::Document.generate("cell.pdf") do
  10
+Prawn::Document.generate("cell.pdf") do 
11 11
   cell = Prawn::Table::Cell.new(
12 12
     :border_width => 3, :padding => 10, :width => 75,
13 13
     :text => "You know that kittens are made of mud!", :document => self)
@@ -23,15 +23,15 @@
23 23
       cellblock << cell << cell2 << cell3
24 24
       cellblock.draw
25 25
     end
26  
-
27  
-  move_down(20)
28  
-
  26
+    
  27
+  move_down(20)  
  28
+    
29 29
   cellblock = Prawn::Table::CellBlock.new(self)
30 30
   cellblock << Prawn::Table::Cell.new(
31  
-    :border_width => 3,
32  
-    :padding => 10,
  31
+    :border_width => 3, 
  32
+    :padding => 10, 
33 33
     :borders => [:left, :top],
34  
-    :width => 100,
  34
+    :width => 100, 
35 35
     :text => "This is simply the way of the world", :document => self)
36 36
   cellblock.draw
37 37
 
32  examples/table/fancy_table.rb
... ...
@@ -1,37 +1,37 @@
1 1
 # encoding: utf-8
2 2
 #
3  
-# Demonstrates various table and cell features.
  3
+# Demonstrates various table and cell features.  
4 4
 #
5 5
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
6  
-
7  
-headers, body = nil, nil
  6
+   
  7
+headers, body = nil, nil  
8 8
 
9 9
 dir = File.expand_path(File.dirname(__FILE__))
10  
-
11  
-ruby_18 do
12  
-  require "fastercsv"
13  
-  headers, *body = FasterCSV.read("#{dir}/addressbook.csv")
  10
+     
  11
+ruby_18 do        
  12
+  require "fastercsv" 
  13
+  headers, *body = FasterCSV.read("#{dir}/addressbook.csv")   
14 14
 end
15 15
 
16  
-ruby_19 do
  16
+ruby_19 do            
17 17
   require "csv"
18  
-  headers, *body = CSV.read("#{dir}/addressbook.csv",
  18
+  headers, *body = CSV.read("#{dir}/addressbook.csv", 
19 19
                       :encoding => "utf-8")
20 20
 end
21  
-
  21
+                                                                                  
22 22
 Prawn::Document.generate("fancy_table.pdf", :page_layout => :landscape) do
23  
-
  23
+  
24 24
   #font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
25 25
 
26  
-  mask(:y) { table body, :headers      => headers,
  26
+  mask(:y) { table body, :headers      => headers, 
27 27
                          :align        => :center,
28 28
                          :border_style => :grid     }
29 29
 
30 30
   table [["This is",   "A Test"    ],
31 31
          [  Prawn::Table::Cell.new( :text => "Of tables",
32 32
                                        :background_color => "ffccff" ),
33  
-          "Drawn Side"], ["By side",   "and stuff" ]],
34  
-    :position         => 600,
  33
+          "Drawn Side"], ["By side",   "and stuff" ]], 
  34
+    :position         => 600, 
35 35
     :headers          => ["Col A", "Col B"],
36 36
     :border_width     => 1,
37 37
     :vertical_padding => 5,
@@ -42,7 +42,7 @@
42 42
 
43 43
   move_down 150
44 44
 
45  
-  table [%w[1 2 3],%w[4 5 6],%w[7 8 9]],
  45
+  table [%w[1 2 3],%w[4 5 6],%w[7 8 9]], 
46 46
     :position => :center,
47 47
     :border_width   => 0,
48 48
     :font_size => 40
@@ -56,7 +56,7 @@
56 56
 
57 57
   font_size 24
58 58
 
59  
-  cell [50,75],
  59
+  cell [50,75], 
60 60
     :text => "This document demonstrates a number of Prawn's table features",
61 61
     :border_style => :no_top, # :all, :no_bottom, :sides
62 62
     :horizontal_padding => 5
52  examples/table/table.rb
@@ -5,33 +5,33 @@
5 5
 # common are used here.  See fancy_table.rb for a more comprehensive example.
6 6
 #
7 7
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
8  
-
9  
-Prawn::Document.generate("table.pdf") do
  8
+ 
  9
+Prawn::Document.generate("table.pdf") do 
10 10
   font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
11 11
   table [["ὕαλον ϕαγεῖν",    "baaar",    "1" ],
12 12
          ["This is","a sample",          "2" ],
13 13
          ["Table",  "dont\ncha\nknow?",  "3" ],
14  
-         [ "It",    "Rules",             "4" ],
15  
-         [ "It",    "Rules",             "4" ],
16  
-         [ "It",    "Rules",             "4123231" ],
17  
-         [ "It",    "Rules",             "22.5" ],
18  
-         [ "It",    "Rules",             "4" ],
19  
-         [ "It",    "Rules",             "4" ],
20  
-         [ "It",    "Rules",             "4" ],
21  
-         [ "It",    "Rules",             "4" ],
22  
-         [ "It",    "Rules",             "4" ],
23  
-         [ "It",    "Rules\nwith an iron fist", "x" ],
24  
-         [ "It",    "Rules",             "4" ],
25  
-         [ "It",    "Rules",             "4" ],
26  
-         [ "It",    "Rules",             "4" ],
27  
-         [ "It",    "Rules",             "4" ],
28  
-         [ "It",    "Rules",             "4" ],
29  
-         [ "It",    "Rules",             "4" ],
30  
-         [ "It",    "Rules",             "4" ],
31  
-         [ "It",    "Rules",             "4" ],
32  
-         [ "It",    "Rules",             "4" ]],
  14
+         [ "It",    "Rules",             "4" ],     
  15
+         [ "It",    "Rules",             "4" ],     
  16
+         [ "It",    "Rules",             "4123231" ],     
  17
+         [ "It",    "Rules",             "22.5" ],     
  18
+         [ "It",    "Rules",             "4" ],     
  19
+         [ "It",    "Rules",             "4" ],     
  20
+         [ "It",    "Rules",             "4" ],     
  21
+         [ "It",    "Rules",             "4" ],     
  22
+         [ "It",    "Rules",             "4" ],     
  23
+         [ "It",    "Rules\nwith an iron fist", "x" ],     
  24
+         [ "It",    "Rules",             "4" ],     
  25
+         [ "It",    "Rules",             "4" ],     
  26
+         [ "It",    "Rules",             "4" ],     
  27
+         [ "It",    "Rules",             "4" ],     
  28
+         [ "It",    "Rules",             "4" ],     
  29
+         [ "It",    "Rules",             "4" ],     
  30
+         [ "It",    "Rules",             "4" ],     
  31
+         [ "It",    "Rules",             "4" ],     
  32
+         [ "It",    "Rules",             "4" ]],     
33 33
 
34  
-    :font_size  => 24,
  34
+    :font_size  => 24, 
35 35
     :horizontal_padding => 10,
36 36
     :vertical_padding   => 3,
37 37
     :border_width       => 2,
@@ -39,11 +39,11 @@
39 39
     :headers            => ["Column A","Column B","#"],
40 40
     :align              => {1 => :center},
41 41
     :align_headers      => :center
42  
-
43  
-  text "This should appear in the original font size, just below the table"
  42
+                            
  43
+  text "This should appear in the original font size, just below the table"     
44 44
   move_down 10
45  
-
46  
-  table [[ "Wide", "columns", "streeetch"],
  45
+  
  46
+  table [[ "Wide", "columns", "streeetch"], 
47 47
          ["are","mighty fine", "streeeeeeeech"]],
48 48
     :column_widths => { 0 => 200, 1 => 200 }, :position => 5
49 49
 
2  examples/table/table_border_color.rb
@@ -6,7 +6,7 @@
6 6
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
7 7
 
8 8
 Prawn::Document.generate "table_border_color.pdf" do
9  
-  table [ ['01/01/2008', 'John Doe', '4.2', '125.00', '525.00'],
  9
+  table [ ['01/01/2008', 'John Doe', '4.2', '125.00', '525.00'], 
10 10
           ['01/12/2008', 'Jane Doe', '3.2', '75.50', '241.60'] ] * 20,
11 11
   :position => :center,
12 12
   :headers => ['Date', 'Employee', 'Hours', 'Rate', 'Total'],
6  examples/table/table_colspan.rb
@@ -5,11 +5,11 @@
5 5
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
6 6
 
7 7
 Prawn::Document.generate "table_colspan.pdf" do
8  
-  data = [ ['01/01/2008', 'John Doe', '4.2', '125.00', '525.00'],
  8
+  data = [ ['01/01/2008', 'John Doe', '4.2', '125.00', '525.00'], 
9 9
            ['01/12/2008', 'Jane Doe', '3.2', '75.50', '241.60'] ] * 5
10  
-
  10
+  
11 11
   data << [{:text => 'Total', :colspan => 2, :align => :center}, '37.0', '1002.5', '3833']
12  
-
  12
+  
13 13
   table data,
14 14
   :position => :center,
15 15
   :headers => ['Date', 'Employee', 'Hours', 'Rate', 'Total'],
2  examples/table/table_header_color.rb
@@ -6,7 +6,7 @@
6 6
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
7 7
 
8 8
 Prawn::Document.generate "table_header_color.pdf" do
9  
-  table [ ['01/01/2008', 'John Doe', '4.2', '125.00', '525.00'],
  9
+  table [ ['01/01/2008', 'John Doe', '4.2', '125.00', '525.00'], 
10 10
           ['01/12/2008', 'Jane Doe', '3.2', '75.50', '241.60'] ] * 20,
11 11
   :position => :center,
12 12
   :headers => ['Date', 'Employee', 'Hours', 'Rate', 'Total'],
2  examples/table/table_header_underline.rb
@@ -5,7 +5,7 @@
5 5
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
6 6
 
7 7
 Prawn::Document.generate "table_header_underline.pdf" do
8  
-  table [ ['01/01/2008', 'John Doe', '4.2', '125.00', '525.00'],
  8
+  table [ ['01/01/2008', 'John Doe', '4.2', '125.00', '525.00'], 
9 9
           ['01/12/2008', 'Jane Doe', '3.2', '75.50', '241.60'] ] * 5,
10 10
   :position => :center,
11 11
   :headers => ['Date', 'Employee', 'Hours', 'Rate', 'Total'],
10  examples/table/table_widths.rb
@@ -6,7 +6,7 @@
6 6
 #
7 7
 require "#{File.dirname(__FILE__)}/../example_helper.rb"
8 8
 
9  
-Prawn::Document.generate("table_widths.pdf") do
  9
+Prawn::Document.generate("table_widths.pdf") do 
10 10
 
11 11
   data = [
12 12
     %w(one two three four),
@@ -20,7 +20,7 @@
20 20
   text "A table with a specified width of the document width (within margins)"
21 21
   move_down 10
22 22
 
23  
-  table data,
  23
+  table data,    
24 24
     :position   => :center,
25 25
     :headers    => headers,
26 26
     :width      => margin_box.width
@@ -30,7 +30,7 @@
30 30
   text "A table with a specified width of the document width (within margins) and two fixed width columns"
31 31
   move_down 10
32 32
 
33  
-  table data,
  33
+  table data,    
34 34
     :position      => :center,
35 35
     :headers       => headers,
36 36
     :width         => margin_box.width,
@@ -41,7 +41,7 @@
41 41
   text "A table with a specified width of 300"
42 42
   move_down 10
43 43
 
44  
-  table data,
  44
+  table data,    
45 45
     :position   => :center,
46 46
     :headers    => headers,
47 47
     :width      => 300
@@ -53,7 +53,7 @@
53 53
 
54 54
   data << ['some text', 'A long piece of text that will make this cell too wide for the page', 'some more text', 'And more text']
55 55
 
56  
-  table data,
  56
+  table data,    
57 57
     :position   => :center,
58 58
     :headers    => headers
59 59
 
4  lib/prawn/layout.rb
@@ -3,9 +3,9 @@
3 3
 require 'prawn/layout/grid'
4 4
 
5 5
 module Prawn
6  
-
  6
+  
7 7
  module Errors
8  
-
  8
+   
9 9
    # This error is raised when table data is malformed
10 10
    #
11 11
    InvalidTableData = Class.new(StandardError)
88  lib/prawn/layout/grid.rb
@@ -6,8 +6,8 @@ class Document
6 6
     def define_grid(options = {})
7 7
       @grid = Grid.new(self, options)
8 8
     end
9  
-
10  
-    # A method that can either be used to access a particular grid on the page or interogate the grid
  9
+  
  10
+    # A method that can either be used to access a particular grid on the page or interogate the grid 
11 11
     # system directly.
12 12
     #
13 13
     #   @pdf.grid                 # Get the Grid directly
@@ -19,7 +19,7 @@ def grid(*args)
19 19
         @grid
20 20
       else
21 21
         g1, g2 = args
22  
-        if(g1.class == Array && g2.class == Array &&
  22
+        if(g1.class == Array && g2.class == Array && 
23 23
           g1.length == 2 && g2.length == 2)
24 24
           multi_box(single_box(*g1), single_box(*g2))
25 25
         else
@@ -27,7 +27,7 @@ def grid(*args)
27 27
         end
28 28
       end
29 29
     end
30  
-
  30
+  
31 31
     # A Grid represents the entire grid system of a Page and calculates the column width and row height
32 32
     # of the base box.
33 33
     class Grid
@@ -35,7 +35,7 @@ class Grid
35 35
       # :nodoc
36 36
       def initialize(pdf, options = {})
37 37
         Prawn.verify_options([:columns, :rows, :gutter, :row_gutter, :column_gutter], options)
38  
-
  38
+      
39 39
         @pdf = pdf
40 40
         @columns = options[:columns]
41 41
         @rows = options[:rows]
@@ -46,7 +46,7 @@ def initialize(pdf, options = {})
46 46
       def column_width
47 47
         @column_width ||= subdivide(pdf.bounds.width, columns, column_gutter)
48 48
       end
49  
-
  49
+    
50 50
       # Calculates the base height of boxes.
51 51
       def row_height
52 52
        @row_height ||= subdivide(pdf.bounds.height, rows, row_gutter)
@@ -65,7 +65,7 @@ def show_all(color = "CCCCCC")
65 65
       def subdivide(total, num, gutter)
66 66
         (total.to_f - (gutter * (num - 1).to_f)) / num.to_f
67 67
       end
68  
-
  68
+      
69 69
       def set_gutter(options)
70 70
         if options.has_key?(:gutter)
71 71
           @gutter = options[:gutter].to_f
@@ -76,90 +76,90 @@ def set_gutter(options)
76 76
         end
77 77
       end
78 78
     end
79  
-
80  
-    # A Box is a class that represents a bounded area of a page.  A Grid object has methods that allow
81  
-    # easy access to the coordinates of its corners, which can be plugged into most existing prawn
  79
+  
  80
+    # A Box is a class that represents a bounded area of a page.  A Grid object has methods that allow 
  81
+    # easy access to the coordinates of its corners, which can be plugged into most existing prawn 
82 82
     # methods.
83 83
     #
84 84
     class Box
85 85
       attr_reader :pdf
86  
-
  86
+    
87 87
       def initialize(pdf, i, j)
88 88
         @pdf = pdf
89 89
         @i = i
90 90
         @j = j
91 91
       end
92  
-
  92
+    
93 93
       # Mostly diagnostic method that outputs the name of a box as col_num, row_num
94 94
       def name
95 95
         "#{@i.to_s},#{@j.to_s}"
96 96
       end
97  
-
  97
+      
98 98
       # :nodoc
99 99
       def total_height
100 100
         pdf.bounds.height.to_f
101 101
       end
102  
-
  102
+      
103 103
       # Width of a box
104 104
       def width
105 105
         grid.column_width.to_f
106 106
       end
107  
-
  107
+    
108 108
       # Height of a box
109 109
       def height
110 110
         grid.row_height.to_f
111 111
       end
112  
-
  112
+      
113 113
       # Width of the gutter
114 114
       def gutter
115 115
         grid.gutter.to_f
116 116
       end
117  
-
  117
+      
118 118
       # x-coordinate of left side
119 119
       def left
120 120
         @left ||= (width + grid.column_gutter) * @j.to_f
121 121
       end
122  
-
123  
-      # x-coordinate of right side
  122
+    
  123
+      # x-coordinate of right side 
124 124
       def right
125 125
         @right ||= left + width
126 126
       end
127  
-
  127
+    
128 128
       # y-coordinate of the top
129 129
       def top
130 130
         @top ||= total_height - ((height + grid.row_gutter) * @i.to_f)
131 131
       end
132  
-
  132
+    
133 133
       # y-coordinate of the bottom
134 134
       def bottom
135 135
         @bottom ||= top - height
136 136
       end
137  
-
  137
+    
138 138
       # x,y coordinates of top left corner
139 139
       def top_left
140 140
         [left, top]
141 141
       end
142  
-
143  
-      # x,y coordinates of top right corner
  142
+    
  143
+      # x,y coordinates of top right corner    
144 144
       def top_right
145 145
         [right, top]
146 146
       end
147  
-
  147
+    
148 148
       # x,y coordinates of bottom left corner
149 149
       def bottom_left
150 150
         [left, bottom]
151 151
       end
152  
-
  152
+    
153 153
       # x,y coordinates of bottom right corner
154 154
       def bottom_right
155 155
         [right, bottom]
156 156
       end
157  
-
  157
+    
158 158
       # Creates a standard bounding box based on the grid box.
159 159
       def bounding_box(&blk)
160 160
         pdf.bounding_box(top_left, :width => width, :height => height, &blk)
161 161
       end
162  
-
  162
+    
163 163
       # Diagnostic method
164 164
       def show(grid_color = "CCCCCC")
165 165
         self.bounding_box do
@@ -168,24 +168,24 @@ def show(grid_color = "CCCCCC")
168 168
           pdf.stroke_bounds
169 169
         end
170 170
       end
171  
-
  171
+    
172 172
       private
173 173
       def grid
174 174
         pdf.grid
175 175
       end
176 176
     end
177  
-
  177
+  
178 178
     # A MultiBox is specified by 2 Boxes and spans the areas between.
179 179
     class MultiBox < Box
180 180
       def initialize(pdf, b1, b2)
181 181
         @pdf = pdf
182 182
         @bs = [b1, b2]
183 183
       end
184  
-
  184
+    
185 185
       def name
186 186
         @bs.map {|b| b.name}.join(":")
187 187
       end
188  
-
  188
+    
189 189
       def total_height
190 190
         @bs[0].total_height
191 191
       end
@@ -193,54 +193,54 @@ def total_height
193 193
       def width
194 194
         right_box.right - left_box.left
195 195
       end
196  
-
  196
+    
197 197
       def height
198 198
         top_box.top - bottom_box.bottom
199 199
       end
200  
-
  200
+    
201 201
       def gutter
202 202
         @bs[0].gutter
203 203
       end
204  
-
  204
+    
205 205
       def left
206 206
         left_box.left
207 207
       end
208  
-
  208
+    
209 209
       def right
210 210
         right_box.right
211 211
       end
212  
-
  212
+    
213 213
       def top
214 214
         top_box.top
215 215
       end
216  
-
  216
+    
217 217
       def bottom
218 218
         bottom_box.bottom
219 219
       end
220  
-
  220
+    
221 221
       private
222 222
       def left_box
223 223
         @left_box ||= @bs.min {|a,b| a.left <=> b.left}
224 224
       end
225  
-
  225
+    
226 226
       def right_box
227 227
         @right_box ||= @bs.max {|a,b| a.right <=> b.right}
228 228
       end
229  
-
  229
+    
230 230
       def top_box
231 231
         @top_box ||= @bs.max {|a,b| a.top <=> b.top}
232 232
       end
233  
-
  233
+    
234 234
       def bottom_box
235 235
         @bottom_box ||= @bs.min {|a,b| a.bottom <=> b.bottom}
236 236
       end
237 237
     end
238  
-
  238
+  
239 239
     private
240 240
     def single_box(i, j)
241 241
       Box.new(self, i, j)
242 242
     end
243  
-
  243
+  
244 244
     def multi_box(b1, b2)
245 245
       MultiBox.new(self, b1, b2)
246 246
     end
62  lib/prawn/layout/page.rb
@@ -8,60 +8,60 @@
8 8
 
9 9
 module Prawn
10 10
   class Document
11  
-    # A LazyBoundingBox is simply a BoundingBox with an action tied to it to be
  11
+    # A LazyBoundingBox is simply a BoundingBox with an action tied to it to be 
12 12
     # executed later.  The lazy_bounding_box method takes the same arguments as
13 13
     # bounding_box, but returns a LazyBoundingBox object instead of executing
14 14
     # the code block directly.
15 15
     #
16  
-    # You can then call LazyBoundingBox#draw at any time (or multiple times if
  16
+    # You can then call LazyBoundingBox#draw at any time (or multiple times if 
17 17
     # you wish), and the contents of the block will then be run. This can be
18 18
     # useful for assembling repeating page elements or reusable components.
19 19
     #
20 20
     #  file = "lazy_bounding_boxes.pdf"
21  
-    #  Prawn::Document.generate(file, :skip_page_creation => true) do
  21
+    #  Prawn::Document.generate(file, :skip_page_creation => true) do                    
22 22
     #    point = [bounds.right-50, bounds.bottom + 25]
23  
-    #    page_counter = lazy_bounding_box(point, :width => 50) do
  23
+    #    page_counter = lazy_bounding_box(point, :width => 50) do   
24 24
     #      text "Page: #{page_count}"
25  
-    #    end
  25
+    #    end 
26 26
     #
27  
-    #    10.times do
  27
+    #    10.times do         
28 28
     #     start_new_page
29  
-    #      text "Some text"
  29
+    #      text "Some text"  
30 30
     #      page_counter.draw
31 31
     #    end
32 32
     #  end
33 33
     #
34 34
     def lazy_bounding_box(*args,&block)
35  
-      translate!(args[0])
  35
+      translate!(args[0])  
36 36
       box = LazyBoundingBox.new(self,*args)
37 37
       box.action(&block)
38  
-      return box
  38
+      return box 
39 39
     end
40  
-
  40
+    
41 41
     # A bounding box with the same dimensions of its parents, minus a margin
42 42
     # on all sides
43 43
     #
44 44
     def padded_box(margin, &block)
45 45
       bounding_box [bounds.left + margin, bounds.top - margin],
46  
-        :width  => bounds.width - (margin * 2),
47  
-        :height => bounds.height - (margin * 2), &block
  46
+        :width  => bounds.width - (margin * 2), 
  47
+        :height => bounds.height - (margin * 2), &block 
48 48
     end
49  
-
  49
+       
50 50
     # A header is a LazyBoundingBox drawn relative to the margins that can be
51 51
     # repeated on every page of the document.
52 52
     #
53 53
     # Unless <tt>:width</tt> or <tt>:height</tt> are specified, the margin_box
54  
-    # width and height are used.
  54
+    # width and height are used.   
55 55
     #
56  
-    #   header margin_box.top_left do
57  
-    #    text "Here's My Fancy Header", :size => 25, :align => :center
  56
+    #   header margin_box.top_left do 
  57
+    #    text "Here's My Fancy Header", :size => 25, :align => :center   
58 58
     #    stroke_horizontal_rule
59 59
     #  end
60 60
     #
61  
-    def header(top_left,options={},&block)
  61
+    def header(top_left,options={},&block)   
62 62
       @header = repeating_page_element(top_left,options,&block)
63 63
     end
64  
-
  64
+        
65 65
     # A footer is a LazyBoundingBox drawn relative to the margins that can be
66 66
     # repeated on every page of the document.
67 67
     #
@@ -71,43 +71,43 @@ def header(top_left,options={},&block)
71 71
     #   footer [margin_box.left, margin_box.bottom + 25] do
72 72
     #     stroke_horizontal_rule
73 73
     #     text "And here's a sexy footer", :size => 16
74  
-    #   end
  74
+    #   end    
75 75
     #
76  
-    def footer(top_left,options={},&block)
  76
+    def footer(top_left,options={},&block)       
77 77
       @footer = repeating_page_element(top_left,options,&block)
78 78
     end
79 79
 
80 80
     private
81 81
 
82  
-    def repeating_page_element(top_left,options={},&block)
  82
+    def repeating_page_element(top_left,options={},&block)   
83 83
       r = LazyBoundingBox.new(self, translate(top_left),
84  
-        :width  => options[:width]  || margin_box.width,
  84
+        :width  => options[:width]  || margin_box.width, 
85 85
         :height => options[:height] || margin_box.height )
86 86
       r.action(&block)
87 87
       return r
88  
-    end
  88
+    end  
89 89
 
90 90
     class LazyBoundingBox < BoundingBox
91  
-
92  
-      # Defines the block to be executed by LazyBoundingBox#draw.
93  
-      # Usually, this will be used via a higher level interface.
  91
+       
  92
+      # Defines the block to be executed by LazyBoundingBox#draw. 
  93
+      # Usually, this will be used via a higher level interface.  
94 94
       # See the documentation for Document#lazy_bounding_box, Document#header,
95 95
       # and Document#footer
96 96
       #
97 97
       def action(&block)
98 98
         @action = block
99 99
       end
100  
-
  100
+      
101 101
       # Sets Document#bounds to use the LazyBoundingBox for its bounds,
102 102
       # runs the block specified by LazyBoundingBox#action,
103 103
       # and then restores the original bounds of the document.
104 104
       #
105 105
       def draw
106  
-        @parent.mask(:y) do
107  
-          parent_box = @parent.bounds
108  
-          @parent.bounds = self
  106
+        @parent.mask(:y) do  
  107
+          parent_box = @parent.bounds  
  108
+          @parent.bounds = self    
109 109
           @parent.y = absolute_top
110  
-          @action.call
  110
+          @action.call   
111 111
           @parent.bounds = parent_box
112 112
         end
113 113
       end
162  lib/prawn/table.rb
@@ -9,8 +9,8 @@
9 9
 require "prawn/table/cell"
10 10
 
11 11
 module Prawn
12  
-  class Document
13  
-
  12
+  class Document    
  13
+    
14 14
     # Builds and renders a Document::Table object from raw data.
15 15
     # For details on the options that can be passed, see
16 16
     # Document::Table.new
@@ -18,7 +18,7 @@ class Document
18 18
     #   data = [["Gregory","Brown"],["James","Healy"],["Jia","Wu"]]
19 19
     #
20 20
     #   Prawn::Document.generate("table.pdf") do