eco-rake 0.2.27 → 0.3.1

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: 6bf18dd9479afb806f1ebf0c345f12f7cd82be69fc5cf534d39450c346c21445
4
- data.tar.gz: e6cd8de5706785cb1ef3281969810a7a71dfee547f9f48522304414c8c975c3e
3
+ metadata.gz: 3228d82a42bd33d3cea2465b935ca76760536cdb5c304d96c34fdaf202425d31
4
+ data.tar.gz: f52094ec6f05d0c06ebabe2bf229e1ff0a2a143549101ff35c529a81bb0696da
5
5
  SHA512:
6
- metadata.gz: 4804dc49cac78f378a7d6c2126141c67d0cf5694daa7cf2722a7541682c901cf2434875d1d7649ecf0394092f313ca8d70014605c9c60ba1cdbb7429eacede0a
7
- data.tar.gz: a29e0c6d232bc9b10cc7745498273454fba67b37da23849b306185b0a64a1e06cc1e46d324c1f44c6ade52910bb6743d7379c19683d4d9b02c0a72ba7fb98f98
6
+ metadata.gz: '013850736bb0a3223f2cff1166bf66c4b419577c7cf0083d98fc4191aaef4f4597374f2a45a5c8696f53388c6a310db59a3492366179c1a8ab4339f6786f56f6'
7
+ data.tar.gz: 8e9cae51bb25a606e1d166c834047ed837b7a050108b7b00ae90d0ca4ca271765cadcd18ea38ab35a5210fc0b992eb46e3df6f9219c7db11b1ce5a66a59278d5
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.28] - 2025-04-xx
5
+ ## [0.3.2] - 2025-04-xx
6
6
 
7
7
  ### Added
8
8
 
@@ -10,6 +10,13 @@ All notable changes to this project will be documented in this file.
10
10
 
11
11
  ### Fixed
12
12
 
13
+ ## [0.3.1] - 2025-04-29
14
+
15
+ ### Added
16
+
17
+ - `--notify` option
18
+ - Force notification even if in dry-run mode (`--simulate`)
19
+
13
20
  ## [0.2.27] - 2025-04-04
14
21
 
15
22
  ### Added
@@ -8,12 +8,13 @@ class EcoRake
8
8
  module Lib
9
9
  module Export
10
10
  class Payload < EcoRake::Lib::BaseTask
