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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bin/io-watch +30 -11
- data/lib/io/watch/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 197b7721bf73d747ba737369fc907fb390c9d1b76fcf673918476fb25ff31fd5
|
4
|
+
data.tar.gz: 7eb67828008e3680fcc86512b624630b2f3bf26731c1b7e14373ab5719e33609
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
16
|
-
command.
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
31
|
-
|
32
|
-
|
47
|
+
rescue Interrupt
|
48
|
+
# Ignore.
|
49
|
+
ensure
|
50
|
+
Process.kill('TERM', pid)
|
51
|
+
Process.wait(pid)
|
33
52
|
end
|
data/lib/io/watch/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
@@ -1,2 +1,6 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
����c���?@�r+���U��,���j��������z;Q��ܞ���;)��jo���0�e0�����.������0W6�������p�m���|���7���V�Qga�?~I��I�S�d���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!����
|