morsecode_listener 0.1.0 → 0.1.1
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 +15 -8
- 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: a82499a3bb476f205e3819ba570857a74a846cf6
|
4
|
+
data.tar.gz: daf544118cad76ae5186d80c91491e6f756b2bfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9da1d76f861f26d69dd9c63e585d7019d4c2cad7f537a3a823fc51bf57d6b0d4759dd91d81e978cda24d75b9d6508aecd0ce7b86a4142c597e3bed9fd7ded269
|
7
|
+
data.tar.gz: 799b77dfcb6f8adf836345defd9c02b6f9e8733d0b08980681d16cf29db20c58be29b1d790931c4017d5cf52f658ff25089d3ef574b9d8334ccf3f7ac79a85ea
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/morsecode_listener.rb
CHANGED
@@ -26,22 +26,29 @@ class MorseCodeListener
|
|
26
26
|
if t < @short_delay then
|
27
27
|
@a << @h[:dot]
|
28
28
|
elsif t < @long_delay
|
29
|
-
@a << @h[:dash]
|
30
|
-
elsif t < @timeout
|
31
|
-
@a << @h[:separator]
|
29
|
+
@a << @h[:dash]
|
32
30
|
end
|
33
31
|
|
32
|
+
|
34
33
|
@thread = Thread.new do
|
35
34
|
|
36
|
-
sleep @
|
35
|
+
sleep @short_delay * 2
|
36
|
+
@a << @h[:separator]
|
37
|
+
sleep @long_delay - @short_delay
|
37
38
|
@a << @h[:separator]
|
38
|
-
sleep @timeout - @long_delay
|
39
|
-
@a.pop
|
39
|
+
sleep @timeout - @long_delay - @short_delay
|
40
|
+
@a.pop 2
|
40
41
|
|
41
42
|
s = @a.join
|
42
43
|
|
43
44
|
if @notifier then
|
44
|
-
|
45
|
+
|
46
|
+
begin
|
47
|
+
@notifier.message s
|
48
|
+
rescue
|
49
|
+
puts 'warning: MorseCodeListener#on_keyup @notifier' + ($!).inspect
|
50
|
+
end
|
51
|
+
|
45
52
|
else
|
46
53
|
puts '>> ' + s
|
47
54
|
end
|
@@ -51,4 +58,4 @@ class MorseCodeListener
|
|
51
58
|
end
|
52
59
|
|
53
60
|
end
|
54
|
-
end
|
61
|
+
end
|
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
&N�t�W�3'�=��s���8�H��U�젍%f��'L7o�!��f����d�)O�;��}D@�o���� �����!Eꪦf7K�k\���I�ya5( wh�S����E��n����t�5��ߔְf�V��ɾ� �v>D����x��{}*�C�~�f�+�RB�!�7t-��$�e�71�w��I�2Bώ�}i�NG���刘k��"���a_�t�P+(�i�,�,x����h�AQ�lF-��'�s�M���
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|