metamaps--metamaps/app/workers/grab_map_screenshot_worker.rb
Devin Howard c6c05085ad Added phantomjs script to save an image - this doesn't totally work yet, it has a error with famous
Added worker process to call the phantomjs script in app/workers
Added hook in models/map.rb to call the worker
Added calls to map.touch in mappings_controller.rb so it would get triggered correctly - I'm not sure how this will proceed moving forward
2014-10-07 19:11:55 -04:00

11 lines
236 B
Ruby

# app/workers/grab_map_screenshot_worker.rb
class GrabMapScreenshotWorker
include Sidekiq::Worker
def perform(map_id)
Phantomjs.run('./script/phantomjs-save-screenshot.js', map_id.to_s) { |line|
puts line
}
end
end