eco-helpers 3.0.19 → 3.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +35 -3
  4. data/lib/eco/api/common/loaders/config/cli.rb +9 -0
  5. data/lib/eco/api/common/loaders/config/session.rb +12 -0
  6. data/lib/eco/api/common/loaders/config/workflow/mailer.rb +17 -4
  7. data/lib/eco/api/common/loaders/config.rb +11 -2
  8. data/lib/eco/api/common/people/default_parsers/xls_parser.rb +1 -1
  9. data/lib/eco/api/common/session/logger/cache.rb +10 -4
  10. data/lib/eco/api/common/session/logger/channels.rb +41 -0
  11. data/lib/eco/api/common/session/logger.rb +9 -0
  12. data/lib/eco/api/common/session/sftp.rb +5 -0
  13. data/lib/eco/api/custom/mailer.rb +1 -0
  14. data/lib/eco/api/error.rb +4 -0
  15. data/lib/eco/api/session/batch/job.rb +25 -16
  16. data/lib/eco/api/session/batch/jobs.rb +6 -8
  17. data/lib/eco/api/session/batch/launcher/mode_size.rb +5 -2
  18. data/lib/eco/api/session/batch/launcher/retry.rb +6 -1
  19. data/lib/eco/api/session/config/api.rb +1 -0
  20. data/lib/eco/api/session/config/apis/one_off.rb +6 -6
  21. data/lib/eco/api/session/config/workflow.rb +16 -3
  22. data/lib/eco/api/session.rb +11 -7
  23. data/lib/eco/api/usecases/default/locations/tagtree_extract_case.rb +1 -0
  24. data/lib/eco/api/usecases/default/locations/tagtree_upload_case.rb +2 -0
  25. data/lib/eco/api/usecases/default_cases/samples/sftp_case.rb +22 -15
  26. data/lib/eco/api/usecases/ooze_cases/export_register_case.rb +6 -6
  27. data/lib/eco/api/usecases/ooze_samples/helpers/exportable_register.rb +1 -0
  28. data/lib/eco/api/usecases/ooze_samples/ooze_base_case.rb +1 -1
  29. data/lib/eco/api/usecases/ooze_samples/ooze_run_base_case.rb +8 -5
  30. data/lib/eco/cli_default/input.rb +49 -29
  31. data/lib/eco/cli_default/options.rb +4 -1
  32. data/lib/eco/cli_default/people.rb +102 -47
  33. data/lib/eco/cli_default/people_filters.rb +4 -1
  34. data/lib/eco/cli_default/workflow.rb +10 -4
  35. data/lib/eco/csv/stream.rb +2 -0
  36. data/lib/eco/csv.rb +3 -2
  37. data/lib/eco/language/auxiliar_logger.rb +16 -3
  38. data/lib/eco/language/basic_logger.rb +1 -0
  39. data/lib/eco/language/methods/delegate_missing.rb +4 -3
  40. data/lib/eco/version.rb +1 -1
  41. metadata +5 -2
@@ -21,10 +21,23 @@ module Eco
21
21
  end
22
22
 
23
23
  # Shortcut to logger.
24
- def log(level, &block)
25
- return unless logger.respond_to?(:level)
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
- logger&.send(level, &block)
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 nil unless @delegate_missing_to
23
- self.method(@delegate_missing_to).call
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
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = '3.0.19'.freeze
2
+ VERSION = '3.0.21'.freeze
3
3
  end
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.19
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-20 00:00:00.000000000 Z
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