eco-rake 0.2.2 → 0.2.4

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: c120b2774e460a491cd6ed503fcbd0b6a3060fd95fdd6cf246a6b5006dbe8152
4
- data.tar.gz: 21f02bd7ba91e6bb257f035fc7eccaee157dcd05e921d46ec727d06cd67bcb21
3
+ metadata.gz: 62670eef7e735906c2b7c85ce0ec355809e56388c81c62b7829c0615c5ac02a6
4
+ data.tar.gz: b8061d3eec87948c8320d9320c09ed1a97426402893b6320e114310d2600dcba
5
5
  SHA512:
6
- metadata.gz: 6d78872f66404e488cedb140214e50fc034dbc29933c3bc915bde8c61f8c61f91d8358f55a437c6a7c1538d6d75a228536d814da966224be8998f7af50faa5c5
7
- data.tar.gz: 41f4e52423002f61f53df3a63601d618da3ed473b45a749e7d5d90e15268e4c5e34f9b31a44f19a18db0c6a8797cdc3ea1d80834101af7f557683aabe3b9dd46
6
+ metadata.gz: 73653313c3f6ca4be1ea38c22b77496921b7fb99d171cc876d2667cf38b0d41b99958df47ad760aeff4809613d881922ef4dc3145e152c35ef623363aaba21fe
7
+ data.tar.gz: c8365601b42e4ac8c36f696d1c657d2455355d92d9376cc32d16f7cb2e24e4ef0ac56fbfd7b0b2eeb480f266ad6090f359dc3ad36f487f6b077ea272ba3ca4ee
data/.rubocop.yml CHANGED
@@ -28,6 +28,11 @@ Style/ConditionalAssignment:
28
28
  Style/BlockDelimiters:
29
29
  BracesRequiredMethods: ['log']
30
30
  AllowedPatterns: ['proc', 'new']
31
+ Style/HashSyntax:
32
+ EnforcedShorthandSyntax: either
33
+ EnforcedStyle: no_mixed_keys
34
+ Style/ArgumentsForwarding:
35
+ UseAnonymousForwarding: false
31
36
  Style/ClassAndModuleChildren:
32
37
  Enabled: false
33
38
  Style/FrozenStringLiteralComment:
@@ -91,3 +96,5 @@ Naming/MethodParameterName:
91
96
  AllowedNames: ['x', 'y', 'i', 'j', 'id', 'io', 'to']
92
97
  Naming/RescuedExceptionsVariableName:
93
98
  Enabled: false
99
+ Naming/BlockForwarding:
100
+ Enabled: false
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.3] - 2024-08-xx
5
+ ## [0.2.4] - 2024-09-xx
6
6
 
7
7
  ### Added
8
8
 
@@ -10,6 +10,30 @@ 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
+
31
+ ## [0.2.3] - 2024-08-22
32
+
33
+ ### Fixed
34
+
35
+ - Gem dependency that must be made explicit
36
+
13
37
  ## [0.2.2] - 2024-08-08
14
38
 
15
39
  ### Fixed
data/eco-rake.gemspec CHANGED
@@ -31,5 +31,6 @@ Gem::Specification.new do |spec|
31
31
  #spec.add_dependency 'aws-sdk-s3', '>= 1.142.0', '< 2'
32
32
  spec.add_dependency 'aws-sdk-ses', '~> 1', '>= 1.58.0'
33
33
  spec.add_dependency 'dotenv', '~> 3'
34
+ spec.add_dependency 'nokogiri', '>= 1.13', '< 1.17'
34
35
  spec.add_dependency 'rake-commander', '~> 0.4'
35
36
  end
@@ -30,7 +30,7 @@ class EcoRake
30
30
  # option_reopen :enviro, default_lookup: :target_enviro
31
31
 
32
32
  def task(*_args)
33
- sh sftp_command
33
+ sh_exit_on_fail sftp_command
34
34
  end
35
35
 
36
36
  private
@@ -35,7 +35,7 @@ class EcoRake
35
35
  private
36
36
 
37
37
  def process_full_file
38
- sh people_get_command unless options[:no_get] || delta_last?
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
@@ -13,7 +13,7 @@ class EcoRake
13
13
  option_forwarding(**FORWARD_RULES)
14
14
 
15
15
  def task(*_args)
16
- sh_continue command
16
+ sh_exit_on_fail command
17
17
  end
18
18
 
19
19
  private
@@ -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
@@ -1,5 +1,5 @@
1
1
  require 'rake-commander'
2
2
 
3
3
  class EcoRake < RakeCommander
4
- VERSION = '0.2.2'.freeze
4
+ VERSION = '0.2.4'.freeze
5
5
  end
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.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-08-07 00:00:00.000000000 Z
11
+ date: 2024-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -124,6 +124,26 @@ dependencies:
124
124
  - - "~>"
125
125
  - !ruby/object:Gem::Version
126
126
  version: '3'
127
+ - !ruby/object:Gem::Dependency
128
+ name: nokogiri
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '1.13'
134
+ - - "<"
135
+ - !ruby/object:Gem::Version
136
+ version: '1.17'
137
+ type: :runtime
138
+ prerelease: false
139
+ version_requirements: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '1.13'
144
+ - - "<"
145
+ - !ruby/object:Gem::Version
146
+ version: '1.17'
127
147
  - !ruby/object:Gem::Dependency
128
148
  name: rake-commander
129
149
  requirement: !ruby/object:Gem::Requirement
@@ -235,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
255
  - !ruby/object:Gem::Version
236
256
  version: '0'
237
257
  requirements: []
238
- rubygems_version: 3.5.6
258
+ rubygems_version: 3.5.18
239
259
  signing_key:
240
260
  specification_version: 4
241
261
  summary: A set of helpers to build re-usable `rake` integration helpers.