11
- FORWARDED_OPTIONS = %i[csv txt col_sep simulate no_email].freeze
11
+ FORWARDED_OPTIONS = %i[csv txt col_sep simulate no_email notify].freeze
12
12
  FORWARD_RULES = {
13
13
  enviro: ->(enviro) { "-#{enviro}" },
14
14
  space: ->(space) { "-space #{space}" },
15
15
  simulate: '-simulate',
16
16
  no_email: '-no-email',
17
+ notify: '-notify',
17
18
  csv: '-csv',
18
19
  txt: '-txt',
19
20
  col_sep: ->(sep) { "-col-sep #{sep}" },
@@ -55,7 +56,10 @@ class EcoRake
55
56
  value&.iso8601
56
57
  end
57
58
 
58
- option '-m', '--no-email', FalseClass, desc: 'Do not notify'
59
+ option '-m', '--no-email', TrueClass, desc: 'Do not notify', default: false
60
+
61
+ str_desc = 'Notify (even if dry-run or not remote)'
62
+ option '-y', '--notify', TrueClass, desc: str_desc, default: false
59
63
 
60
64
  option_forwarding(**FORWARD_RULES)
61
65
 
@@ -125,8 +129,8 @@ class EcoRake
125
129
  end
126
130
 
127
131
  def success_notify
128
- return if options[:simulate]
129
- return if options[:no_email]
132
+ return if options[:simulate] && !options[:notify]
133
+ return if options[:no_email] && !options[:notify]
130
134
  return unless (inbox = mail_to)
131
135
 
132
136
  email(
@@ -142,8 +146,8 @@ class EcoRake
142
146
  msg = res.to_s
143
147
  puts msg
144
148
 
145
- exit 1 if options[:simulate]
146
- exit 1 if options[:no_email]
149
+ exit 1 if options[:simulate] && !options[:notify]
150
+ exit 1 if options[:no_email] && !options[:notify]
147
151
  exit 1 unless (inbox = mail_to)
148
152
 
149
153
  email(
@@ -6,14 +6,15 @@ class EcoRake
6
6
  # - Should be able to log at debug level.
7
7
  # @note in integration repos this is used to be called `run:hris`
8
8
  class SyncLaunch < EcoRake::Lib::People::BaseTask
9
- ADDITIONAL_OPTIONS = %i[only_stats no_policy simulate no_email].freeze
9
+ ADDITIONAL_OPTIONS = %i[only_stats no_policy simulate no_email notify].freeze
10
10
  FORWARD_RULES = {
11
11
  space: ->(space) { "-space #{space}" },
12
12
  schema: ->(schema) { "-schema-id \"#{schema}\"" },
13
13
  only_stats: '-feed-only-stats',
14
14
  no_policy: '-skip-batch-policy',
15
15
  simulate: '-simulate',
16
- no_email: '-no-email'
16
+ no_email: '-no-email',
17
+ notify: '-notify'
17
18
  }.freeze
18
19
 
19
20
  attr_const :target_enviro, required: true
@@ -59,8 +60,8 @@ class EcoRake
59
60
  msg = 'Missing files to be processed'
60
61
  puts msg
61
62
 
62
- exit 1 if options[:simulate]
63
- exit 1 if options[:no_email]
63
+ exit 1 if options[:simulate] && !options[:notify]
64
+ exit 1 if options[:no_email] && !options[:notify]
64
65
  exit 1 unless (inbox = mail_to)
65
66
 
66
67
  email_missing_files(
@@ -10,7 +10,10 @@ class EcoRake
10
10
  option '-o', '--only-stats', TrueClass, desc: 'To display only stats in the feedback'
11
11
  option '-b', '--no-policy', FalseClass, desc: 'To skip the batch policy'
12
12
  option '-n', '--no-get', FalseClass, desc: 'Skip get people step'
13
- option '-m', '--no-email', FalseClass, desc: 'Do not notify'
13
+ option '-m', '--no-email', TrueClass, desc: 'Do not notify', default: false
14
+
15
+ str_desc = 'Notify (even if dry-run or not remote)'
16
+ option '-y', '--notify', TrueClass, desc: str_desc, default: false
14
17
  end
15
18
  end
16
19
  end
@@ -104,8 +104,8 @@ class EcoRake
104
104
  msg = 'File decryption failed'
105
105
  puts msg
106
106
 
107
- exit 1 if options[:simulate]
108
- exit 1 if options[:no_email]
107
+ exit 1 if options[:simulate] && !options[:notify]
108
+ exit 1 if options[:no_email] && !options[:notify]
109
109
  exit 1 unless (inbox = mail_to)
110
110
 
111
111
  email(
@@ -12,6 +12,7 @@ class EcoRake
12
12
  no_policy: :mirror,
13
13
  no_get: :mirror,
14
14
  no_email: :mirror,
15
+ notify: :mirror,
15
16
  simulate: :mirror
16
17
  }.freeze
17
18
 
@@ -5,7 +5,9 @@ class EcoRake
5
5
  FORWARD_RULES = {
6
6
  enviro: ->(enviro) { "-#{enviro}" },
7
7
  space: ->(space) { "-space #{space}" },
8
- simulate: '-simulate'
8
+ simulate: '-simulate',
9
+ no_email: '-no-email',
10
+ notify: '-notify'
9
11
  }.freeze
10
12
 
11
13
  options_with_defaults true
@@ -79,7 +81,7 @@ class EcoRake
79
81
 
80
82
  def command(*args)
81
83
  cmd = [ruby_runner]
82
- cmd.push(*forward_options(:enviro, :space, :simulate))
84
+ cmd.push(*forward_options(:enviro, :space, :simulate, :no_email, :notify))
83
85
  cmd.push(*args)
84
86
  cmd = yield(cmd) if block_given?
85
87
  string_cmd(*cmd)
@@ -6,6 +6,10 @@ class EcoRake
6
6
  option '-e', '--enviro ENVIRO', String, desc: 'Target environment to run against (i.e. org, live)', required: true
7
7
  option '-w', '--space SPACE', String, desc: 'Target space of the envionment (i.e. uat)'
8
8
  option '-t', '--task NAME', String, desc: 'Target task to run', required: true
9
+ option '-m', '--no-email', TrueClass, desc: 'Do not notify', default: false
10
+
11
+ str_desc = 'Notify (even if dry-run or not remote)'
12
+ option '-y', '--notify', TrueClass, desc: str_desc, default: false
9
13
  end
10
14
  end
11
15
  end
@@ -5,7 +5,9 @@ class EcoRake
5
5
  FORWARD_RULES = {
6
6
  simulate: :mirror,
7
7
  task: :mirror,
8
- space: :mirror
8
+ space: :mirror,
9
+ no_email: :mirror,
10
+ notify: :mirror
9
11
  }.freeze
10
12
 
11
13
  options_with_defaults true
@@ -23,8 +25,7 @@ class EcoRake
23
25
  cmd = [base_command]
24
26
  cmd << target_task
25
27
  cmd << '--'
26
- cmd << forward_option(:task)
27
- cmd << forward_option(:simulate)
28
+ cmd.push(*forward_options(:task, :simulate, :no_email, :notify))
28
29
  string_cmd(*cmd)
29
30
  end
30
31
 
@@ -1,5 +1,5 @@
1
1
  require 'rake-commander'
2
2
 
3
3
  class EcoRake < RakeCommander
4
- VERSION = '0.2.27'.freeze
4
+ VERSION = '0.3.1'.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.27
4
+ version: 0.3.1
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: 2025-04-03 00:00:00.000000000 Z
11
+ date: 2025-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake