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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1791d7e14d7833006633323329e96c26f7a07817
4
- data.tar.gz: 97b378a14d85ecb139d8e7a5cedb56152263faa3
3
+ metadata.gz: a82499a3bb476f205e3819ba570857a74a846cf6
4
+ data.tar.gz: daf544118cad76ae5186d80c91491e6f756b2bfc
5
5
  SHA512:
6
- metadata.gz: 55999a0c2cc790010e0246a8d561e82e96efa3b0877022f7a6d3b26fcd8fed62bff1eb6f2e8985df2665ba8097d036d8afa7522a54081d15ce9255cc8c92693f
7
- data.tar.gz: 3e7c066a0de01eef751e7c5565cb8d32a7d548ba031691f9af170b4dada80f61ae142ddfa3d5a9601c7b260da1c37dc762e9bc8d7e7beb7f43141e5432b35432
6
+ metadata.gz: 9da1d76f861f26d69dd9c63e585d7019d4c2cad7f537a3a823fc51bf57d6b0d4759dd91d81e978cda24d75b9d6508aecd0ce7b86a4142c597e3bed9fd7ded269
7
+ data.tar.gz: 799b77dfcb6f8adf836345defd9c02b6f9e8733d0b08980681d16cf29db20c58be29b1d790931c4017d5cf52f658ff25089d3ef574b9d8334ccf3f7ac79a85ea
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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 @long_delay
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
- @notifier.message s
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
- $L#�rrb{:���>�dE��[:oo]��}�mo�n���akD�����96AQ���P�(f߅�6
1
+ &N�tW�3'�=��s���8�H��U�젍%f��'L7o�!��f����d�)O�;��}D@�o���� �����!Eꪦf7Kk\���Iya5( 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
@@ -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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file