Test PR#4
Open
erithmetic wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
socket.io-ruby
NOTICE This project is no longer maintained. I will accept tested pull requests, but that's it!
[Socket.io] for the Ruby Kids. A plugin for Cramp. Socket.io is a library that makes writing cross-borwser websockets super easy and resilient.
Usage
This implementation Socket.io works within an existing cramp app.
Cramp is similar in spirit to Rails but specializes in evented web apps. Simply
gem install crampand runcramp new myapp.Define a new Cramp::Action and include SocketIo::Websocket. Then define which
method should handle certain events and messages.
By default, Cramp uses HttpRouter in config/routes.rb to manage connections. SocketIo has a handy helper for that:
Optionally, SocketIo.routes can take a path. The default is
/socket.io.Throw that in with some Thin or Rainbows, and you've got yourself a websocket server!
Note that you'll need to configure cramp's websocket adapter to use thin or rainbows:
Here's the client-side code to make it all happen:
Note on Patches/Pull Requests
future version unintentionally.
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
Copyright
Copyright (c) 2011 Derek Kastner. See LICENSE for details.