eco-helpers 3.0.19 → 3.0.21
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 +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +35 -3
- data/lib/eco/api/common/loaders/config/cli.rb +9 -0
- data/lib/eco/api/common/loaders/config/session.rb +12 -0
- data/lib/eco/api/common/loaders/config/workflow/mailer.rb +17 -4
- data/lib/eco/api/common/loaders/config.rb +11 -2
- data/lib/eco/api/common/people/default_parsers/xls_parser.rb +1 -1
- data/lib/eco/api/common/session/logger/cache.rb +10 -4
- data/lib/eco/api/common/session/logger/channels.rb +41 -0
- data/lib/eco/api/common/session/logger.rb +9 -0
- data/lib/eco/api/common/session/sftp.rb +5 -0
- data/lib/eco/api/custom/mailer.rb +1 -0
- data/lib/eco/api/error.rb +4 -0
- data/lib/eco/api/session/batch/job.rb +25 -16
- data/lib/eco/api/session/batch/jobs.rb +6 -8
- data/lib/eco/api/session/batch/launcher/mode_size.rb +5 -2
- data/lib/eco/api/session/batch/launcher/retry.rb +6 -1
- data/lib/eco/api/session/config/api.rb +1 -0
- data/lib/eco/api/session/config/apis/one_off.rb +6 -6
- data/lib/eco/api/session/config/workflow.rb +16 -3
- data/lib/eco/api/session.rb +11 -7
- data/lib/eco/api/usecases/default/locations/tagtree_extract_case.rb +1 -0
- data/lib/eco/api/usecases/default/locations/tagtree_upload_case.rb +2 -0
- data/lib/eco/api/usecases/default_cases/samples/sftp_case.rb +22 -15
- data/lib/eco/api/usecases/ooze_cases/export_register_case.rb +6 -6
- data/lib/eco/api/usecases/ooze_samples/helpers/exportable_register.rb +1 -0
- data/lib/eco/api/usecases/ooze_samples/ooze_base_case.rb +1 -1
- data/lib/eco/api/usecases/ooze_samples/ooze_run_base_case.rb +8 -5
- data/lib/eco/cli_default/input.rb +49 -29
- data/lib/eco/cli_default/options.rb +4 -1
- data/lib/eco/cli_default/people.rb +102 -47
- data/lib/eco/cli_default/people_filters.rb +4 -1
- data/lib/eco/cli_default/workflow.rb +10 -4
- data/lib/eco/csv/stream.rb +2 -0
- data/lib/eco/csv.rb +3 -2
- data/lib/eco/language/auxiliar_logger.rb +16 -3
- data/lib/eco/language/basic_logger.rb +1 -0
- data/lib/eco/language/methods/delegate_missing.rb +4 -3
- data/lib/eco/version.rb +1 -1
- metadata +5 -2
@@ -21,10 +21,23 @@ module Eco
|
|
21
21
|
end
|
22
22
|
|
23
23
|
# Shortcut to logger.
|
24
|
-
|
25
|
-
|
24
|
+
# @todo allow for more channels (atm it's just :general )
|
25
|
+
# @note when `:general` is included, it ensures at least
|
26
|
+
# `:info` level is also logged.
|
27
|
+
# @return [NilClass]
|
28
|
+
def log(*levels, &block)
|
29
|
+
return unless logger
|
26
30
|
|
27
|
-
|
31
|
+
levels = levels.compact.uniq.map(&:to_sym)
|
32
|
+
levels.unshift(:info) if levels.include?(:general) && levels.length == 1
|
33
|
+
|
34
|
+
levels.each do |level|
|
35
|
+
next unless logger.respond_to?(:level)
|
36
|
+
|
37
|
+
logger.send(level, &block)
|
38
|
+
end
|
39
|
+
|
40
|
+
nil
|
28
41
|
end
|
29
42
|
end
|
30
43
|
end
|
@@ -67,6 +67,7 @@ module Eco
|
|
67
67
|
def format_proc(console: true, &block)
|
68
68
|
proc do |severity, datetime, _progname, msg|
|
69
69
|
str_stamp = console ? console_timestamp(datetime) : timestamp(datetime)
|
70
|
+
|
70
71
|
"#{severity.to_s[0]}: #{str_stamp}#{msg}\n".tap do |formatted_msg|
|
71
72
|
block&.call(severity, datetime, msg, formatted_msg)
|
72
73
|
end
|
@@ -7,7 +7,7 @@ module Eco
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def method_missing(method_name, *args, **kargs, &block)
|
10
|
-
super unless receiver = object_missing_delegated_to
|
10
|
+
super unless (receiver = object_missing_delegated_to)
|
11
11
|
receiver.send(method_name, *args, **kargs, &block)
|
12
12
|
end
|
13
13
|
|
@@ -19,8 +19,9 @@ module Eco
|
|
19
19
|
|
20
20
|
# retrieve the delegate_missing_to object
|
21
21
|
def object_missing_delegated_to
|
22
|
-
return
|
23
|
-
|
22
|
+
return unless @delegate_missing_to
|
23
|
+
|
24
|
+
method(@delegate_missing_to).call
|
24
25
|
end
|
25
26
|
end
|
26
27
|
end
|
data/lib/eco/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eco-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -538,6 +538,8 @@ files:
|
|
538
538
|
- lib/eco/api/common/loaders/base.rb
|
539
539
|
- lib/eco/api/common/loaders/case_base.rb
|
540
540
|
- lib/eco/api/common/loaders/config.rb
|
541
|
+
- lib/eco/api/common/loaders/config/cli.rb
|
542
|
+
- lib/eco/api/common/loaders/config/session.rb
|
541
543
|
- lib/eco/api/common/loaders/config/workflow.rb
|
542
544
|
- lib/eco/api/common/loaders/config/workflow/mailer.rb
|
543
545
|
- lib/eco/api/common/loaders/error_handler.rb
|
@@ -579,6 +581,7 @@ files:
|
|
579
581
|
- lib/eco/api/common/session/helpers/prompt_user.rb
|
580
582
|
- lib/eco/api/common/session/logger.rb
|
581
583
|
- lib/eco/api/common/session/logger/cache.rb
|
584
|
+
- lib/eco/api/common/session/logger/channels.rb
|
582
585
|
- lib/eco/api/common/session/logger/log.rb
|
583
586
|
- lib/eco/api/common/session/mailer.rb
|
584
587
|
- lib/eco/api/common/session/mailer/aws_provider.rb
|