teodoro 0.58.1 → 0.59.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: 2c69a968cc23fbe8ad0082edc24559af2fc99209bed7525c2e7d8d778b319946
4
- data.tar.gz: 6976c5d7f45d252a9797420cbef1f130f8011f6be13cc47d8472c499e5958f68
3
+ metadata.gz: 16090454b943f6dcf593dd00cb47f4d6c2c70a496666604928d8697e93122b52
4
+ data.tar.gz: 0e547aec652063cb273180e9f6ac0c02dc2c3d1ccca157f8db49402253ef5fd7
5
5
  SHA512:
6
- metadata.gz: 97282eb522b31e73ac8a5a78f9e75b2bca4d57666430a8957eac2af99c83c463260bbf363274f6fe2db4188cd21ce056f6b663e7c3ea26ee3b4e0b13943da5b2
7
- data.tar.gz: 49e7c6b07b7cc58c783227aa7692a5a432a7cced8505bb8ec7d0e5615844c4177c291a6d054aaa9dde85342cbc5158cd3a03b942a6d29883ff3f44201d0a3d76
6
+ metadata.gz: 4d14465f187f7e708321c46e3b30b0bf7970389f29ee8d695a4e027739df22ccb3ec8e50368e52cb226353d537306ae39c99b57e62a4f5f1bd2bba0cbcf6a94c
7
+ data.tar.gz: abda36e22058ea1ac2e140dc68fe9f8d1a62b2167a4178367f193b1de99dd1718832c5db71ef5915dc87251abef546637ea6ec9ae567bb3fe4eaa3b9b2cbade9
@@ -128,6 +128,10 @@ module Teodoro
128
128
  @nome ||= File.basename(caminho, '.xml')
129
129
  end
130
130
 
131
+ def s1000?
132
+ tipo_de_evento == 'S1000'
133
+ end
134
+
131
135
  def processar
132
136
  Console.print "processando #{nome}.xml..." do
133
137
  validar_versao_do_leiaute
@@ -48,6 +48,7 @@ module Teodoro
48
48
  carregar_arquivos_xml
49
49
  classificar_arquivos_xml
50
50
  ordenar_arquivos_xml
51
+ validar_que_primeiro_arquivo_xml_eh_s1000
51
52
  processar_arquivos_xml
52
53
  salvar_arquivo_de_dados_gerais
53
54
  processar_cargos_gerados
@@ -177,6 +178,17 @@ module Teodoro
177
178
  end
178
179
  end
179
180
 
181
+ def validar_que_primeiro_arquivo_xml_eh_s1000
182
+ return if primeiro_arquivo_xml_eh_s1000?
183
+
184
+ puts '', Rainbow('Erro! Primeiro arquivo XML (evento) deve ser S-1000.').red
185
+ exit
186
+ end
187
+
188
+ def primeiro_arquivo_xml_eh_s1000?
189
+ arquivos_xml.first.s1000?
190
+ end
191
+
180
192
  def processar_arquivos_xml
181
193
  # otimizacao do gerenciamento de memoria
182
194
  arquivos_xml.shift.processar while arquivos_xml.any?
@@ -1,3 +1,3 @@
1
1
  module Teodoro
2
- VERSION = '0.58.1'.freeze
2
+ VERSION = '0.59.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.58.1
4
+ version: 0.59.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-03-10 00:00:00.000000000 Z
11
+ date: 2023-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri