LeapMotion WebSocket wrapper for Ruby
% gem install leapmotion
- Ruby1.8.7+
- Leap Motion.app
/Applications/Leap Motion.app
- It provides WebSocket API.
require 'rubygems' require 'leapmotion' leap = LeapMotion.connect leap.on :connect do puts "connect" end leap.on :disconnect do puts "disconnect" exit end leap.on :data do |data| puts "hands #{data.hands.size}" puts "pointables #{data.pointables.size}" puts data puts "-"*5 end leap.on :error do |err| STDERR.puts err end leap.wait
leap = LeapMotion.connect :gestures => true leap.on :gestures do |gestures| gestures.each do |g| puts g.type puts g end puts "-"*5 end leap.wait
% gem install bundler % bundle install % bundle exec rake test
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request