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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d495eb9aed9b90a87d50739a32a653e9be6712d5781dbeb846602b73f2f12bf2
4
- data.tar.gz: 2f63060816193846affe116f06681a755ab581542efbb8df54a83b3c6520fd83
3
+ metadata.gz: 59dea5ef129d2386830b2a29ac3b1a3bdb383857738340519e133d1259bdde4a
4
+ data.tar.gz: 01b90174390960bcbbbacd488ecb2d84d2407dbc52b80df52b8d2dd81481d1cc
5
5
  SHA512:
6
- metadata.gz: a54a6340e48024bed79820a9ecaed074d43cdfb585895953bf9e2f4d8591570de76f9d24011fdc8871b6e9802726d059971e9729d8a42d1e77e6130e01baa60e
7
- data.tar.gz: f110cd9ad44c30732e742c074b098d053af0b38ab9c41df126922e63f8dd6f299efb942b8670377274fd819188805bf599d5b1247761919d9ace40c910506ce7
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 = ::EacRubyUtils::Envs::Process.new(c).to_h
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
- ::EacRubyUtils::Envs::Spawn.new(c)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.132.0'
4
+ VERSION = '0.133.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_ruby_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.132.0
4
+ version: 0.133.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company