diff --git a/Gemfile b/Gemfile index 64ea972..b05d248 100644 --- a/Gemfile +++ b/Gemfile @@ -1,12 +1,11 @@ # frozen_string_literal: true - source 'https://rubygems.org' gem 'rake', '~> 13.0', '>= 13.0.6', groups: %i[development test] gem 'rspec', '~> 3.11', '>= 3.11.0', groups: %i[test] -gem 'rubocop', '~> 1.25', '>= 1.25.1', groups: %i[development test] +gem 'rubocop', '~> 1.10', '>= 1.10.0', groups: %i[development test], require: false -gem 'alsa-rawmidi', '~> 0.3', '>= 0.3.1', require: false # linux -gem 'ffi-coremidi', '~> 0.5', '>= 0.5.0', require: false # osx -gem 'midi-jruby', '~> 0.1', '>= 0.1.4', require: false # jruby +gem 'alsa-rawmidi', '~> 0.4', '>= 0.4.0', require: false # linux +gem 'ffi-coremidi', '~> 0.5', '>= 0.5.1', require: false # osx +gem 'midi-jruby', '~> 0.2', '>= 0.2.0', require: false # jruby gem 'midi-winmm', '~> 0.1', '>= 0.1.10', require: false # windows diff --git a/README.md b/README.md index 660c9ee..40432c8 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ Also see [MicroMIDI](http://github.com/arirusso/micromidi) which builds a full M ### Requirements -Using Ruby 1.9.2 or JRuby 1.6.1 (or newer) is strongly recommended. JRuby should be run in 1.9 mode where applicable - UniMIDI uses one of the following libraries, depending on which platform you're using it on. The necessary library should install automatically with the unimidi gem. Platform @@ -57,7 +55,7 @@ UniMIDI includes a set of tests which assume that an output is connected to an i The tests can be run using -`rake test` +`rake spec` See below for additional notes on testing with JRuby @@ -69,7 +67,6 @@ See below for additional notes on testing with JRuby ##### JRuby -* You must be in 1.9 mode. This is normally accomplished by passing --1.9 to JRuby at the command line. For testing in 1.9 mode, use `jruby --1.9 -S rake test` * javax.sound has some documented issues with SysEx messages in some versions OSX Snow Leopard which do affect this library. ##### Linux diff --git a/lib/unimidi.rb b/lib/unimidi.rb index d6b419e..f35b26a 100644 --- a/lib/unimidi.rb +++ b/lib/unimidi.rb @@ -20,7 +20,7 @@ require 'unimidi/output' module UniMIDI - VERSION = '0.5.0' + VERSION = '0.5.1' Platform.bootstrap end diff --git a/lib/unimidi/adapter/alsa-rawmidi.rb b/lib/unimidi/adapter/alsa-rawmidi.rb index fd80034..0fc9653 100644 --- a/lib/unimidi/adapter/alsa-rawmidi.rb +++ b/lib/unimidi/adapter/alsa-rawmidi.rb @@ -1,5 +1,4 @@ # frozen_string_literal: true - require 'alsa-rawmidi' module UniMIDI diff --git a/spec/integration/helper.rb b/spec/integration/helper.rb index 400630e..07b941c 100644 --- a/spec/integration/helper.rb +++ b/spec/integration/helper.rb @@ -9,7 +9,7 @@ module Integration module_function def sysex_ok? - ENV['_system_name'] != 'OSX' || !RUBY_PLATFORM.include?('java') + !RUBY_PLATFORM.include?('java') || RbConfig::CONFIG["host_os"] != 'darwin' end def devices diff --git a/spec/integration/input_spec.rb b/spec/integration/input_spec.rb index 3073b2e..e7701df 100644 --- a/spec/integration/input_spec.rb +++ b/spec/integration/input_spec.rb @@ -8,7 +8,7 @@ let(:output) { SpecHelper::Integration.devices[:output].open } let(:messages) { SpecHelper::Integration.numeric_messages } before do - sleep 0.1 + sleep 0.3 input.buffer.clear end @@ -24,7 +24,7 @@ p "sending: #{message}" output.puts(message) sent_bytes += message - sleep 0.1 + sleep 0.3 buffer = input.buffer.map { |m| m[:data] }.flatten p "received: #{buffer}" expect(buffer).to eq(sent_bytes) diff --git a/spec/integration/io_spec.rb b/spec/integration/io_spec.rb index 8a62e5c..95ff435 100644 --- a/spec/integration/io_spec.rb +++ b/spec/integration/io_spec.rb @@ -6,7 +6,10 @@ # these tests assume that TestOutput is connected to TestInput let(:input) { SpecHelper::Integration.devices[:input].open } let(:output) { SpecHelper::Integration.devices[:output].open } - + before do + sleep 0.3 + input.buffer.clear + end after do input.close output.close @@ -23,7 +26,7 @@ p "sending: #{message}" output.puts(message) - sleep(0.1) + sleep 0.3 received = input.gets.map { |m| m[:data] }.flatten p "received: #{received}" @@ -46,7 +49,7 @@ p "sending: #{message}" output.puts(message) - sleep(0.1) + sleep 0.3 received = input.gets_bytestr.map { |m| m[:data] }.flatten.join p "received: #{received}" @@ -69,7 +72,7 @@ p "sending: #{message.inspect}" output.puts(message) - sleep(0.1) + sleep 0.3 received = input.gets.map { |m| m[:data] }.flatten p "received: #{received}"