leapmotion 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/Gemfile.lock +3 -1
- data/History.txt +4 -0
- data/README.md +9 -0
- data/Rakefile +5 -0
- data/leapmotion.gemspec +1 -0
- data/lib/leapmotion/main.rb +4 -0
- data/lib/leapmotion/version.rb +1 -1
- data/test/test_gestures.rb +36 -0
- data/test/test_helper.rb +6 -0
- data/test/test_leapmotion.rb +47 -0
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39ac485633350248a4fd6087ea118b759e1ea766
|
4
|
+
data.tar.gz: fbb24a71d7537c9280ff2e5d62ffb0d7595e2c47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b6724fca4078e3adacc550dbeb02301663c5d65cb059e268b2c7c079fa9e747a8270b702a13be8c12bf07fbebcd64ca0b997bbec8d4120a15cb73339d01baa3
|
7
|
+
data.tar.gz: 3b5c1e716aa86bc75e0465df410a283f5ab860a2b9e926a3a0579cbacf9e2aa9076a4a1a5b9258175d56155c8ab224fd7b978bc7c2f01ad8a5e6ddb3d843a2b2
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
leapmotion (0.0.
|
4
|
+
leapmotion (0.0.4)
|
5
5
|
event_emitter
|
6
6
|
hashie
|
7
7
|
json
|
@@ -13,6 +13,7 @@ GEM
|
|
13
13
|
event_emitter (0.2.5)
|
14
14
|
hashie (2.0.5)
|
15
15
|
json (1.8.0)
|
16
|
+
minitest (5.0.6)
|
16
17
|
rake (10.1.0)
|
17
18
|
websocket (1.1.1)
|
18
19
|
websocket-client-simple (0.0.5)
|
@@ -26,4 +27,5 @@ PLATFORMS
|
|
26
27
|
DEPENDENCIES
|
27
28
|
bundler (~> 1.3)
|
28
29
|
leapmotion!
|
30
|
+
minitest
|
29
31
|
rake
|
data/History.txt
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
data/leapmotion.gemspec
CHANGED
data/lib/leapmotion/main.rb
CHANGED
data/lib/leapmotion/version.rb
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path "test_helper", File.dirname(__FILE__)
|
2
|
+
|
3
|
+
class TestGestures < MiniTest::Test
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@leap = LeapMotion.connect :gestures => true
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@leap.close
|
11
|
+
sleep 1
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_gestures
|
15
|
+
_gs = nil
|
16
|
+
STDERR.puts "plese move your hands."
|
17
|
+
@leap.on :gestures do |gestures|
|
18
|
+
_gs = gestures
|
19
|
+
end
|
20
|
+
while !_gs
|
21
|
+
sleep 1
|
22
|
+
end
|
23
|
+
g = _gs[0]
|
24
|
+
assert_equal g.class, LeapMotion::Data
|
25
|
+
assert_equal g.direction.class, Array
|
26
|
+
assert_equal g.duration.class, Fixnum
|
27
|
+
assert_equal g.handIds.class, Array
|
28
|
+
assert_equal g.pointableIds.class, Array
|
29
|
+
assert_equal g.position.class, Array
|
30
|
+
assert_equal g.speed.class, Float
|
31
|
+
assert_equal g.startPosition.class, Array
|
32
|
+
assert_equal g.state.class, String
|
33
|
+
assert ["swipe", "screenTap", "keyTap", "circle"].include? g.type
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require File.expand_path "test_helper", File.dirname(__FILE__)
|
2
|
+
|
3
|
+
class TestLeapMotion < MiniTest::Test
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@leap = LeapMotion.connect
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@leap.close
|
11
|
+
sleep 1
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_version
|
15
|
+
_connected = false
|
16
|
+
@leap.on :connect do
|
17
|
+
_connected = true
|
18
|
+
end
|
19
|
+
while !_connected
|
20
|
+
sleep 1
|
21
|
+
end
|
22
|
+
assert @leap.version > 0
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_data
|
26
|
+
_data = nil
|
27
|
+
@leap.on :data do |data|
|
28
|
+
_data = data
|
29
|
+
end
|
30
|
+
while !_data
|
31
|
+
sleep 1
|
32
|
+
end
|
33
|
+
assert_equal _data.class, LeapMotion::Data
|
34
|
+
assert_equal _data.id.class, Fixnum
|
35
|
+
assert_equal _data.currentFrameRate.class, Float
|
36
|
+
assert_equal _data.timestamp.class, Fixnum
|
37
|
+
assert_equal _data.hands.class, Array
|
38
|
+
assert_equal _data.pointables.class, Array
|
39
|
+
assert_equal _data.gestures.class, Array
|
40
|
+
assert_equal _data.interactionBox.center.class, Array
|
41
|
+
assert_equal _data.interactionBox["size"].class, Array
|
42
|
+
assert_equal _data.r.class, Array
|
43
|
+
assert_equal _data.t.class, Array
|
44
|
+
assert_equal _data.s.class, Float
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leapmotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: LeapMotion WebSocket wrapper for Ruby
|
98
112
|
email:
|
99
113
|
- hashimoto@shokai.org
|
@@ -115,6 +129,9 @@ files:
|
|
115
129
|
- lib/leapmotion/version.rb
|
116
130
|
- samples/dump.rb
|
117
131
|
- samples/gesture.rb
|
132
|
+
- test/test_gestures.rb
|
133
|
+
- test/test_helper.rb
|
134
|
+
- test/test_leapmotion.rb
|
118
135
|
homepage: https://github.com/shokai/leapmotion-ruby
|
119
136
|
licenses:
|
120
137
|
- MIT
|
@@ -139,4 +156,7 @@ rubygems_version: 2.0.5
|
|
139
156
|
signing_key:
|
140
157
|
specification_version: 4
|
141
158
|
summary: LeapMotion WebSocket wrapper for Ruby
|
142
|
-
test_files:
|
159
|
+
test_files:
|
160
|
+
- test/test_gestures.rb
|
161
|
+
- test/test_helper.rb
|
162
|
+
- test/test_leapmotion.rb
|