morsecode_listener 0.1.2 → 0.1.3

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: 891d94f4b97778961f9e97d2070ea61c857395ba
4
- data.tar.gz: 80c6aa550c55185251c8548955519a1021a73bbe
3
+ metadata.gz: 1860352dccc07b10bb9ba95f1796083d5a3fd244
4
+ data.tar.gz: 178d273c594cb7552d4362e87aae4fd79166b4f8
5
5
  SHA512:
6
- metadata.gz: 5c377ca9e271db1cd737724b4374e5832649bb36fcac6a9522e095a661fbd4a3906939efce07cada8ecb542b51be3678a783e91bbea69453a6273379dd97a834
7
- data.tar.gz: 1df47ed094012ec45fcb241ae4b75cb1173d4396c4ebb8e1b03e8f6513eea8dd838e07d640582e3d1badbbccf5699af7bc4078fa501fd0969182a5839f3a238d
6
+ metadata.gz: f6fa61dfeaa11dcb366bed3c55d090282e17a391181d3fd37af5c516a286876c8cda9af931ccbcf17d7a5411ac151295c277da8b1e21fbc62a0a890076dd3e04
7
+ data.tar.gz: 0b8daa7c486efbd94d42efa4fa8c5cd76f8eca9ee9e380ee2579cb18a31dbfbe52d6b1339d9558ef79c3960580bf83563f10d120947ff422f2ceb9331af4ab90
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -5,11 +5,11 @@
5
5
  class MorseCodeListener
6
6
 
7
7
  def initialize(short_delay: 0.35, long_delay: 1, dot: 2, dash: 1,
8
- separator: 4, space: 5, timeout: 2, notifier: nil)
8
+ separator: 4, space: 5, timeout: 2, notifier: nil, &on_message)
9
9
 
10
10
  @short_delay, @long_delay, @timeout = short_delay, long_delay, timeout
11
11
  @h = { dot: dot, dash: dash, separator: separator, space: space }
12
- @notifier = notifier
12
+ @notifier, @on_message = notifier, on_message
13
13
  @t, @a = nil, []
14
14
  end
15
15
 
@@ -49,6 +49,10 @@ class MorseCodeListener
49
49
  rescue
50
50
  puts 'warning: MorseCodeListener#on_keyup @notifier' + ($!).inspect
51
51
  end
52
+
53
+ elsif @on_message
54
+
55
+ @on_message.call s
52
56
 
53
57
  else
54
58
  puts '>> ' + s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morsecode_listener
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  QeOlrjRHjaoX6Fe0+97mHWeIWmS5UJg/HAPFoN5/rloT18fQU5aOdCI0xYs8iGnN
32
32
  djAZGJFKf67W+w==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-02-04 00:00:00.000000000 Z
34
+ date: 2016-04-21 00:00:00.000000000 Z
35
35
  dependencies: []
36
36
  description:
37
37
  email: james@r0bertson.co.uk
metadata.gz.sig CHANGED
Binary file