leap-motion 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +32 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +1 -0
- data/README.rdoc +79 -0
- data/Rakefile +31 -0
- data/VERSION +1 -0
- data/ext/motion/LeapRuby.cpp +16054 -0
- data/ext/motion/LeapRuby.h +34 -0
- data/ext/motion/extconf.rb +26 -0
- data/ext/motion/swig/Leap.h +4566 -0
- data/ext/motion/swig/Leap.i +799 -0
- data/ext/motion/swig/LeapMath.h +1036 -0
- data/leap-motion.gemspec +28 -0
- data/lib/leap-motion.rb +1 -0
- data/lib/motion/libLeap.dylib +0 -0
- data/samples/test.rb +47 -0
- data/test/helper.rb +17 -0
- metadata +134 -0
data/leap-motion.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "leap-motion"
|
5
|
+
s.description = "Ruby interface to the Leap Motion Controller (via SWIG)"
|
6
|
+
s.summary = "Ruby interface to the Leap Motion Controller (via SWIG)"
|
7
|
+
|
8
|
+
s.version = open(File.join(File.dirname(__FILE__), "VERSION")).read
|
9
|
+
s.platform = Gem::Platform::RUBY
|
10
|
+
|
11
|
+
s.authors = ["Gregoire Lejeune"]
|
12
|
+
s.email = "gregoire.lejeune@free.fr"
|
13
|
+
s.homepage = "https://github.com/glejeune/ruby-leap-motion"
|
14
|
+
s.license = "MIT"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- test/*`.split("\n")
|
18
|
+
s.extra_rdoc_files = ["LICENSE.txt","README.rdoc"]
|
19
|
+
s.extensions = ["ext/motion/extconf.rb"]
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.add_development_dependency("shoulda")
|
23
|
+
s.add_development_dependency("bundler")
|
24
|
+
s.add_development_dependency("rdoc")
|
25
|
+
s.add_development_dependency("rake")
|
26
|
+
s.add_development_dependency("rake-compiler")
|
27
|
+
end
|
28
|
+
|
data/lib/leap-motion.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require_relative 'motion/motion'
|
Binary file
|
data/samples/test.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'leap-motion'
|
2
|
+
|
3
|
+
class MyListener < Leap::Motion::Listener
|
4
|
+
def on_init x
|
5
|
+
print "on_init"
|
6
|
+
p x
|
7
|
+
end
|
8
|
+
|
9
|
+
def on_connect x
|
10
|
+
print "on_connect"
|
11
|
+
p x
|
12
|
+
end
|
13
|
+
|
14
|
+
def on_disconnect x
|
15
|
+
print "on disconnect"
|
16
|
+
p x
|
17
|
+
end
|
18
|
+
|
19
|
+
def on_exit x
|
20
|
+
print "on exit"
|
21
|
+
p x
|
22
|
+
end
|
23
|
+
|
24
|
+
def on_frame x
|
25
|
+
print "on frame"
|
26
|
+
p x
|
27
|
+
end
|
28
|
+
|
29
|
+
def on_focus_gained x
|
30
|
+
print "on focus gained"
|
31
|
+
p x
|
32
|
+
end
|
33
|
+
|
34
|
+
def on_focus_lost x
|
35
|
+
print "on focus lost"
|
36
|
+
p x
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
listener = MyListener.new
|
41
|
+
controller = Leap::Motion::Controller.new
|
42
|
+
controller.add_listener listener
|
43
|
+
|
44
|
+
gone = gets
|
45
|
+
print gone
|
46
|
+
|
47
|
+
controller.remove_listener listener
|
data/test/helper.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'test/unit'
|
4
|
+
require 'shoulda'
|
5
|
+
require 'pathname'
|
6
|
+
|
7
|
+
cur = Pathname.new(File.expand_path("..", __FILE__))
|
8
|
+
lib = cur.join('..', 'lib')
|
9
|
+
ext = cur.join('..', 'ext')
|
10
|
+
|
11
|
+
unless ext.join("motion.so").exist? or ext.join("motion.bundle").exist? or ext.join("motion.dll").exist?
|
12
|
+
abort " ! Unable to run tests. Please run `rake compile` first"
|
13
|
+
end
|
14
|
+
|
15
|
+
$LOAD_PATH.unshift(lib.to_s, ext.to_s, cur.to_s)
|
16
|
+
require 'motion'
|
17
|
+
|
metadata
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: leap-motion
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gregoire Lejeune
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-03-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: shoulda
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rdoc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake-compiler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Ruby interface to the Leap Motion Controller (via SWIG)
|
84
|
+
email: gregoire.lejeune@free.fr
|
85
|
+
executables: []
|
86
|
+
extensions:
|
87
|
+
- ext/motion/extconf.rb
|
88
|
+
extra_rdoc_files:
|
89
|
+
- LICENSE.txt
|
90
|
+
- README.rdoc
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- Gemfile
|
94
|
+
- LICENSE.txt
|
95
|
+
- README.rdoc
|
96
|
+
- Rakefile
|
97
|
+
- VERSION
|
98
|
+
- ext/motion/LeapRuby.cpp
|
99
|
+
- ext/motion/LeapRuby.h
|
100
|
+
- ext/motion/extconf.rb
|
101
|
+
- ext/motion/swig/Leap.h
|
102
|
+
- ext/motion/swig/Leap.i
|
103
|
+
- ext/motion/swig/LeapMath.h
|
104
|
+
- leap-motion.gemspec
|
105
|
+
- lib/leap-motion.rb
|
106
|
+
- lib/motion/libLeap.dylib
|
107
|
+
- samples/test.rb
|
108
|
+
- test/helper.rb
|
109
|
+
homepage: https://github.com/glejeune/ruby-leap-motion
|
110
|
+
licenses:
|
111
|
+
- MIT
|
112
|
+
metadata: {}
|
113
|
+
post_install_message:
|
114
|
+
rdoc_options: []
|
115
|
+
require_paths:
|
116
|
+
- lib
|
117
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
requirements: []
|
128
|
+
rubyforge_project:
|
129
|
+
rubygems_version: 2.2.2
|
130
|
+
signing_key:
|
131
|
+
specification_version: 4
|
132
|
+
summary: Ruby interface to the Leap Motion Controller (via SWIG)
|
133
|
+
test_files:
|
134
|
+
- test/helper.rb
|