io-watch 0.4.0 → 0.4.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
  SHA256:
3
- metadata.gz: '099aa403649b5214390198ad846a1d16819133b59b89389ef0a794641cf25c7a'
4
- data.tar.gz: e39d0a107c35541524a0288334308292d09ed241a308db8afb9871ec5e696294
3
+ metadata.gz: 197b7721bf73d747ba737369fc907fb390c9d1b76fcf673918476fb25ff31fd5
4
+ data.tar.gz: 7eb67828008e3680fcc86512b624630b2f3bf26731c1b7e14373ab5719e33609
5
5
  SHA512:
6
- metadata.gz: 72ee830e50e5f1475017af8e812c01ae3090a88c24c8628bdd06a2e5349dd24026f2ca0aef3c6212facc4f1e42b4fb31ad515024f2368fcbe2d7cc7f48aeed1a
7
- data.tar.gz: 7c2132304930f5a1a7b403ae94ce41e8dc0993fedecb797b6e7d9fce3316b1846ecad15f8ecdaa166a360973e527155dcb87f37f7f3a809f8d3f9550bac023ac
6
+ metadata.gz: 1100eb530ebc9684d833394c0eda71383a7248959b4b7757ec1587e50a1db0691abe8afcdf2322b4718f95536ab796f59a3ed235d7d4f58ac6120aef68bf4f78
7
+ data.tar.gz: 3aeb06da9803b9242be48fe66a423578011614423732c5a6f7a90772a19fade4eb471b1efb631043b06f83b70ecc9f1554e47b671d55c0b468a61c3cd8ad1c3c
checksums.yaml.gz.sig CHANGED
Binary file
data/bin/io-watch CHANGED
@@ -12,22 +12,41 @@ if command.first =~ /TERM|INT|KILL|QUIT|HUP/
12
12
  end
13
13
 
14
14
  if split = command.index('--')
15
- roots = command.pop(split)
16
- command.pop
15
+ roots = command.shift(split)
16
+ command.shift
17
17
  else
18
18
  roots = [Dir.pwd]
19
19
  end
20
20
 
21
+ Console.debug(self, "Watching", roots: roots, command: command, signal: signal)
22
+
23
+ if command.empty?
24
+ Console.error(self, "No command given")
25
+ exit 1
26
+ end
27
+
28
+ if roots.empty?
29
+ Console.error(self, "No roots given")
30
+ exit 1
31
+ end
32
+
21
33
  monitor = IO::Watch::Monitor.new(roots)
22
34
 
23
- monitor.run do
24
- if pid
25
- Console.info(self, "Killing command...", pid: pid)
26
- Process.kill(signal, pid)
27
- Process.wait(pid)
35
+ begin
36
+ monitor.run do
37
+ if pid
38
+ Console.debug(self, "Killing command...", pid: pid)
39
+ Process.kill(signal, pid)
40
+ Process.wait(pid)
41
+ end
42
+
43
+ Console.debug(self, "Starting command...")
44
+ pid = Process.spawn(*command)
45
+ Console.debug(self, "Started command", pid: pid)
28
46
  end
29
-
30
- Console.info(self, "Starting command...")
31
- pid = Process.spawn(*command)
32
- Console.info(self, "Started command", pid: pid)
47
+ rescue Interrupt
48
+ # Ignore.
49
+ ensure
50
+ Process.kill('TERM', pid)
51
+ Process.wait(pid)
33
52
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  class IO
7
7
  module Watch
8
- VERSION = '0.4.0'
8
+ VERSION = '0.4.1'
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-watch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
@@ -1,2 +1,6 @@
1
- �!6�u<J��5m�̹�D���uؖ1��ܺ��V�j.�뱪�V;���K�47 7z�6h*�^Z*�q��b��Tj�[�=���J�݂��|nT���/��� /̏�@BsUC����P �z�N�X.!4��;!m8 ���"�7��4��1P,�yij �+eNq6���54��q��l�n���'��q��$����a1^�T��������y���O���>�.�,����.V�K���,������C��ص9i����!����,�jT��!V/rt��'h��:�/Ԅx�D�V%�dO�ܲ~9�Ј=<`�!���g��F
2
- [0�4.�Fa77n���
1
+ ����c���?@�r+���U��,���j��������z;Q��ܞ���;)��jo���0�e0�����.������0W6�������pm���|���7���V�Qga�?~I��ISd���Q�*
2
+ 8_��I�B�g�����գI
3
+ cѕ���
4
+ ���M�C�U���.�(0��*v��� W{n�{�dC�� k�壅/9m�'�Ia�^2�j"��n��`a�غԵ�Ҳ���0U�w
5
+ K���ơ:q_�y!Qz���(Z����I�oo�Wp=�8Qߖŕ��Bjk�/����2U�u�J�W�+�i� 1 ڛ���}��x�6��c���V�)4���
6
+ �Ӏ~�a;"$,��Ҥs�x�׽�P*�A!����