Cramp is a fully asynchronous real-time web application framework in Ruby. It is built on top of EventMachine and primarily designed for working with larger number of open connections and providing full-duplex bi-directional communication.
Ruby 1.9.2+ is the preferred version of Ruby for running Cramp. Installation process is quite straight forward:
$ gem install cramp
And here’s the obligatory “Hello World”:
# hello_world.ru require "rubygems" require 'cramp' class HomeAction < Cramp::Action def start render "Hello World" finish end end # thin --timeout 0 -R hello_world.ru start run HomeAction
Cramp ships with an application generator, which is great for getting off the ground.
$ cramp new realapp