Project

twib

0.0
No commit activity in last 3 years
No release in over 3 years
Twili bridge 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.16
~> 10.0
~> 3.0

Runtime

 Project Readme

ruby-twib

Gem Version

Twili bridge client for Ruby, providing a way for Ruby applications to send requests to a Twili device via twibd.

Installation

Add this line to your application's Gemfile:

gem 'twib'

And then execute:

$ bundle

Or install it yourself as:

$ gem install twib

Usage

See the instructions on the Twili repository for how to set up Twili and twibd.

First, create a Twib::TwibConnection. There is a convenience method Twib::TwibConnection::connect_unix.

> require "twib"
 => true
> tc = Twib::TwibConnection.connect_unix
 => #<Twib::TwibConnection:...>

After that, you can list the available devices with TwibConnection#list_devices, which returns an array of hashes identifying each device.

> tc.list_devices
[{"device_id"=>507914862, ...}, ...]

Use TwibConnection#open_device to get a device's ITwibDeviceInterface.

> tc.open_device(507914862)
 => #<Twib::Interfaces::ITwibDeviceInterface:...>

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/misson20000/ruby-twib.

License

Copyright 2018 misson20000

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.