unimidi 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
 
7
7
  module UniMIDI
8
8
 
9
- VERSION = "0.2.3"
9
+ VERSION = "0.2.4"
10
10
 
11
11
  end
12
12
 
@@ -11,7 +11,7 @@ module UniMIDI
11
11
  @device = device_obj
12
12
  @id = @device.id
13
13
  @name = @device.name
14
- @type = @device.type
14
+ populate_type
15
15
  end
16
16
 
17
17
  def enabled?
@@ -119,6 +119,15 @@ module UniMIDI
119
119
  end
120
120
 
121
121
  end
122
+
123
+ private
124
+
125
+ def populate_type
126
+ @type = case @device.type
127
+ when :source, :input then :input
128
+ when :destination, :output then :output
129
+ end
130
+ end
122
131
 
123
132
  end
124
133
 
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'helper'
4
+
5
+ class CongruousApiAdapterTest < Test::Unit::TestCase
6
+
7
+ include UniMIDI
8
+ include TestHelper
9
+
10
+ def test_input_type
11
+ i = $test_device[:input]
12
+ assert_equal(:input, i.type)
13
+ end
14
+
15
+ def test_output_type
16
+ o = $test_device[:output]
17
+ assert_equal(:output, o.type)
18
+ end
19
+
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unimidi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-03 00:00:00.000000000Z
12
+ date: 2011-09-08 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: alsa-rawmidi
16
- requirement: &70171461595880 !ruby/object:Gem::Requirement
16
+ requirement: &70272850205320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70171461595880
24
+ version_requirements: *70272850205320
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: ffi-coremidi
27
- requirement: &70171461595400 !ruby/object:Gem::Requirement
27
+ requirement: &70272850204440 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70171461595400
35
+ version_requirements: *70272850204440
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: midi-jruby
38
- requirement: &70171461594900 !ruby/object:Gem::Requirement
38
+ requirement: &70272850203760 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70171461594900
46
+ version_requirements: *70272850203760
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: midi-winmm
49
- requirement: &70171461594460 !ruby/object:Gem::Requirement
49
+ requirement: &70272850202940 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70171461594460
57
+ version_requirements: *70272850202940
58
58
  description: Platform Independent, realtime MIDI input and output for Ruby
59
59
  email:
60
60
  - ari.russo@gmail.com
@@ -73,6 +73,7 @@ files:
73
73
  - lib/unimidi/type_conversion.rb
74
74
  - lib/unimidi.rb
75
75
  - test/helper.rb
76
+ - test/test_congruous_api_adapter.rb
76
77
  - test/test_input_buffer.rb
77
78
  - test/test_io.rb
78
79
  - test/test_platform.rb