midiator 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/LICENSE +1 -1
- data/Rakefile +3 -3
- data/lib/midiator.rb +1 -7
- data/lib/midiator/interface.rb +8 -10
- data/spec/interface_spec.rb +13 -6
- metadata +16 -32
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2008, Ben Bleything <ben@bleything.net>
|
3
|
+
Copyright (c) 2008-2011, Ben Bleything <ben@bleything.net>
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
6
6
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
@@ -8,11 +8,11 @@ Hoe.spec 'midiator' do
|
|
8
8
|
self.history_file = 'CHANGELOG.md'
|
9
9
|
self.readme_file = 'README.md'
|
10
10
|
|
11
|
-
### Depend on Platform
|
12
|
-
self.extra_deps << [ 'Platform', '>= 0.4.0' ]
|
13
|
-
|
14
11
|
### Test with rspec
|
15
12
|
self.extra_dev_deps << [ 'rspec', '>= 2.1.0' ]
|
16
13
|
self.testlib = :rspec
|
17
14
|
|
15
|
+
### build zip files too
|
16
|
+
self.need_zip = true
|
17
|
+
|
18
18
|
end
|
data/lib/midiator.rb
CHANGED
@@ -14,15 +14,9 @@
|
|
14
14
|
#
|
15
15
|
|
16
16
|
module MIDIator
|
17
|
-
VERSION = "0.
|
17
|
+
VERSION = "0.4.0"
|
18
18
|
end
|
19
19
|
|
20
|
-
#####################################################################
|
21
|
-
### E X T E R N A L D E P E N D E N C I E S
|
22
|
-
#####################################################################
|
23
|
-
require 'rubygems'
|
24
|
-
require 'platform'
|
25
|
-
|
26
20
|
#####################################################################
|
27
21
|
### C O R E L I B R A R Y E X T E N S I O N S
|
28
22
|
#####################################################################
|
data/lib/midiator/interface.rb
CHANGED
@@ -26,21 +26,19 @@ class MIDIator::Interface
|
|
26
26
|
|
27
27
|
### Automatically select a driver to use
|
28
28
|
def autodetect_driver
|
29
|
-
driver = case
|
30
|
-
when
|
29
|
+
driver = case RUBY_PLATFORM
|
30
|
+
when /darwin/
|
31
31
|
:core_midi
|
32
|
-
when
|
32
|
+
when /cygwin/, /mingw/
|
33
33
|
:winmm
|
34
|
-
when
|
34
|
+
when /linux/
|
35
35
|
:alsa
|
36
|
+
when /java/
|
37
|
+
:mmj if Java::java.lang.System.get_property('os.name') == 'Mac OS X'
|
36
38
|
else
|
37
|
-
|
38
|
-
:mmj
|
39
|
-
else
|
40
|
-
raise "No driver is available."
|
41
|
-
end
|
39
|
+
raise "No driver is available."
|
42
40
|
end
|
43
|
-
|
41
|
+
|
44
42
|
self.use(driver)
|
45
43
|
end
|
46
44
|
|
data/spec/interface_spec.rb
CHANGED
@@ -30,7 +30,7 @@ describe MIDIator::Interface do
|
|
30
30
|
describe "auto-detects the correct driver for your platform" do
|
31
31
|
before( :all ) do
|
32
32
|
# remember platform so we can reset it later
|
33
|
-
@ruby_platform =
|
33
|
+
@ruby_platform = RUBY_PLATFORM
|
34
34
|
|
35
35
|
# suppress warnings (http://www.ruby-forum.com/topic/127608)
|
36
36
|
$-v = nil
|
@@ -38,28 +38,35 @@ describe MIDIator::Interface do
|
|
38
38
|
|
39
39
|
after( :all ) do
|
40
40
|
# reset platform to whatever is correct for our platform
|
41
|
-
|
41
|
+
RUBY_PLATFORM = @ruby_platform
|
42
42
|
|
43
43
|
# restore warnings (http://www.ruby-forum.com/topic/127608)
|
44
44
|
$-v = false
|
45
45
|
end
|
46
46
|
|
47
|
-
it "selects WinMM for Windows" do
|
48
|
-
|
47
|
+
it "selects WinMM for Windows/RubyInstaller" do
|
48
|
+
RUBY_PLATFORM = "i386-mingw32"
|
49
|
+
@interface.should_receive( :use ).with( :winmm )
|
50
|
+
|
51
|
+
@interface.autodetect_driver
|
52
|
+
end
|
53
|
+
|
54
|
+
it "selects WinMM for Windows/cygwin" do
|
55
|
+
RUBY_PLATFORM = "i386-cygwin"
|
49
56
|
@interface.should_receive( :use ).with( :winmm )
|
50
57
|
|
51
58
|
@interface.autodetect_driver
|
52
59
|
end
|
53
60
|
|
54
61
|
it "selects CoreMIDI for OSX" do
|
55
|
-
|
62
|
+
RUBY_PLATFORM = "universal-darwin10.0"
|
56
63
|
@interface.should_receive( :use ).with( :core_midi )
|
57
64
|
|
58
65
|
@interface.autodetect_driver
|
59
66
|
end
|
60
67
|
|
61
68
|
it "selects ALSA for Linux" do
|
62
|
-
|
69
|
+
RUBY_PLATFORM = "x86_64-linux"
|
63
70
|
@interface.should_receive( :use ).with( :alsa )
|
64
71
|
|
65
72
|
@interface.autodetect_driver
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: midiator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 4
|
9
|
+
- 0
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ben Bleything
|
@@ -15,29 +15,13 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-25 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
name: Platform
|
23
|
-
prerelease: false
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 15
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 4
|
33
|
-
- 0
|
34
|
-
version: 0.4.0
|
35
|
-
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
21
|
- !ruby/object:Gem::Dependency
|
38
22
|
name: rubyforge
|
39
23
|
prerelease: false
|
40
|
-
requirement: &
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
41
25
|
none: false
|
42
26
|
requirements:
|
43
27
|
- - ">="
|
@@ -49,11 +33,11 @@ dependencies:
|
|
49
33
|
- 4
|
50
34
|
version: 2.0.4
|
51
35
|
type: :development
|
52
|
-
version_requirements: *
|
36
|
+
version_requirements: *id001
|
53
37
|
- !ruby/object:Gem::Dependency
|
54
38
|
name: rspec
|
55
39
|
prerelease: false
|
56
|
-
requirement: &
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
57
41
|
none: false
|
58
42
|
requirements:
|
59
43
|
- - ">="
|
@@ -65,11 +49,11 @@ dependencies:
|
|
65
49
|
- 0
|
66
50
|
version: 2.1.0
|
67
51
|
type: :development
|
68
|
-
version_requirements: *
|
52
|
+
version_requirements: *id002
|
69
53
|
- !ruby/object:Gem::Dependency
|
70
54
|
name: hoe
|
71
55
|
prerelease: false
|
72
|
-
requirement: &
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
73
57
|
none: false
|
74
58
|
requirements:
|
75
59
|
- - ">="
|
@@ -77,11 +61,11 @@ dependencies:
|
|
77
61
|
hash: 19
|
78
62
|
segments:
|
79
63
|
- 2
|
80
|
-
-
|
81
|
-
-
|
82
|
-
version: 2.
|
64
|
+
- 7
|
65
|
+
- 0
|
66
|
+
version: 2.7.0
|
83
67
|
type: :development
|
84
|
-
version_requirements: *
|
68
|
+
version_requirements: *id003
|
85
69
|
description: |-
|
86
70
|
A nice Ruby interface to your system's MIDI services.
|
87
71
|
|
@@ -163,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
147
|
requirements: []
|
164
148
|
|
165
149
|
rubyforge_project: midiator
|
166
|
-
rubygems_version: 1.
|
150
|
+
rubygems_version: 1.4.2
|
167
151
|
signing_key:
|
168
152
|
specification_version: 3
|
169
153
|
summary: A nice Ruby interface to your system's MIDI services
|