Skip to content

Instantly share code, notes, and snippets.

@dennym
Created December 29, 2015 15:14
Show Gist options
  • Save dennym/83aa9a4df49a99a54d1b to your computer and use it in GitHub Desktop.
Save dennym/83aa9a4df49a99a54d1b to your computer and use it in GitHub Desktop.
Prawn.rb Grid
Prawn::Document.generate(prawn_file) do
y = 790
79.times do
x = -30
58.times do
bounding_box([x,y], :width => 10, :height => 10) do
stroke_color '000000'
stroke_bounds
text_box "#{x}", :size => 5, :at=> [0,10], :width => 10, :height => 10, color: 'ff0000' if y == 790
text_box "#{y}", :size => 5, :at=> [0,10], :width => 10, :height => 10, color: 'ff0000' if x == -30
end
x = x + 10
end
y = y - 10
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment