teodoro 0.49.1 → 0.50.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: 37e8ecabeca146c207419bd9913bd837bf375ffefedf3d5a5a1b5d453157cefb
4
- data.tar.gz: 26306bffa4c86ae0049e35bc5c46fe159e1d208c5fed3364f0b00ee43d20f098
3
+ metadata.gz: 51abd5c742e7e100db3955d991f68118c97cbd5b3b140e662e54267ab880ae51
4
+ data.tar.gz: 18a384c6ffdf1a4452342f2e56bf1b023336cccf429f4fe5f972913e1da09be9
5
5
  SHA512:
6
- metadata.gz: 2947309578038f6e26ea1046f9ecc2318d289a316a01c98f5c0c55bf4212221f40d378ff85bd91978f7e67fcbfcb0f9df40fd8e17e6f0bd1a0d06fcbf4c71f77
7
- data.tar.gz: 1f32b05e88e2025ba151f260d03187c47f39c089c67089784062406573ca8cb3a97a54952572e70f5ec4ab2a633bc93ed8c2a42f01cb3e1e8738472e3e703346
6
+ metadata.gz: 6a61c8d976d136490e0d02e6e3d64448df51f9d402a977515b59d8cf81bb1d339f1c4a3c642c1d6f379202c2dbf3c5809d5f4c529e6650e1665130f38b40e0fb
7
+ data.tar.gz: 0cda08d5973babe35d3a30a56b22449595dd27c7843f69339f10a3cfcf323900c345ec3f9601de38e874b4034a092f6ad48c020eba85057e447004bcd7ecd125
@@ -20,7 +20,12 @@ module Teodoro
20
20
  end
21
21
 
22
22
  def deletar_arquivo_data_original
23
- File.delete(caminho_do_arquivo_data_original)
23
+ if File.exist?(caminho_do_arquivo_data_original)
24
+ File.delete(caminho_do_arquivo_data_original)
25
+ else
26
+ puts '', Rainbow('Erro! Evento de alteração/exclusão sem inclusão anterior.').red
27
+ exit
28
+ end
24
29
  end
25
30
 
26
31
  def caminho_do_arquivo_data_original
@@ -15,18 +15,25 @@ module Teodoro
15
15
 
16
16
  def descompactar
17
17
  Console.print "descompactando #{File.basename(caminho)}..." do
18
- Zip::File.open(caminho) do |zip|
19
- zip
20
- .reject { |entrada| entrada.name[-8] == PREFIXO_DE_TOTALIZADOR }
21
- .each do |entrada|
22
- extrair(entrada)
23
- end
24
- end
18
+ descompactar_arquivo_zip
25
19
  end
26
20
  end
27
21
 
28
22
  private
29
23
 
24
+ def descompactar_arquivo_zip
25
+ Zip::File.open(caminho) do |zip|
26
+ zip
27
+ .reject { |entrada| entrada.name[-8] == PREFIXO_DE_TOTALIZADOR }
28
+ .each do |entrada|
29
+ extrair(entrada)
30
+ end
31
+ end
32
+ rescue Zip::Error
33
+ puts '', Rainbow("Erro! Arquivo \"#{caminho}\" corrompido.").red
34
+ exit
35
+ end
36
+
30
37
  def extrair(entrada)
31
38
  File
32
39
  .join(destino_dos_arquivos_xml, entrada.name)
@@ -1,3 +1,3 @@
1
1
  module Teodoro
2
- VERSION = '0.49.1'.freeze
2
+ VERSION = '0.50.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.49.1
4
+ version: 0.50.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: 2023-01-13 00:00:00.000000000 Z
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -178,8 +178,8 @@ dependencies:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
- description:
182
- email:
181
+ description:
182
+ email:
183
183
  executables:
184
184
  - teodoro
185
185
  extensions: []
@@ -243,11 +243,11 @@ files:
243
243
  - lib/teodoro/version.rb
244
244
  - lib/teodoro/xml.rb
245
245
  - lib/tipos_de_logradouro.json
246
- homepage:
246
+ homepage:
247
247
  licenses: []
248
248
  metadata:
249
249
  rubygems_mfa_required: 'true'
250
- post_install_message:
250
+ post_install_message:
251
251
  rdoc_options: []
252
252
  require_paths:
253
253
  - lib
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
263
  version: '0'
264
264
  requirements: []
265
265
  rubygems_version: 3.3.26
266
- signing_key:
266
+ signing_key:
267
267
  specification_version: 4
268
268
  summary: ''
269
269
  test_files: []