eco-helpers 3.0.33 → 3.0.35

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: c7282df5e6d33e1467e6d2ad2aa039984bad1fa4f4a4160e703f2e07f91367ec
4
- data.tar.gz: 002bcef35564d7613bfb81c5cc9a09058c0323a4729fb0362a808f48bf64634e
3
+ metadata.gz: 066f83734d88958d4068ea25131fdf31b9f1e8002a120ddfa9869831f859a548
4
+ data.tar.gz: 874dcfebe7974fea10d8b68220ce665748851862da15724c1f62a16e1ae990df
5
5
  SHA512:
6
- metadata.gz: d9429616ce050142667c011bb3ed1deeab286293349d344b4ad4290d87d9476c3249577f5efd73ab673315a1e95392102994bdbc20fb332233322c627f621d69
7
- data.tar.gz: c5a88ca8ddb14ef5832e9541e03c3870ee12cbd9fa6be97cb4898fd638f7dd3cffb7b28e4d2f28298bbbb418af4d3df5aeeeeb3dcb7f32bee402907f40905dac
6
+ metadata.gz: 0ae22bb1f7d33eb073ce0cb55e2f35f8bf4d3480e21af463b5f9921f423a65672cad9626d0a2e8eb197bc3a050c8e3dd558bcdcaa15bcb3236b0f117fdbb3e8d
7
+ data.tar.gz: 87ebd3f93e78286e4615afd833230ed0744debde8d8c6382e8dcc0f0e44f697d4871bd7b6636ae0c2d05bc9c5fe2d56ecb25da1bab9d2dadb989d5cfb0cb91a7
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
- ## [3.0.34] - 2025-04-xx
5
+ ## [3.0.36] - 2025-04-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
  ### Fixed
12
12
 
13
+ ## [3.0.35] - 2025-04-09
14
+
15
+ ### Fixed
16
+
17
+ - bug with the `Mailer`
18
+
19
+ ## [3.0.34] - 2025-04-09
20
+
21
+ ### Changed
22
+
23
+ - `Location::Service::TreeDiff::Convertible::Inputable` (in `Eco::API::UseCases::GraphQL::Samples`)
24
+ - `#input_file` to `exit 0` when no files are found.
25
+ - It is **important to note** that we want the full process chain to abort (that is the reason in the first place why the `exit 1` was in place).
26
+
27
+ ### Fixed
28
+
29
+ - `CliDefault::Input` to log in `:general` channel what files have beens scoped.
30
+
13
31
  ## [3.0.33] - 2025-04-08
14
32
 
15
33
  ### Added
@@ -25,7 +25,7 @@ class Eco::API::Common::Loaders::Workflow::Mailer < Eco::API::Common::Loaders::W
25
25
  subject = "#{subject} & Errors" if session.job_groups.errors?
26
26
  subject = "#{subject} - Exception!" if error?
27
27
 
28
- body = general_messages(io)
28
+ body = general_messages(io) || ''
29
29
  body << "\n#{session.summary}" unless session.job_groups.empty? && error?
30
30
  body << "\n#{errors_n_warnings(io)}"
31
31
 
@@ -23,7 +23,8 @@ module Eco
23
23
  meth = channel.to_s.downcase.to_sym
24
24
 
25
25
  define_method(meth) do |msg = nil, &block|
26
- def_block.call(meth, msg, &block)
26
+ # `block` instead of `&block`
27
+ instance_exec(meth, msg, block, &def_block)
27
28
  end
28
29
  end
29
30
  end
@@ -8,7 +8,7 @@ module Eco
8
8
  require_relative 'logger/channels'
9
9
  include Channels
10
10
 
11
- channels! do |channel, message = nil, &block|
11
+ channels! do |channel, message = nil, block|
12
12
  format_proc(console: true) do |severity, datetime, msg, formatted_msg|
13
13
  cache.add(severity, datetime, msg, formatted_msg)
14
14
  end.call(channel, Time.now, 'prog_name', message || block.call)
@@ -27,7 +27,7 @@ module Eco::API::UseCases::GraphQL::Samples::Location::Service
27
27
  log(:info) { "Using input file '#{file}'" }
28
28
  else
29
29
  log(:warn) { 'Could not find any input file' }
30
- exit(1)
30
+ exit 0
31
31
  end
32
32
  end
33
33
  end
@@ -19,7 +19,10 @@ module Eco::API::UseCases::GraphQL::Samples::Location::Service
19
19
  private
20
20
 
21
21
  def input_csv
22
- @input_csv ||= Eco::CSV.read(input_file, encoding: input_encoding).then do |csv|
22
+ @input_csv ||= Eco::CSV.read(
23
+ input_file,
24
+ encoding: input_encoding
25
+ ).then do |csv|
23
26
  next csv unless header_maps&.any?
24
27
 
25
28
  csv.transform_headers do |name|
@@ -65,7 +65,10 @@ module Eco::API::UseCases::GraphQL::Samples
65
65
  end
66
66
  end
67
67
 
68
- def comparer(source_1 = live_nodes_list, source_2 = file_nodes_list)
68
+ def comparer(
69
+ source_1 = live_nodes_list,
70
+ source_2 = file_nodes_list
71
+ )
69
72
  @comparer ||= nodes_diff_class.new(
70
73
  source_1,
71
74
  source_2,
@@ -68,12 +68,6 @@ class Eco::CliDefault::Input < Eco::API::Common::Loaders::CliConfig
68
68
  file = file.select do |f|
69
69
  ext.any? {|e| File.extname(f) == e}
70
70
  end.tap do |files|
71
- session.log(:general) {
72
- files_msg = 'Using these as input files:'
73
- files_msg << "\n * "
74
- files_msg << files.join("\n * ")
75
- }
76
-
77
71
  next unless files.empty?
78
72
 
79
73
  session.log(:error) {
@@ -91,6 +85,14 @@ class Eco::CliDefault::Input < Eco::API::Common::Loaders::CliConfig
91
85
  options.deep_merge!(input: {file: {name: file}})
92
86
  options.deep_merge!(input: {file: {format: format}})
93
87
 
88
+ session.log(:general) {
89
+ files_msg = 'Using this/these as INPUT FILE(s):'
90
+ files_msg << "\n * "
91
+ files_msg << [file].flatten.map do |path|
92
+ File.basename(path)
93
+ end.join("\n * ")
94
+ }
95
+
94
96
  case format
95
97
  when :xml
96
98
  [file].flatten.each {|f| session.config.files.validate(:xml, f)}
@@ -9,7 +9,7 @@ module Eco
9
9
  def logger
10
10
  if instance_variable_defined?(:@session) && !@session.nil?
11
11
  @session.logger
12
- elsif respond_to?(:session, true)
12
+ elsif respond_to?(:session, true) && !send(:session).nil?
13
13
  send(:session).logger
14
14
  elsif Object.const_defined?(:ASSETS)
15
15
  ASSETS.session.logger
@@ -68,7 +68,7 @@ module Eco
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
+ "#{severity.to_s[0].upcase}: #{str_stamp}#{msg}\n".tap do |formatted_msg|
72
72
  block&.call(severity, datetime, msg, formatted_msg)
73
73
  end
74
74
  end
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = '3.0.33'.freeze
2
+ VERSION = '3.0.35'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.33
4
+ version: 3.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura