Skip to content

Commit

Permalink
Remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Brett Neumeier committed Oct 22, 2009
1 parent 2024b97 commit 45331b4
Show file tree
Hide file tree
Showing 30 changed files with 414 additions and 414 deletions.
8 changes: 4 additions & 4 deletions LICENSE
@@ -1,4 +1,4 @@
Prawn::Layout is copyrighted free software produced by Gregory Brown along with
Prawn::Layout is copyrighted free software produced by Gregory Brown along with
many community contributions (see git log for attribution).

Licensing terms follow (License of Ruby 1.8):
Expand Down Expand Up @@ -42,11 +42,11 @@ You can redistribute Prawn::Layout and/or modify it under either the terms of th
d) make other distribution arrangements with the author.

4. You may modify and include the part of the software into any other
software (possibly commercial).
software (possibly commercial).

5. The scripts and library files supplied as input to or produced as
5. The scripts and library files supplied as input to or produced as
output from the software do not automatically fall under the
copyright of the software, but belong to whomever generated them,
copyright of the software, but belong to whomever generated them,
and may be sold commercially, and may be aggregated with this
software.

Expand Down
20 changes: 10 additions & 10 deletions Rakefile
Expand Up @@ -2,12 +2,12 @@ require 'rubygems'
require 'rake'
require 'rake/testtask'
require "rake/rdoctask"
require "rake/gempackagetask"
require "rake/gempackagetask"

PRAWN_LAYOUT_VERSION = "0.2.0.1"
PRAWN_LAYOUT_VERSION = "0.2.0.1"

task :default => [:test]

desc "Run all tests, test-spec and mocha required"
Rake::TestTask.new do |test|
test.libs << "spec"
Expand All @@ -18,7 +18,7 @@ end
desc "Show library's code statistics"
task :stats do
require 'code_statistics'
CodeStatistics.new( ["prawn-layout", "lib"],
CodeStatistics.new( ["prawn-layout", "lib"],
["Specs", "spec"] ).to_s
end

Expand All @@ -28,17 +28,17 @@ Rake::RDocTask.new do |rdoc|
rdoc.main = "README"
rdoc.rdoc_dir = "doc/html"
rdoc.title = "Prawn Documentation"
end
end

desc "run all examples, and then diff them against reference PDFs"
task :examples do
task :examples do
mkdir_p "output"
examples = Dir["examples/**/*.rb"]
t = Time.now
puts "Running Examples"
examples.each { |file| `ruby -Ilib #{file}` }
puts "Ran in #{Time.now - t} s"
`mv *.pdf output`
examples.each { |file| `ruby -Ilib #{file}` }
puts "Ran in #{Time.now - t} s"
`mv *.pdf output`
end

spec = Gem::Specification.new do |spec|
Expand All @@ -49,7 +49,7 @@ spec = Gem::Specification.new do |spec|
spec.files = Dir.glob("{examples,lib,spec,vendor,data}/**/**/*") +
["Rakefile"]
spec.require_path = "lib"

spec.test_files = Dir[ "test/*_test.rb" ]
spec.has_rdoc = true
spec.extra_rdoc_files = %w{README}
Expand Down
10 changes: 5 additions & 5 deletions bugs/resolved_in_prawn/cell_width_miscalculation.rb
Expand Up @@ -11,14 +11,14 @@
require "prawn"
require "prawn/layout"

Prawn::Document.generate("broken_table.pdf") do
Prawn::Document.generate("broken_table.pdf") do
font "#{Prawn::BASEDIR}/data/fonts/comicsans.ttf"
table [["foo", "baaar", "1" ],
["This is","a sample", "2" ],
["Table", "dont\ncha\nknow?", "3" ]],
:font_size => 30,
:padding => 10,
:border => 2,
:font_size => 30,
:padding => 10,
:border => 2,
:position => :center
end

10 changes: 5 additions & 5 deletions bugs/resolved_in_prawn/table_header_overrun.rb
@@ -1,4 +1,4 @@
# Text was overflowing into following cells because of some issues with
# Text was overflowing into following cells because of some issues with
# floating point numbers in naive wrap.
#
# Resolved in: 9c357bc488d26e7bbc2e442606106106d349e232
Expand All @@ -15,7 +15,7 @@
:top_margin => 36,
:bottom_margin => 36}

