artoo-joystick 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0c85eb882b2e9308a8d8f3cdb26205510be784e
4
- data.tar.gz: 58c51740b9f39ce8c228871298a02b6ad7550375
3
+ metadata.gz: 286793d7267dda24af042bd17b55ff0aeb5ca777
4
+ data.tar.gz: da69d24c572e50ebd37a0e39a33eff29428861e0
5
5
  SHA512:
6
- metadata.gz: c8056e13185651b0d77f120b137146687eada40a9a5af15b70bb3fef25fa1abf9c4e25baf3f85aeb791dcb7d97780ea9b3b6ac64eeac9b994976639d70a416aa
7
- data.tar.gz: 275aafc357b7bf5b7159d3622019aee166e5cd025d66bdfd8353424601499b53b600a9deba37a54ab11d18bd5eab032d26d5fcc3a000a6061bd56c235c3594f2
6
+ metadata.gz: d302f72134b42cc08cbb3f3adff65a93a5f3a1662124a37116503e631a834d8b1aacaf283af64ad7049c6b6275f2d17f078420519510a5fb62d1dda8e3973634
7
+ data.tar.gz: 6fecde154a335843c8e3dacfb29027f8b57c6e61e9daa24459f95d8b7780c874654ee44bb4b0f4d2e32d661fb7ea0e738c258ab2e1ecd584b0b7a85a986582cd
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ - jruby-1.7.4
6
+ - rbx-19mode
7
+ matrix:
8
+ allow_failures:
9
+ - rvm: jruby-1.7.4
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- artoo-joystick (0.2.0)
5
- artoo (>= 1.3.0)
4
+ artoo-joystick (0.3.0)
5
+ artoo (>= 1.4.0)
6
6
  hybridgroup-ruby-sdl-ffi
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
- artoo (1.3.0)
11
+ artoo (1.4.1)
12
12
  celluloid (~> 0.15.0)
13
13
  celluloid-io (~> 0.15.0)
14
14
  multi_json (~> 1.6)
@@ -16,16 +16,18 @@ GEM
16
16
  rake
17
17
  reel (~> 0.4.0)
18
18
  thor (~> 0.18.1)
19
- celluloid (0.15.1)
19
+ celluloid (0.15.2)
20
20
  timers (~> 1.1.0)
21
21
  celluloid-io (0.15.0)
22
22
  celluloid (>= 0.15.0)
23
23
  nio4r (>= 0.5.0)
24
24
  coderay (1.0.9)
25
25
  ffi (1.9.0)
26
+ ffi (1.9.0-java)
26
27
  http (0.5.0)
27
28
  http_parser.rb
28
29
  http_parser.rb (0.6.0.beta.2)
30
+ http_parser.rb (0.6.0.beta.2-java)
29
31
  hybridgroup-ruby-sdl-ffi (0.4.1)
30
32
  nice-ffi (>= 0.2)
31
33
  metaclass (0.0.1)
@@ -34,14 +36,20 @@ GEM
34
36
  minitest-happy (1.0.0)
35
37
  mocha (0.14.0)
36
38
  metaclass (~> 0.0.1)
37
- multi_json (1.8.0)
39
+ multi_json (1.8.2)
38
40
  nice-ffi (0.4)
39
41
  ffi (>= 0.5.0)
40
42
  nio4r (0.5.0)
43
+ nio4r (0.5.0-java)
41
44
  pry (0.9.12.2)
42
45
  coderay (~> 1.0.5)
43
46
  method_source (~> 0.8)
44
47
  slop (~> 3.4)
48
+ pry (0.9.12.2-java)
49
+ coderay (~> 1.0.5)
50
+ method_source (~> 0.8)
51
+ slop (~> 3.4)
52
+ spoon (~> 0.0)
45
53
  rake (10.1.0)
46
54
  reel (0.4.0)
47
55
  celluloid (>= 0.15.1)
@@ -50,6 +58,8 @@ GEM
50
58
  http_parser.rb (>= 0.6.0.beta.2)
51
59
  websocket_parser (>= 0.1.4)
52
60
  slop (3.4.6)
61
+ spoon (0.0.4)
62
+ ffi
53
63
  thor (0.18.1)
54
64
  timers (1.1.0)
55
65
  websocket_parser (0.1.4)
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
21
  s.require_paths = ["lib"]
22
22
 
23
- s.add_runtime_dependency 'artoo', '>= 1.3.0'
23
+ s.add_runtime_dependency 'artoo', '>= 1.4.0'
24
24
  s.add_runtime_dependency 'hybridgroup-ruby-sdl-ffi'
25
25
  s.add_development_dependency 'minitest', '>= 5.0'
26
26
  s.add_development_dependency 'minitest-happy'
@@ -4,8 +4,11 @@ connection :joystick, :adaptor => :joystick
4
4
  device :controller, :driver => :xbox360, :connection => :joystick, :interval => 0.1
5
5
 
6
6
  work do
7
- on controller, :joystick => proc { |*value|
8
- puts "joystick #{value[1][:s]} x:#{value[1][:x]} y:#{value[1][:y]}"
7
+ on controller, :joystick_0 => proc { |*value|
8
+ puts "joystick 0 - x:#{value[1][:x]} y:#{value[1][:y]}"
9
+ }
10
+ on controller, :joystick_1 => proc { |*value|
11
+ puts "joystick 1 - x:#{value[1][:x]} y:#{value[1][:y]}"
9
12
  }
10
13
  on controller, :button_a => proc { |*value|
11
14
  puts "ayyyy!"
@@ -1,5 +1,5 @@
1
1
  module Artoo
2
2
  module Joystick
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
@@ -5,15 +5,8 @@ module Artoo
5
5
  # Connect to a joystick device
6
6
  # @see device documentation for more information
7
7
  class Joystick < Adaptor
8
- finalizer :finalize
9
8
  attr_reader :joystick
10
9
 
11
- # Closes connection with device if connected
12
- # @return [Boolean]
13
- def finalize
14
- disconnect if connected?
15
- end
16
-
17
10
  # Creates a connection with device
18
11
  # @return [Boolean]
19
12
  def connect
@@ -22,7 +15,7 @@ module Artoo
22
15
  ::SDL.Init( ::SDL::INIT_JOYSTICK )
23
16
 
24
17
  raise "No SDL joystick available" if num_joysticks == 0
25
-
18
+
26
19
  @joystick = ::SDL.JoystickOpen(0) # TODO: allow user to choose which joystick
27
20
 
28
21
  super
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artoo-joystick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ron Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-04 00:00:00.000000000 Z
11
+ date: 2013-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: artoo
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.0
19
+ version: 1.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.3.0
26
+ version: 1.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: hybridgroup-ruby-sdl-ffi
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -87,6 +87,7 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - .travis.yml
90
91
  - Gemfile
91
92
  - Gemfile.lock
92
93
  - LICENSE