opal-web-midi 0.0.1 → 0.0.2

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: 2f5fee060fbecb4c1e9f5acf3676a90204369a9b
4
- data.tar.gz: c1be40f251cf017fa1206a1f7994755c55c79e15
3
+ metadata.gz: 91981e093164b481a5917ee8bcb2d2e2b05e877c
4
+ data.tar.gz: f7a21e05f78d03eb70538a9d325890666a158a0d
5
5
  SHA512:
6
- metadata.gz: f0135a90228a9d61f276628614bce52c926891c258657f8549f80dceb7fde7797b0076cc18041e784c3a615222089f66dd99cc1157cf9bfd08789009c0bdfdcf
7
- data.tar.gz: 783187a3b2f4423c557c88dfd76eab13da6d88cd1a54e8eb8b7a698dadcadf38bc73540116c078a60df000d457d47b343e4adaf901b61fe5aff2c648c87e8379
6
+ metadata.gz: a749bad34950d6e7c2f7d56e901509e949d0b11651d29ca59351081eb7a39c77e2cda6403c35a05d9fddd60f1c2d64d4a895f011555eb274c3869170ef5612d1
7
+ data.tar.gz: 9a715526d57c76a7d84502ca9f8645c3e40fa9d16e1979fae9e023bca32af3d570390c8c4aa30d4b4eae5b2bdb7cfd1ed870990395ee2a93e712cf5668716214
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'opal-web-midi'
3
- s.version = '0.0.1'
3
+ s.version = '0.0.2'
4
4
  s.authors = ['Michał Kalbarczyk']
5
5
  s.email = 'fazibear@gmail.com'
6
6
  s.homepage = 'http://github.com/fazibear/opal-web-midi'
@@ -1,7 +1,13 @@
1
1
  module WebMidi
2
2
  Navigator = Native(`navigator`)
3
3
 
4
+ def self.support?
5
+ Native(`navigator.requestMIDIAccess !== undefined`)
6
+ end
7
+
4
8
  def self.request_access(options = {}, &block)
9
+ raise "WebMIDI not supported" unless support?
10
+
5
11
  success = lambda do |access|
6
12
  block.call Access.new(access)
7
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-web-midi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Kalbarczyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-26 00:00:00.000000000 Z
11
+ date: 2016-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal