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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3251f5ef721961d53ab6b2b35d1705ac4d5c3df4
4
- data.tar.gz: d48376f04412097e5a8321b9f3ddfd003f3daebc
3
+ metadata.gz: f0000e44e379cd14968dda17ddd7e4054088f30c
4
+ data.tar.gz: 816e715bd0eb67bb2194604b5fd808c00ed61eed
5
5
  SHA512:
6
- metadata.gz: 7c8752c6234d6769e4f7099ce72bc53ae792d4953ad9ddaf330571c96c56bccd5f8f4c45063537fa19d3d70d1a3d19000738a4d5d366bc1ea222ce1634ef5970
7
- data.tar.gz: 3849067c8377865b4963f3366db5c4b1f063f63b3dd723fd3efd4ac7e5274c58b4dbb0a74c989c62be7685dd95b1ee18d713c6ef427ba877191df46454fadbc6
6
+ metadata.gz: 08c8557010cd341ac727de5ec620d132dc4254c800abc1285c972e63981bcf63b2c1942698ca28c0cbb1f6f7392a7ad35c7493b5ae61a8325cf3e0f8bf124547
7
+ data.tar.gz: 3f5507f4deb4e4acb96b4a947cb140bd0181396a889e1362fe298db5226d5537109e913fe7138e468e858f56a0f50441f8e182e0feae604daba3fd56262d5dba
@@ -1,3 +1,3 @@
1
1
  module SystemCommandHelper
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -9,8 +9,8 @@ module SystemCommandHelper
9
9
  end
10
10
  unless @no_exec
11
11
  result = system cmd
12
- if result != 0 && respond_to?(:sys_error, true)
13
- sys_error(cmd)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: system_command_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narazaka