Prawn::Document.generate("table_header_overrun.pdf", @prawn_document_options) do
Prawn::Document.generate("table_header_overrun.pdf", @prawn_document_options) do

headers = [ "Customer", "Grand\nHijynx", "Kh", "Red\nCorvette", "Rushmore", "bPnr", "lGh", "retail\nPantaloons", "sRsm", "Total\nBoxes"]
data = [[1,0,1,0,1,0,1,0,1,0], [0,1,0,1,0,1,0,1,0,1]]
Expand All @@ -26,10 +26,10 @@
:horizontal_padding => 5,
:vertical_padding => 3,
:border => 2,
:position => :center)
:position => :center)

start_new_page

table [['MyString']], :headers=>['Field1']

end
8 changes: 4 additions & 4 deletions bugs/resolved_in_prawn/table_ignores_align_headers.rb
Expand Up @@ -2,8 +2,8 @@
# Prawn ignores :align_headers property in tables
# when :border_style => :grid is present (Lighthouse issue #119).
#
# NOTES:
#
# NOTES:
#
# * This issue can only be reproduced when :border_style => :grid is used
#
# Resolved as of 47297900dcf3f16c4765ca817f17c53fb0a5a079
Expand All @@ -21,8 +21,8 @@
left = "Left justified"
left2 = "left"
center = "centered"
table [[left, left], [left2, left2]], :headers => [center, center],
:align => :left,
table [[left, left], [left2, left2]], :headers => [center, center],
:align => :left,
:align_headers => :center,
:border_style => :grid
end
@@ -1,11 +1,11 @@
# encoding: utf-8
# encoding: utf-8
#
# Issue with tables within stretchy bounding boxes. Changes to the way
# bounding boxes work caused tables to not properly render within stretchy
# bounding boxes.
# bounding boxes.
#
# A fix in 200fc36455fa3bee0e1e3bb25d1b5bf73dbf3b52 makes it so the bottom
# of the margin_box will be used as the page boundary in stretchy bounding
# of the margin_box will be used as the page boundary in stretchy bounding
# boxes. Ideally, this would instead use the nesting bounding box dimensions
# [#80] , but this works for now.
#
Expand All @@ -14,7 +14,7 @@
require "prawn"
require "prawn/layout"

Prawn::Document.generate("table_in_bounding_box_without_height.pdf") do
Prawn::Document.generate("table_in_bounding_box_without_height.pdf") do
bounding_box bounds.top_left, :width => 200 do
table [%w(These should all be), %w(on the same page)]
end
Expand Down
48 changes: 24 additions & 24 deletions bugs/resolved_in_prawn/table_row_background_color_issue.rb
@@ -1,43 +1,43 @@
# As of 96f660660345c7c22923ba51d0124022a3a189ab, table is currently not taking
# in account border widths when filling in rows with background coloring. This
# means the larger the border, the larger the visible gap between rows.
# means the larger the border, the larger the visible gap between rows.
#
# This problem was fixed in 97d9bf083fd9423d17fd1efca36ea675ff34a6d7, but
# there remains a very minor issue when the border size is 1 for the headers.
# Because this almost appears to be a feature display-wise, we will leave it
# Because this almost appears to be a feature display-wise, we will leave it
# alone for now.
#
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
require "rubygems"
require "prawn"
require "prawn/layout"

Prawn::Document.generate("table_with_background_color_problems.pdf") do
Prawn::Document.generate("table_with_background_color_problems.pdf") do
font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
table [["ὕαλον ϕαγεῖν", "baaar", "1" ],
["This is","a sample", "2" ],
["Table", "dont\ncha\nknow?", "3" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules\nwith an iron fist", "x" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ]],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules\nwith an iron fist", "x" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ],
[ "It", "Rules", "4" ]],

:font_size => 10,
:font_size => 10,
:horizontal_padding => 10,
:vertical_padding => 3,
:border => 1,
Expand All @@ -49,7 +49,7 @@
text "This should appear in the original font size"
end

