teodoro 0.59.2 → 0.60.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: 6e4eed8f76385de9d5a4ae5ecf9ecedcafd06215fd0ab7bbdbcad83b3845e89b
4
- data.tar.gz: 5dceab89b88b50fecc34a2f080b88e535ff03cbfb9dff740fbd93f753c32d3fb
3
+ metadata.gz: 84cda12f90717c2ae887f52ea700afee07ffae0c47ddac78fca16f8337436897
4
+ data.tar.gz: 57f2adfcaf28f64c5096d002eea98a6531f71acc67302e7fe310eb48624e061c
5
5
  SHA512:
6
- metadata.gz: f177660b1481d10a040afe24ad92a44cdedad41b3e1db529c84422487927781af7b78e8fcab347d23d34c266fd2a8941cdac6bea43e723f178dcd9ac05281d70
7
- data.tar.gz: 3b5346f2563cb3108ea1da3fcb70963b0bdb717c43b1c70fc41b07de1df07a4d1e2bb495fd38fbd5c876229f0a9c32594b97ec01dd4b7fd72b63e406ea5192e9
6
+ metadata.gz: 42850781c225c8da81554a611c71a922ccf00d7be41864905f26077e38ea22e46b28192da2d4f3539934df962a9245d491f18d5246fe3a71e1189523c453437f
7
+ data.tar.gz: 207967023834323165a86c7e3ce57c999c0e976aee778417486a788a472f121bb2dfd105ebc75c2863253f8f14265c2900310662b589d651bdb2d78b8e02b4ec
@@ -22,7 +22,7 @@ module Teodoro
22
22
  .readlines(caminho)
23
23
  .map(&:strip)
24
24
  .map { _1.split('=') }
25
- .to_h { |chave, valor| [chave, valor] }
25
+ .then { _1.to_h { |chave, valor| [chave, valor] } }
26
26
  end
27
27
  end
28
28
  end
@@ -1,7 +1,6 @@
1
1
  require_relative 'arquivo_de_origem'
2
2
  require_relative 'arquivo_xml'
3
3
  require_relative 'empresa/arquivos_data'
4
- require_relative 'empresa/arquivo_data_de_admissao_de_trabalhador_sem_vinculo'
5
4
  require_relative 'empresa/arquivo_data_emp'
6
5
  require_relative 'empresa/arquivo_data_rub'
7
6
  require_relative 'empresa/arquivo_de_dados_gerais'
@@ -54,7 +53,6 @@ module Teodoro
54
53
  salvar_arquivo_de_dados_gerais
55
54
  processar_cargos_gerados
56
55
  processar_funcoes_geradas
57
- remover_matricula_do_nome_dos_arquivos_data_de_admissao_de_trabalhador_sem_vinculo
58
56
  setar_proximo_identificador_de_tabela_de_rubricas_nos_arquivos_data_emp
59
57
  ajustar_nome_do_ultimo_arquivo_emp_data
60
58
  end
@@ -224,16 +222,6 @@ module Teodoro
224
222
  funcoes_geradas.each(&:processar)
225
223
  end
226
224
 
227
- def remover_matricula_do_nome_dos_arquivos_data_de_admissao_de_trabalhador_sem_vinculo
228
- arquivos_data_de_admissao_de_trabalhador_sem_vinculo.each(&:remover_matricula_do_nome)
229
- end
230
-
231
- def arquivos_data_de_admissao_de_trabalhador_sem_vinculo
232
- File.join(destino_dos_arquivos_data, 'TRA*TSV_*_*_*-ADM.data')
233
- .then { Dir[_1] }
234
- .map { ArquivoDataDeAdmissaoDeTrabalhadorSemVinculo.new(_1) }
235
- end
236
-
237
225
  def setar_proximo_identificador_de_tabela_de_rubricas_nos_arquivos_data_emp
238
226
  arquivos_data_emp.each(&:setar_proximo_identificador_de_tabela_de_rubricas)
239
227
  end
@@ -141,7 +141,7 @@ module Teodoro
141
141
  'TSV',
142
142
  inicio_de_contrato.categoria_do_trabalhador,
143
143
  inicio_de_contrato.data_de_inicio.delete('-'),
144
- inicio_de_contrato.matricula_do_trabalhador
144
+ *inicio_de_contrato.matricula_do_trabalhador
145
145
  ].join('_'),
146
146
  ']-ADM'
147
147
  ].join,
@@ -259,13 +259,17 @@ module Teodoro
259
259
  Obj.new(
260
260
  operacao: :inclusao,
261
261
  nome: [
262
- 'TRA[',
263
- trabalhador.cpf,
264
- '][TSV_',
265
- inicio_de_contrato.categoria_do_trabalhador,
266
- '_',
267
- inicio_de_contrato.data_de_inicio.delete('-'),
268
- ']-GER'
262
+ 'TRA',
263
+ "[#{trabalhador.cpf}]",
264
+ "[#{
265
+ [
266
+ 'TSV',
267
+ inicio_de_contrato.categoria_do_trabalhador,
268
+ inicio_de_contrato.data_de_inicio.delete('-'),
269
+ *inicio_de_contrato.matricula_do_trabalhador
270
+ ].join('_')
271
+ }]",
272
+ '-GER'
269
273
  ].join,
