surface_master 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,6 +5,7 @@ module SurfaceMaster
5
5
  # This is all predicated upon our fixed mapping being applied.
6
6
  module MIDICodes
7
7
  # TODO: Use a lib to do a deep-freeze.
8
+ # rubocop:disable Metrics/LineLength
8
9
  CONTROLS = { 0x90 => { 0x00 => { type: :pad, action: :down, control: { bank: 1 } },
9
10
  0x01 => { type: :pad, action: :down, control: { bank: 2 } },
10
11
  0x02 => { type: :pad, action: :down, control: { bank: 3 } },
@@ -21,7 +22,8 @@ module SurfaceMaster
21
22
  0x03 => { type: :knob, action: :update, control: { vknob: 4 } },
22
23
  0x0C => { type: :accelerometer, action: :tilt, control: { axis: :x } },
23
24
  0x0D => { type: :accelerometer, action: :tilt, control: { axis: :y } },
24
- 0x0F => { type: :control, action: :switch, control: { } } } }.freeze
25
+ 0x0F => { type: :control, action: :switch, control: {} } } }.freeze
26
+ # rubocop:enable Metrics/LineLength
25
27
  SHOULDERS = { 0x03 => { button: :left },
26
28
  0x04 => { button: :right } }.freeze
27
29
  SELECTORS = { 0x01 => { selector: :banks },
@@ -1,3 +1,4 @@
1
+ #
1
2
  module SurfaceMaster
2
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
3
4
  end
File without changes
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.push File.expand_path("../lib", __FILE__)
3
3
  require "surface_master/version"
4
4
 
5
5
  Gem::Specification.new do |s|
@@ -8,9 +8,11 @@ Gem::Specification.new do |s|
8
8
  s.authors = ["Jon Frisby"]
9
9
  s.email = ["jfrisby@mrjoy.com"]
10
10
  s.homepage = "https://github.com/MrJoy/surface_master"
11
- s.summary = %q{A gem for accessing various MIDI control surfaces programmatically.}
12
- s.description = %q{This gem provides an interface to access Novation's LaunchPad Mark 2, and Numark's Orbit programmatically. LEDs can be lit and button presses can be read.}
13
- # TODO: Update docs to give credit to Thomas Jachmann (self@thomasjachmann.com) for his `launchpad` gem.
11
+ s.summary = "A gem for accessing various MIDI control surfaces programmatically."
12
+ s.description = "This gem provides an interface to access Novation's LaunchPad Mark 2, and"\
13
+ " Numark's Orbit programmatically. LEDs can be lit and button presses can be read."
14
+ # TODO: Update docs to give credit to Thomas Jachmann (self@thomasjachmann.com) for his
15
+ # TODO: `launchpad` gem.
14
16
 
15
17
  s.required_ruby_version = ">= 2.2.0"
16
18
 
@@ -21,6 +23,6 @@ Gem::Specification.new do |s|
21
23
 
22
24
  s.files = `git ls-files`.split("\n")
23
25
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
24
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
26
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
25
27
  s.require_paths = ["lib"]
26
28
  end
data/test/helper.rb CHANGED
@@ -1,44 +1,43 @@
1
- require 'minitest/spec'
2
- require 'minitest/autorun'
3
-
4
- begin
5
- require 'minitest/reporters'
6
- MiniTest::Reporters.use!
7
- rescue LoadError
8
- # ignore when it's not there - must be ruby 1.8
9
- end
1
+ require "minitest/spec"
2
+ require "minitest/autorun"
3
+ require "minitest/reporters"
10
4
 
11
- require 'mocha/setup'
5
+ MiniTest::Reporters.use!
12
6
 
13
- require 'launchpad'
7
+ require "mocha/setup"
14
8
 
15
- # mock Portmidi for tests
16
- module Portmidi
9
+ require "surface_master"
17
10
 
11
+ # Mock for tests
12
+ module Portmidi
13
+ # Mock for tests
18
14
  class Input
19
15
  attr_accessor :device_id
20
16
  def initialize(device_id)
21
17
  self.device_id = device_id
22
18
  end
23
- def read(*args); nil; end
19
+
20
+ def read(*_args); nil; end
24
21
  def close; nil; end
25
22
  end
26
23
 
24
+ # Mock for tests
27
25
  class Output
28
26
  attr_accessor :device_id
29
27
  def initialize(device_id)
30
28
  self.device_id = device_id
31
29
  end
32
- def write(*args); nil; end
30
+
31
+ def write(*_args); nil; end
32
+ def write_sysex(*_args); nil; end
33
33
  def close; nil; end
34
34
  end
35
35
 
36
36
  def self.input_devices; mock_devices; end
37
37
  def self.output_devices; mock_devices; end
38
38
  def self.start; end
39
-
40
39
  end
41
40
 
42
41
  def mock_devices(opts = {})
43
- [Portmidi::Device.new(opts[:id] || 1, 0, 0, opts[:name] || 'Launchpad MK2')]
42
+ [Portmidi::Device.new(opts[:id] || 1, 0, 0, opts[:name] || "Launchpad MK2")]
44
43
  end