Sha256: 9fcaa50c06b979ecf1b08a6bd09e5ddf9761a4637f1bcce2eb0819ab1395dd97

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

# statscloud.io-ruby-socket.io-client-simple

A simple ruby client for Node.js's Socket.IO v1.4.x, Supports only WebSocket.

v 1.2.1-1 Implement namespaces and simple binary support.

- https://gitlab.com/agiliumlabs/statscloud.io-ruby-socket.io-client-simple


## Install

gem install

    % gem install statscloud.io-ruby-socket.io-client-simple


or use `Gemfile` with Bundler

    gem 'statscloud.io-ruby-socket.io-client-simple'


## Usage

```ruby
require 'rubygems'
require 'statscloud.io-ruby-socket.io-client-simple'

def client 
  StatsCloudIO::SocketIO::Client::Simple
end

def configure
  url    = ARGV.shift || 'http://localhost:3000'
  socket = client.connect url
  
  socket.on :connect do
    puts "connect!!!"
  end
  
  socket.on :disconnect do
    puts "disconnected!!"
  end
  
  socket.on :error do |err|
    p err
  end
end

def send_data(chat, data)
  socket.emit chat, data
end

def send_binary_data(chat, data)
  socket.emit chat, client.as_byte_buffer(data)
end

```

## Test

    % gem install bundler
    % bundle install
    % npm install
    % bundle exec rake test


## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
statscloud.io-ruby-socket.io-client-simple-1.2.1.pre.3 README.md
statscloud.io-ruby-socket.io-client-simple-1.2.1.pre.2 README.md