teodoro 0.25.0 → 0.26.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 +4 -4
- data/lib/teodoro.rb +10 -6
- data/lib/teodoro/arquivo_xml.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 927a9f274432acc4f44f6153c859c254cbe3ca1fddc4e62bc75ad69142970d68
|
|
4
|
+
data.tar.gz: 1bc85d3aabd69214c48eb00e3fed74fe4a48432116aaa64d812b181491da8f44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 18857d825bcc711ed1670fe91fa9d7e8d1d902585cf9cba272ea56e381838284773fa0aaa39813d5701305e356c65f5a45031aacf9ece58ab598d729783b90cf
|
|
7
|
+
data.tar.gz: b3426e44a0b93db44a77152e2275506ee0a6952a100f76fb7369f73d1891b99dfaf2d32050fdbec6f9279da7ee2659382fa9de2e5c05ee974df48d585c69c55c
|
data/lib/teodoro.rb
CHANGED
|
@@ -12,7 +12,7 @@ require_relative 'teodoro/empresa'
|
|
|
12
12
|
require_relative 'teodoro/obj'
|
|
13
13
|
|
|
14
14
|
module Teodoro
|
|
15
|
-
VERSION = '0.
|
|
15
|
+
VERSION = '0.26.0'.freeze
|
|
16
16
|
|
|
17
17
|
CBOs = __FILE__
|
|
18
18
|
.then { File.dirname(_1) }
|
|
@@ -27,11 +27,6 @@ module Teodoro
|
|
|
27
27
|
Execution.new(args).call
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
@production = true
|
|
31
|
-
def self.production?
|
|
32
|
-
@production
|
|
33
|
-
end
|
|
34
|
-
|
|
35
30
|
class Execution
|
|
36
31
|
NOME_DO_PROGRAMA = 'teodoro'.freeze
|
|
37
32
|
|
|
@@ -49,6 +44,7 @@ module Teodoro
|
|
|
49
44
|
validar_argumentos
|
|
50
45
|
validar_existencia_do_diretorio_de_origem
|
|
51
46
|
validar_existencia_do_diretorio_de_destino
|
|
47
|
+
validar_que_diretorio_de_origem_nao_contem_arquivo
|
|
52
48
|
validar_que_diretorio_de_origem_nao_esta_vazio
|
|
53
49
|
validar_que_diretorio_de_destino_esta_vazio
|
|
54
50
|
validar_que_nao_ha_nova_versao_disponivel
|
|
@@ -113,6 +109,14 @@ module Teodoro
|
|
|
113
109
|
@destino ||= args[1].tr('\\', '/')
|
|
114
110
|
end
|
|
115
111
|
|
|
112
|
+
def validar_que_diretorio_de_origem_nao_contem_arquivo
|
|
113
|
+
erro 'Diretório de origem deve conter apenas diretórios de empresa.' if diretorio_de_origem_contem_arquivo?
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def diretorio_de_origem_contem_arquivo?
|
|
117
|
+
Dir[File.join(origem, '*')].any? { File.file?(_1) }
|
|
118
|
+
end
|
|
119
|
+
|
|
116
120
|
def validar_que_diretorio_de_origem_nao_esta_vazio
|
|
117
121
|
erro 'Diretório de origem vazio.' if Dir.empty?(origem)
|
|
118
122
|
end
|
data/lib/teodoro/arquivo_xml.rb
CHANGED
|
@@ -127,11 +127,11 @@ module Teodoro
|
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
def validar_versao_do_leiaute
|
|
130
|
-
raise unless [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
raise unless %w[
|
|
131
|
+
02_04_01
|
|
132
|
+
02_04_02
|
|
133
|
+
02_05_00
|
|
134
|
+
_S_01_00_00
|
|
135
135
|
].include?(versao_do_leiaute)
|
|
136
136
|
end
|
|
137
137
|
|