morsecode_listener 0.1.1 → 0.1.2
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/lib/morsecode_listener.rb +6 -5
- data.tar.gz.sig +1 -1
- metadata +1 -1
- 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: 891d94f4b97778961f9e97d2070ea61c857395ba
|
4
|
+
data.tar.gz: 80c6aa550c55185251c8548955519a1021a73bbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c377ca9e271db1cd737724b4374e5832649bb36fcac6a9522e095a661fbd4a3906939efce07cada8ecb542b51be3678a783e91bbea69453a6273379dd97a834
|
7
|
+
data.tar.gz: 1df47ed094012ec45fcb241ae4b75cb1173d4396c4ebb8e1b03e8f6513eea8dd838e07d640582e3d1badbbccf5699af7bc4078fa501fd0969182a5839f3a238d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/morsecode_listener.rb
CHANGED
@@ -5,10 +5,10 @@
|
|
5
5
|
class MorseCodeListener
|
6
6
|
|
7
7
|
def initialize(short_delay: 0.35, long_delay: 1, dot: 2, dash: 1,
|
8
|
-
separator: 4, timeout: 2, notifier: nil)
|
8
|
+
separator: 4, space: 5, timeout: 2, notifier: nil)
|
9
9
|
|
10
10
|
@short_delay, @long_delay, @timeout = short_delay, long_delay, timeout
|
11
|
-
@h = { dot: dot, dash: dash, separator: separator }
|
11
|
+
@h = { dot: dot, dash: dash, separator: separator, space: space }
|
12
12
|
@notifier = notifier
|
13
13
|
@t, @a = nil, []
|
14
14
|
end
|
@@ -35,16 +35,17 @@ class MorseCodeListener
|
|
35
35
|
sleep @short_delay * 2
|
36
36
|
@a << @h[:separator]
|
37
37
|
sleep @long_delay - @short_delay
|
38
|
-
@a
|
38
|
+
@a.pop
|
39
|
+
@a << @h[:space]
|
39
40
|
sleep @timeout - @long_delay - @short_delay
|
40
|
-
@a.pop
|
41
|
+
@a.pop
|
41
42
|
|
42
43
|
s = @a.join
|
43
44
|
|
44
45
|
if @notifier then
|
45
46
|
|
46
47
|
begin
|
47
|
-
@notifier.message s
|
48
|
+
@notifier.message s if @notifier.respond_to? :message
|
48
49
|
rescue
|
49
50
|
puts 'warning: MorseCodeListener#on_keyup @notifier' + ($!).inspect
|
50
51
|
end
|
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
p�/������rp&�"#��Y����ꘘQ��0�_���������0zap��i�&�+��=�Ҟ�&%Eb�Yu�W>)�*Gf�`N������b�#Aȇ�&]/\�p잯�ɢ��uXh�����c�X��y6*N�Tm?��e%1��]��'ͥ�?:�UY%��� ,������n��5�.�"*����Q(X���_�@l�������tքx��(��UV��k�U��4A�e:d�����q��!��M%��
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|