eco-rake 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -1
- data/lib/eco-rake/lib/files/sftp.rb +1 -1
- data/lib/eco-rake/lib/people/sync_launch.rb +1 -1
- data/lib/eco-rake/lib/task/runner_rely.rb +1 -1
- data/lib/eco-rake/shell/command.rb +20 -0
- data/lib/eco-rake/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62670eef7e735906c2b7c85ce0ec355809e56388c81c62b7829c0615c5ac02a6
|
4
|
+
data.tar.gz: b8061d3eec87948c8320d9320c09ed1a97426402893b6320e114310d2600dcba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73653313c3f6ca4be1ea38c22b77496921b7fb99d171cc876d2667cf38b0d41b99958df47ad760aeff4809613d881922ef4dc3145e152c35ef623363aaba21fe
|
7
|
+
data.tar.gz: c8365601b42e4ac8c36f696d1c657d2455355d92d9376cc32d16f7cb2e24e4ef0ac56fbfd7b0b2eeb480f266ad6090f359dc3ad36f487f6b077ea272ba3ca4ee
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
## [0.2.4] - 2024-
|
5
|
+
## [0.2.4] - 2024-09-xx
|
6
6
|
|
7
7
|
### Added
|
8
8
|
|
@@ -10,6 +10,24 @@ All notable changes to this project will be documented in this file.
|
|
10
10
|
|
11
11
|
### Changed
|
12
12
|
|
13
|
+
## [0.2.4] - 2024-09-05
|
14
|
+
|
15
|
+
### Added
|
16
|
+
|
17
|
+
- `EcoRake::Shell::Command#sh_exit_on_fail`
|
18
|
+
- It exists when the command failed.
|
19
|
+
- This requires that any notification is handled by the logic of the command that was invoked itself.
|
20
|
+
- Please observe that using this approach could miss a notification.
|
21
|
+
|
22
|
+
### Changed
|
23
|
+
|
24
|
+
- `EcoRake::Lib::Peope::SyncLaunch#process_full_file`
|
25
|
+
- `people_get` won't raise a `RunTimeError` but just exit with status `1`
|
26
|
+
- `EcoRake::Lib::Task::RunnerRely#task`
|
27
|
+
- `command` won't raise a `RunTimeError` but just exit with status `1`
|
28
|
+
- `EcoRake::Lib::Files::Sftp#task`
|
29
|
+
- `sftp_command` won't raise a `RunTimeError` but just exit with status `1`
|
30
|
+
|
13
31
|
## [0.2.3] - 2024-08-22
|
14
32
|
|
15
33
|
### Fixed
|
@@ -35,7 +35,7 @@ class EcoRake
|
|
35
35
|
private
|
36
36
|
|
37
37
|
def process_full_file
|
38
|
-
|
38
|
+
sh_exit_on_fail people_get_command unless options[:no_get] || delta_last?
|
39
39
|
sh_continue sync_command(latest_file)
|
40
40
|
clear_files unless options[:simulate]
|
41
41
|
end
|
@@ -42,6 +42,18 @@ class EcoRake
|
|
42
42
|
sh(comm, &sh_default_block(comm, &block))
|
43
43
|
end
|
44
44
|
|
45
|
+
# It exits if there is an error
|
46
|
+
# @note if doesn't raise (prevents) a RuntimeError
|
47
|
+
# @param comm [String] the command line
|
48
|
+
def sh_exit_on_fail(comm)
|
49
|
+
callback = middlewared_callback(sh_default_block(comm)) do |ok, res|
|
50
|
+
next if ok
|
51
|
+
|
52
|
+
exit(1)
|
53
|
+
end
|
54
|
+
sh(comm, &callback)
|
55
|
+
end
|
56
|
+
|
45
57
|
# Returns the default block for `sh` native method.
|
46
58
|
# @note it wraps `block` if given
|
47
59
|
# @return [Proc]
|
@@ -55,6 +67,14 @@ class EcoRake
|
|
55
67
|
res.exitstatus
|
56
68
|
end
|
57
69
|
end
|
70
|
+
|
71
|
+
def middlewared_callback(original)
|
72
|
+
proc do |*args, **kargs|
|
73
|
+
yield(*args, **kargs)
|
74
|
+
ensure
|
75
|
+
original.call(*args, **kargs)
|
76
|
+
end
|
77
|
+
end
|
58
78
|
end
|
59
79
|
end
|
60
80
|
end
|
data/lib/eco-rake/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eco-rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura Samper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -255,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
255
|
- !ruby/object:Gem::Version
|
256
256
|
version: '0'
|
257
257
|
requirements: []
|
258
|
-
rubygems_version: 3.5.
|
258
|
+
rubygems_version: 3.5.18
|
259
259
|
signing_key:
|
260
260
|
specification_version: 4
|
261
261
|
summary: A set of helpers to build re-usable `rake` integration helpers.
|