Sha256: f91e71c30c1b16c9c38663835466a3fbb9d1789b49a9ef222042eed132d34e16

Contents?: true

Size: 1.79 KB

Versions: 1

Compression:

Stored size: 1.79 KB

Contents

= sinatra-cometio

* http://github.com/shokai/sinatra-cometio

== INSTALL:

* gem install sinatra-cometio

== DESCRIPTION:

Node.js like Comet I/O plugin for Sinatra

== SYNOPSIS:

server

  require 'sinatra'
  require 'sinatra/cometio'

  ## echo
  CometIO.on :chat do |data|
    self.push :chat, data
  end


client HTML

  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  <script src="<%= cometio_js %>"></script>


client JavaScript

  var io = new CometIO().connect();

  // client <-- server
  io.on("chat", function(data){
    consle.log(data.name+" : "+data.message);
  });

  // client --> server
  io.push("chat", {name: "shokai", message: "hello"});

== REQUIREMENTS:

* Ruby 1.8.7+ or 1.9.2+

== LICENSE:

(The MIT License)

Copyright (c) 2012 Sho Hashimoto

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sinatra-cometio-0.0.1 README.rdoc