eac_ruby_utils 0.132.0 → 0.133.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eac_ruby_utils/envs/base_command/execution.rb +13 -3
- data/lib/eac_ruby_utils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59dea5ef129d2386830b2a29ac3b1a3bdb383857738340519e133d1259bdde4a
|
|
4
|
+
data.tar.gz: 01b90174390960bcbbbacd488ecb2d84d2407dbc52b80df52b8d2dd81481d1cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b73d7c0333fbc77945313e8ad9164371a00fa899abdf5be846b10b87bef40702553ce2f637ccd59b6928a36c2706f5d52755a687006a67ebffd867844d47fddf
|
|
7
|
+
data.tar.gz: 7eaf3737402874d9edf109f24648fce4bb6781d08d6479e1df88eef61420c88877f6ee26f277ee988eefaed5f5b0af4f28972662f9c5dd37ebb2d0d1eebad959
|
|
@@ -10,6 +10,12 @@ module EacRubyUtils
|
|
|
10
10
|
module Envs
|
|
11
11
|
module BaseCommand
|
|
12
12
|
module Execution
|
|
13
|
+
common_concern do
|
|
14
|
+
include ActiveSupport::Callbacks
|
|
15
|
+
|
|
16
|
+
define_callbacks :any_execution, :execute, :spawn, :system
|
|
17
|
+
end
|
|
18
|
+
|
|
13
19
|
def execute!(options = {})
|
|
14
20
|
options[:exit_outputs] = status_results.merge(options[:exit_outputs].presence || {})
|
|
15
21
|
er = ::EacRubyUtils::Envs::ExecutionResult.new(execute(options), options)
|
|
@@ -23,7 +29,9 @@ module EacRubyUtils
|
|
|
23
29
|
c = command(options)
|
|
24
30
|
debug_print("BEFORE: #{c}")
|
|
25
31
|
t1 = Time.now
|
|
26
|
-
r =
|
|
32
|
+
r = run_callbacks :any_execution, :execute do
|
|
33
|
+
::EacRubyUtils::Envs::Process.new(c).to_h
|
|
34
|
+
end
|
|
27
35
|
i = Time.now - t1
|
|
28
36
|
debug_print("AFTER [#{i}]: #{c}")
|
|
29
37
|
r
|
|
@@ -32,7 +40,9 @@ module EacRubyUtils
|
|
|
32
40
|
def spawn(options = {})
|
|
33
41
|
c = command(options)
|
|
34
42
|
debug_print("SPAWN: #{c}")
|
|
35
|
-
|
|
43
|
+
run_callbacks :any_execution, :spawn do
|
|
44
|
+
::EacRubyUtils::Envs::Spawn.new(c)
|
|
45
|
+
end
|
|
36
46
|
end
|
|
37
47
|
|
|
38
48
|
def system!(options = {})
|
|
@@ -44,7 +54,7 @@ module EacRubyUtils
|
|
|
44
54
|
def system(options = {})
|
|
45
55
|
c = command(options)
|
|
46
56
|
debug_print(c)
|
|
47
|
-
Kernel.system(c)
|
|
57
|
+
run_callbacks(:any_execution, :system) { Kernel.system(c) }
|
|
48
58
|
end
|
|
49
59
|
end
|
|
50
60
|
end
|