270
274
  itens_do_conteudo: [
271
275
  # rubocop:disable Layout/LineLength
@@ -12,7 +12,7 @@ module Teodoro
12
12
  nome: [
13
13
  'TRA',
14
14
  "[#{cpf_do_trabalhador}]",
15
- "[TSV_#{categoria_do_trabalhador}_#{data_de_inicio.delete('-')}]",
15
+ "[#{['TSV', categoria_do_trabalhador, data_de_inicio.delete('-'), *matricula_do_trabalhador].join('_')}]",
16
16
  "-ACO[#{data_da_alteracao.delete('-')}]"
17
17
  ].join,
18
18
  itens_do_conteudo: [
@@ -67,13 +67,17 @@ module Teodoro
67
67
  Obj.new(
68
68
  operacao: :atualizacao,
69
69
  nome: [
70
- 'TRA[',
71
- cpf_do_trabalhador,
72
- '][TSV_',
73
- categoria_do_trabalhador,
74
- '_',
75
- data_de_inicio.delete('-'),
76
- ']-GER'
70
+ 'TRA',
71
+ "[#{cpf_do_trabalhador}]",
72
+ "[#{
73
+ [
74
+ 'TSV',
75
+ categoria_do_trabalhador,
76
+ data_de_inicio.delete('-'),
77
+ *matricula_do_trabalhador
78
+ ].join('_')
79
+ }]",
80
+ '-GER'
77
81
  ].join,
78
82
  itens_do_conteudo: [
79
83
  ['EventoAdmissao_InformacoesInicio_NaturezaAtividade', natureza_da_atividade]
@@ -53,7 +53,19 @@ module Teodoro
53
53
  [
54
54
  Obj.new(
55
55
  operacao: :atualizacao,
56
- nome: "TRA[#{cpf_do_trabalhador}][TSV_#{categoria_do_trabalhador}_#{data_de_inicio.delete('-')}]-GER",
56
+ nome: [
57
+ 'TRA',
58
+ "[#{cpf_do_trabalhador}]",
59
+ "[#{
60
+ [
61
+ 'TSV',
62
+ categoria_do_trabalhador,
63
+ data_de_inicio.delete('-'),
64
+ *matricula_do_trabalhador
65
+ ].join('_')
66
+ }]",
67
+ '-GER'
68
+ ].join,
57
69
  itens_do_conteudo: [
58
70
  ['EventoAdmissao_InformacoesInicio_Matricula', matricula_do_trabalhador],
59
71
  ['ESX_DATADESLIGAMENTO', data_do_termino],
@@ -1,3 +1,3 @@
1
1
  module Teodoro
2
- VERSION = '0.59.2'.freeze
2
+ VERSION = '0.60.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teodoro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.59.2
4
+ version: 0.60.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fortes Tecnologia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-11 00:00:00.000000000 Z
11
+ date: 2023-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -90,7 +90,6 @@ files:
90
90
  - lib/teodoro/cnpj.rb
91
91
  - lib/teodoro/console.rb
92
92
  - lib/teodoro/empresa.rb
93
- - lib/teodoro/empresa/arquivo_data_de_admissao_de_trabalhador_sem_vinculo.rb
94
93
  - lib/teodoro/empresa/arquivo_data_emp.rb
95
94
  - lib/teodoro/empresa/arquivo_data_rub.rb
96
95
  - lib/teodoro/empresa/arquivo_de_dados_gerais.rb
@@ -150,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
149
  - !ruby/object:Gem::Version
151
150
  version: '0'
152
151
  requirements: []
153
- rubygems_version: 3.4.10
152
+ rubygems_version: 3.4.13
154
153
  signing_key:
155
154
  specification_version: 4
156
155
  summary: ''
@@ -1,39 +0,0 @@
1
- module Teodoro
2
- class Empresa
3
- class ArquivoDataDeAdmissaoDeTrabalhadorSemVinculo
4
- private
5
-
6
- def initialize(caminho)
7
- @caminho = caminho
8
- end
9
-
10
- attr_reader :caminho
11
-
12
- public
13
-
14
- def remover_matricula_do_nome
15
- File.rename(caminho, caminho_com_nome_sem_matricula)
16
- end
17
-
18
- private
19
-
20
- def caminho_com_nome_sem_matricula
21
- File.join(diretorio, nome_sem_a_matricula)
22
- end
23
-
24
- def diretorio
25
- File.dirname(caminho)
26
- end
27
-
28
- def nome_sem_a_matricula
29
- nome_original
30
- .then { _1.match(/^(TRA\[.*\]\[TSV_.*_.*)(_.*)(\]-ADM\.data)$/) }
31
- .then { "#{_1[1]}#{_1[3]}" }
32
- end
33
-
34
- def nome_original
35
- File.basename(caminho)
36
- end
37
- end
38
- end
39
- end