eco-helpers 2.5.1 → 2.5.2

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
  SHA256:
3
- metadata.gz: b15015d62d69b57bfaef2e33cb9800786806f1796621f8a7c3fdc570bec81c99
4
- data.tar.gz: 046b93c466ef6999e97c2d17584d4e760c3d6592783448c4fed3aed2edd3a0d2
3
+ metadata.gz: 140086432682ed765773ca3f1fabcdd46606c04507d6652d94f3df68233cc7ec
4
+ data.tar.gz: fb68c2d6ab307711c45660cf169303b3e79f7555eb5199a6ed33455030def28a
5
5
  SHA512:
6
- metadata.gz: '079b89d982758de246c8f81fcc5e8853fdcc75c217f1b7e417408b9234a8a942aa874e77705fe62c0863699bf72dcf666297894b6febdb3f47bcb740af2d438e'
7
- data.tar.gz: 7feaa9e6022432a50c3fab188283e6af6566a8fe9de7b84fd3dcfba4584c64fd02cc5d926f3f50db8a44f139138844438345222d941b7407a6f4369b257ca070
6
+ metadata.gz: 96ab04ce3bdb34c994becd6a6223cbae38a95aa8bd2309906c047a39a0476b689cf76d7538556c650a826eae5f31cd807c351f0fd6f765cb5efb39857022981f
7
+ data.tar.gz: 0365d9f8777250747eef5580df8531bc07a77dfa7d46c7aaefd29898e44f2450f62fcad8c64f97976d1ae1f7526bfa5e8dcf34eeaa1c4d36777e3e0beff43dff
data/CHANGELOG.md CHANGED
@@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
  ## [2.5.2] - 2023-06-xx
5
5
 
6
6
  ### Added
7
+ - `Eco::API::Session::Config::Workflow#exit_handle`
8
+ - Allows to define a callback on `SystemExit` (`exit` call).
9
+
7
10
  ### Changed
8
11
  ### Fixed
12
+ - `Eco::API::Session::Config::Workflow` on `SystemExit` preserve original exit `status` value (i.e. `0`, `1`)
13
+ - It was changing an `exit 1` to be an `exit 0`
14
+ - Default Workflow. `exit 0` when no operation specified (rather than `exit 1`).
9
15
 
10
16
  ## [2.5.1] - 2023-06-06
11
17
 
@@ -149,7 +149,6 @@ module Eco
149
149
  def _define_serializer(attr_parser)
150
150
  attr_parser.def_serializer(self.class.serializing_phase, &self.method(:serializer))
151
151
  end
152
-
153
152
  end
154
153
  end
155
154
  end
@@ -129,6 +129,12 @@ module Eco
129
129
  self
130
130
  end
131
131
 
132
+ def exit_handle(&block)
133
+ return @exit_handle unless block
134
+ @exit_handle = block
135
+ self
136
+ end
137
+
132
138
  # Used in **configuration** time **add previous** `callbacks` **before** the `on` _callback_ of the (sub)stage `key` is actually `run`
133
139
  # @note
134
140
  # - it will **not** `yield` it immediately, but when the _workflow_ reaches the target stage
@@ -239,8 +245,9 @@ module Eco
239
245
  end
240
246
  end
241
247
  end
242
- rescue SystemExit
243
- exit
248
+ rescue SystemExit => e
249
+ self.exit_handle.call(e, io) if self.exit_handle
250
+ exit e.status
244
251
  rescue Interrupt => i
245
252
  raise
246
253
  rescue Exception => e
@@ -81,7 +81,7 @@ ASSETS.cli.config do |config|
81
81
  unless config.usecases.process(io: io)
82
82
  msg = "No update operation specified... quitting"
83
83
  io.session.logger.info(msg)
84
- exit(1)
84
+ exit(0)
85
85
  end
86
86
  io
87
87
  end
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "2.5.1"
2
+ VERSION = "2.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura