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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a82499a3bb476f205e3819ba570857a74a846cf6
4
- data.tar.gz: daf544118cad76ae5186d80c91491e6f756b2bfc
3
+ metadata.gz: 891d94f4b97778961f9e97d2070ea61c857395ba
4
+ data.tar.gz: 80c6aa550c55185251c8548955519a1021a73bbe
5
5
  SHA512:
6
- metadata.gz: 9da1d76f861f26d69dd9c63e585d7019d4c2cad7f537a3a823fc51bf57d6b0d4759dd91d81e978cda24d75b9d6508aecd0ce7b86a4142c597e3bed9fd7ded269
7
- data.tar.gz: 799b77dfcb6f8adf836345defd9c02b6f9e8733d0b08980681d16cf29db20c58be29b1d790931c4017d5cf52f658ff25089d3ef574b9d8334ccf3f7ac79a85ea
6
+ metadata.gz: 5c377ca9e271db1cd737724b4374e5832649bb36fcac6a9522e095a661fbd4a3906939efce07cada8ecb542b51be3678a783e91bbea69453a6273379dd97a834
7
+ data.tar.gz: 1df47ed094012ec45fcb241ae4b75cb1173d4396c4ebb8e1b03e8f6513eea8dd838e07d640582e3d1badbbccf5699af7bc4078fa501fd0969182a5839f3a238d
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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 << @h[:separator]
38
+ @a.pop
39
+ @a << @h[:space]
39
40
  sleep @timeout - @long_delay - @short_delay
40
- @a.pop 2
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
- &N�t�W�3'�=��s���8H��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��I2Bώ�}i�NG���刘k��"���a_�t�P+(�i�,�,x����h�AQ�lF-��'�s�M���
1
+ p�/������rp&�"#��Y����ꘘQ��0_���������0zap��i�&�+��=�Ҟ�&%Eb�Yu�W>)�*Gf�`N������b�#Aȇ�&]/\�p잯�ɢ��uXh�����cX��y6*NTm?��e%1� �]��'ͥ �?:�UY%��� ,������n��5�.�"*����Q(X���_�@l�������tքx��(��UV��kU��4A�e:d�����q��! ��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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file