table [[ "Wide", "columns", "streeetch"],
table [[ "Wide", "columns", "streeetch"],
["are","mighty fine", "streeeeeeeech"]],
:column_widths => { 0 => 200, 1 => 250 }, :position => 5

Expand Down
2 changes: 1 addition & 1 deletion bugs/resolved_in_prawn/table_suppress_newline.rb
Expand Up @@ -11,6 +11,6 @@
Prawn::Document.generate("table_supresses_newlines.pdf") do
table [["test\n\naaaa","test\n\nbbbb"],
["test\n\ncccc", "test\n\ndddd"]], :border_style => :grid

cell [100,100], :text => "test\n\naaaa"
end
2 changes: 1 addition & 1 deletion examples/example_helper.rb
@@ -1,6 +1,6 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require "rubygems"
require "prawn"
require "prawn"
require "prawn/layout"

Prawn.debug = true
4 changes: 2 additions & 2 deletions examples/grid/column_gutter_grid.rb
@@ -1,10 +1,10 @@
# encoding: utf-8
# encoding: utf-8

require "#{File.dirname(__FILE__)}/../example_helper.rb"

Prawn::Document.generate('column_gutter_grid.pdf') do |p|
p.define_grid(:columns => 3, :rows => 10, :column_gutter => 10)

p.grid.rows.times do |i|
p.grid.columns.times do |j|
b = p.grid(i,j)
Expand Down
4 changes: 2 additions & 2 deletions examples/grid/simple_grid.rb
@@ -1,10 +1,10 @@
# encoding: utf-8
# encoding: utf-8

require "#{File.dirname(__FILE__)}/../example_helper.rb"

Prawn::Document.generate('simple_grid.pdf') do |p|
p.define_grid(:columns => 5, :rows => 8, :gutter => 10)

p.grid.rows.times do |i|
p.grid.columns.times do |j|
b = p.grid(i,j)
Expand Down
32 changes: 16 additions & 16 deletions examples/page_layout/flowing_text_with_header_and_footer.rb
@@ -1,36 +1,36 @@
# encoding: utf-8
#
# encoding: utf-8
#
# Multi-faceted example that demonstrates a document flowing between header
# and footer regions. At the moment, headers and footers in Prawn are run
# using the current font settings (among other things), for each page. This
# means that it is important to non-destructively set your desired styling
# within your headers and footers, as shown below.
# means that it is important to non-destructively set your desired styling
# within your headers and footers, as shown below.
#
# Future versions of Prawn may make this more convenient somehow.
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

Prawn::Document.generate("flow_with_headers_and_footers.pdf") do

header margin_box.top_left do
header margin_box.top_left do
font "Helvetica" do
text "Here's My Fancy Header", :size => 25, :align => :center
text "Here's My Fancy Header", :size => 25, :align => :center
stroke_horizontal_rule
end
end
end

footer [margin_box.left, margin_box.bottom + 25] do
font "Helvetica" do
stroke_horizontal_rule
text "And here's a sexy footer", :size => 16
end
end
bounding_box([bounds.left, bounds.top - 50],
:width => bounds.width, :height => bounds.height - 100) do
text "this is some flowing text " * 200
end

bounding_box([bounds.left, bounds.top - 50],
:width => bounds.width, :height => bounds.height - 100) do
text "this is some flowing text " * 200


end

end
10 changes: 5 additions & 5 deletions examples/page_layout/lazy_bounding_boxes.rb
Expand Up @@ -7,21 +7,21 @@
#
# Note that once a lazy bounding box is positioned, it calculates its anchor
# relative to its parent bounding box. It will be positioned at this exact
# location each time it is redrawn, regardless of the bounds
# location each time it is redrawn, regardless of the bounds
# LazyBoundingBox#draw is in.
#
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

file = "lazy_bounding_boxes.pdf"
Prawn::Document.generate(file, :skip_page_creation => true) do
point = [bounds.right-50, bounds.bottom + 25]
page_counter = lazy_bounding_box(point, :width => 50) do
text "Page: #{page_count}"
end
end

10.times do
start_new_page
text "Some filler text for the page"
text "Some filler text for the page"
page_counter.draw
end
end

0 comments on commit 45331b4

Please sign in to comment.