prawn:Prawn::Graphics::Dash#dash

#!/usr/bin/env ruby

require "prawn"

pdf = Prawn::Document.new
pdf.line_width = 10

y = 100
[[10, 1, 0],
 [10, 5, 0],
 [10, 1, 10],
 [10, 5, 10],
 [10, 1, 1],
 [10, 5, 1],
 [10, 1, 2],
 [10, 5, 2],
 [20, 1, 0],
 [20, 5, 0],
].each do |length, space, phase|
  pdf.dash(length, :space => space, :phase => phase)
  pdf.move_to(100, y)
  pdf.line_to(150, y)
  pdf.stroke
  y += 50
end

pdf.render_file(File.basename($0, ".rb") + ".pdf")