Permalink
Browse files

Rename test_labels exmaple file to shrink_to_fit

  • Loading branch information...
1 parent 6644621 commit 5502b5e9ac7067ea38d4a42ad961934a718099be @jordanbyron jordanbyron committed Jul 8, 2011
Showing with 36 additions and 35 deletions.
  1. +1 −0 .gitignore
  2. +35 −0 examples/shrink_to_fit.rb
  3. +0 −35 examples/test_labels.rb
View
1 .gitignore
@@ -0,0 +1 @@
+examples/*.pdf
View
35 examples/shrink_to_fit.rb
@@ -0,0 +1,35 @@
+require File.join(File.dirname(__FILE__), "example_helper")
+
+one = "1"
+two = "2\n2"
+three = (["3"]*3).join("\n")
+four = (["4"]*4).join("\n")
+five = (["5"]*5).join("\n")
+six = (["6"]*6).join("\n")
+seven = (["7"]*7).join("\n")
+eight = (["8"]*8).join("\n")
+nine = (["9"]*9).join("\n")
+ten = (["10"]*10).join("\n")
+long = %{this
+ is
+ thelonglined
+ entrywhereijusttypealottomakeitoverflowthebuffer
+ andthislinetriggersbutitdontkeep }
+long2 = %{this
+ is just
+ the other long line
+ entry where i just type to make it over flow the buffer
+ lol }
+fifty = (["50"]*50).join("\n")
+
+test_names = [one, two, three, four, five, six, seven, eight, nine, ten,
+ "Mike", "Kelly", "Bob", "Greg", "Jordan", "Chris", "Jon", "Mike",
+ "Kelly", long, long2, "Jordan", "Chris", "Jon", fifty, "Kelly",
+ "Bob", "Greg", "Jordan", "Chris",
+ #these next five should be on the next page.
+ "Jon", "Mike", "Kelly", "Bob", "Greg"]
+
+Prawn::Labels.generate("shrink_to_fit.pdf", test_names, :type => "Avery5160", :shrink_to_fit => true) do |pdf, name|
+ pdf.text name
+end
+
View
35 examples/test_labels.rb
@@ -1,35 +0,0 @@
-require File.join(File.dirname(__FILE__), "example_helper")
-
-one = "1"
-two = "2\n2"
-three = (["3"]*3).join("\n")
-four = (["4"]*4).join("\n")
-five = (["5"]*5).join("\n")
-six = (["6"]*6).join("\n")
-seven = (["7"]*7).join("\n")
-eight = (["8"]*8).join("\n")
-nine = (["9"]*9).join("\n")
-ten = (["10"]*10).join("\n")
-long = "this\nis\nthelonglined\nentrywhereijusttypealottomakeitoverflowthebuffer\nandthislinetriggersbutitdontkeep"
-long2 = "this\nis just\nthe other long line\nentry where i just type to make it over flow the buffer\nlol"
-fifty = (["50"]*50).join("\n")
-
-test_names = [one, two, three,
- four, five, six,
- seven, eight, nine,
- ten, "Mike", "Kelly",
- "Bob", "Greg", "Jordan",
- "Chris", "Jon", "Mike",
- "Kelly", long, long2,
- "Jordan", "Chris", "Jon",
- fifty, "Kelly", "Bob",
- "Greg", "Jordan", "Chris",
-#these next five should be on the next page.
- "Jon", "Mike", "Kelly",
- "Bob", "Greg"]
-
-
-Prawn::Labels.generate("test_labels.pdf", test_names, :type => "Avery5160", :shrink_to_fit => true) do |pdf, name|
- pdf.text name
-end
-

0 comments on commit 5502b5e

Please sign in to comment.