Skip to content

Instantly share code, notes, and snippets.

@rubiety
Created January 15, 2012 00:00
Show Gist options
  • Save rubiety/1613478 to your computer and use it in GitHub Desktop.
Save rubiety/1613478 to your computer and use it in GitHub Desktop.
Background PNG Generation for Jazzity
require "capybara/rails"
Capybara.javascript_driver = :webkit
class StaffToPng
@queue = :staff_to_png
def self.perform(chord)
visit "/chords/#{chord}"
page.driver.render "generations/#{chord}.png"
end
end
# Generate on-the-fly:
Resque.enqueue(chord)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment