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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/morsecode_listener.rb +6 -2
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1860352dccc07b10bb9ba95f1796083d5a3fd244
|
4
|
+
data.tar.gz: 178d273c594cb7552d4362e87aae4fd79166b4f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6fa61dfeaa11dcb366bed3c55d090282e17a391181d3fd37af5c516a286876c8cda9af931ccbcf17d7a5411ac151295c277da8b1e21fbc62a0a890076dd3e04
|
7
|
+
data.tar.gz: 0b8daa7c486efbd94d42efa4fa8c5cd76f8eca9ee9e380ee2579cb18a31dbfbe52d6b1339d9558ef79c3960580bf83563f10d120947ff422f2ceb9331af4ab90
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/morsecode_listener.rb
CHANGED
@@ -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.
|
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-
|
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
|