Headless, a Ruby wrapper for Xvfb
July 4, 2011 in ProjectsDescription
Headless is a Ruby wrapper for Xvfb, the virtual framebuffer.
Virtual framebuffers are used to run graphical software on a “headless”, i.e. display-less, server.
Headless makes it possible to create and release framebuffers straight from Ruby code. This is useful if you only need the framebuffer for a certain part or branch of the script.
require 'rubygems'
require 'headless'
Object notation
headless = Headless.new
# ... code using the framebuffer
headless.destroy
Block notation
Headless.ly do |headless|
# ... code using the framebuffer
end
Examples
Acceptance tests with a real browser
TODO
PDF generation
TODO
Installation
Headless requires an installed xvfb.
Ubuntu
sudo apt-get install xvfb
All systems
gem install headless
Links
- headless gem page on Rubygems
- headless sources on GitHub
- headless RDoc documentation
- Xvfb article on Wikipedia
Liked the post? Treat me to a coffee