Permalink
Browse files

Revert "Remove trailing whitespace"

This reverts commit 45331b4.
  • Loading branch information...
1 parent 307adf1 commit aae81ba065f5a9bc4465ae8508a3d9acc14c0187 @bradediger bradediger committed Oct 26, 2009
View
@@ -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):
@@ -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.
View
@@ -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"
@@ -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
@@ -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|
@@ -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}
@@ -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
-
+
@@ -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
@@ -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]]
@@ -26,10 +26,10 @@
:horizontal_padding => 5,
:vertical_padding => 3,
:border => 2,
- :position => :center)
-
+ :position => :center)
+
start_new_page
-
+
table [['MyString']], :headers=>['Field1']
end
@@ -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
@@ -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.
#
@@ -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
@@ -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,
@@ -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
@@ -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
@@ -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
@@ -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)
@@ -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)
@@ -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
@@ -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
Oops, something went wrong.

0 comments on commit aae81ba

Please sign in to comment.