system_command_helper 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/system_command_helper/version.rb +1 -1
- data/lib/system_command_helper.rb +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0000e44e379cd14968dda17ddd7e4054088f30c
|
4
|
+
data.tar.gz: 816e715bd0eb67bb2194604b5fd808c00ed61eed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08c8557010cd341ac727de5ec620d132dc4254c800abc1285c972e63981bcf63b2c1942698ca28c0cbb1f6f7392a7ad35c7493b5ae61a8325cf3e0f8bf124547
|
7
|
+
data.tar.gz: 3f5507f4deb4e4acb96b4a947cb140bd0181396a889e1362fe298db5226d5537109e913fe7138e468e858f56a0f50441f8e182e0feae604daba3fd56262d5dba
|
@@ -9,8 +9,8 @@ module SystemCommandHelper
|
|
9
9
|
end
|
10
10
|
unless @no_exec
|
11
11
|
result = system cmd
|
12
|
-
if result != 0 &&
|
13
|
-
|
12
|
+
if result != 0 && @on_error
|
13
|
+
@on_error.call(cmd, result)
|
14
14
|
end
|
15
15
|
result
|
16
16
|
end
|
@@ -24,4 +24,8 @@ module SystemCommandHelper
|
|
24
24
|
`#{cmd}`
|
25
25
|
end
|
26
26
|
end
|
27
|
+
|
28
|
+
def on_error(&block)
|
29
|
+
@on_error = block
|
30
|
+
end
|
27
31
|
end
|