No commit activity in last 3 years
No release in over 3 years
linda-socket.io client for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

Linda::SocketIO::Client

Travis-CI build status

Installation

% gem install linda-socket.io-client

Usage

samples/sample.rb

require 'rubygems'
require 'linda-socket.io-client'

linda = Linda::SocketIO::Client.connect 'http://node-linda-base.herokuapp.com'
ts = linda.tuplespace('test')

linda.io.on :connect do
  puts "connect!! #{linda.url}"

  ts.watch type: "chat" do |err, tuple|
    next if err
    puts "> #{tuple.data.msg} (from:#{tuple.from})"
  end
end

linda.io.on :disconnect do
  puts "disconnect"
end

linda.io.on :error do |err|
  p err
end

while line = STDIN.gets
  line.strip!
  next if line.empty?
  ts.write(type: "chat", msg: line, at: Time.now)
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