odorico 1.1.1 → 1.2.0

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: 3fd9cb52d82f37d14e20bcb9f820bfbd9ce27a710314c74204770de3e9bc6a8b
4
- data.tar.gz: 77658e24424325f4b5ccd5ec8622e8c421aaad70d13087ead54972994a61d9cf
3
+ metadata.gz: 1f1ecabd2a5b80c0feec34dbc9ff7959216891969f3e9b2326727e3ef3d492f2
4
+ data.tar.gz: 94fff56483d3f79a92b2faec72d6253f1d592a96ad2ac00800c177213223a2f0
5
5
  SHA512:
6
- metadata.gz: 31bade674c3cbca57905089855a491394c7cb199c647da298475f178629f1f5b2847a2e4c6f1b6a5ec5d720758f29fa04fff13f1d61a46e7963d794bdf792cb0
7
- data.tar.gz: 3c5bb7efd7fc707a53674806fe4d624ac999d52f8c24bfb4bedfda9b197db311d834db7da78edcd0ec8f7b8a7d0e8e240641501103219d0143c72e58b619183c
6
+ metadata.gz: 9c4419890498b0c6c5601fe8dda26807823e73b37249c099736c1b3fcbd20a3a4286f2c76e29910221eefce6e8326de2e854cfbcceeaf7b9a235b99e0e18c7a7
7
+ data.tar.gz: e190480199ad09c5e2633c148368546158043d62f627d5ac5d6f3f00b2f56978536f630389a8dc586358d608919b6a18022ed388e58b4b5f1794542a85493b2c
@@ -180,10 +180,12 @@ class Processamento
180
180
  elsif nome_base_do_arquivo_data.include?('-TAF[') && !nome_base_do_arquivo_data.include?('TSV_')
181
181
  processar(ArquivoEmpregadoAfastamentoTermino.new(caminho_do_arquivo_data))
182
182
  elsif sufixo == 'GER'
183
- if nome_base_do_arquivo_data.include?('TSV_')
184
- processar(ArquivoTrabalhadorSemVinculoTermino.new(caminho_do_arquivo_data))
185
- else
186
- processar(ArquivoEmpregadoDesligamento.new(caminho_do_arquivo_data, grupo_da_empresa))
183
+ if data_de_desligamento?(caminho_do_arquivo_data)
184
+ processar_arquivo_de_termino_de_contrato_de_trabalho(
185
+ nome_base_do_arquivo_data: nome_base_do_arquivo_data,
186
+ caminho_do_arquivo_data: caminho_do_arquivo_data,
187
+ grupo_da_empresa: grupo_da_empresa
188
+ )
187
189
  end
188
190
  elsif sufixo == 'AVI'
189
191
  processar(ArquivoAvisoPrevio.new(caminho_do_arquivo_data))
@@ -213,6 +215,24 @@ class Processamento
213
215
  arquivo.atributos
214
216
  end
215
217
 
218
+ def data_de_desligamento?(caminho_do_arquivo_data)
219
+ File
220
+ .read(caminho_do_arquivo_data)
221
+ .match?(%r{^.*\r?\nESX_DATADESLIGAMENTO=\d{2}/\d{2}/\d{4}\r?\n.*$})
222
+ end
223
+
224
+ def processar_arquivo_de_termino_de_contrato_de_trabalho(
225
+ nome_base_do_arquivo_data:,
226
+ caminho_do_arquivo_data:,
227
+ grupo_da_empresa:
228
+ )
229
+ if nome_base_do_arquivo_data.include?('TSV_')
230
+ processar(ArquivoTrabalhadorSemVinculoTermino.new(caminho_do_arquivo_data))
231
+ else
232
+ processar(ArquivoEmpregadoDesligamento.new(caminho_do_arquivo_data, grupo_da_empresa))
233
+ end
234
+ end
235
+
216
236
  def ajustar_afastamentos_de_inicio
217
237
  afastamentos_de_inicio.each do |afastamento|
218
238
  afastamentos_no_inicio_da_fase_2
@@ -1,3 +1,3 @@
1
1
  module Odorico
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odorico
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fortes Tecnologia
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-05 00:00:00.000000000 Z
11
+ date: 2023-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -122,8 +122,8 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- description:
126
- email:
125
+ description:
126
+ email:
127
127
  executables:
128
128
  - odorico
129
129
  extensions: []
@@ -158,11 +158,11 @@ files:
158
158
  - lib/odorico/sistema_operacional.rb
159
159
  - lib/odorico/types.rb
160
160
  - lib/odorico/version.rb
161
- homepage:
161
+ homepage:
162
162
  licenses: []
163
163
  metadata:
164
164
  rubygems_mfa_required: 'true'
165
- post_install_message:
165
+ post_install_message:
166
166
  rdoc_options: []
167
167
  require_paths:
168
168
  - lib
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubygems_version: 3.3.26
181
- signing_key:
181
+ signing_key:
182
182
  specification_version: 4
183
183
  summary: ''
184
184
  test_files: []