teodoro 0.0.6 → 0.0.7
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/bin/teodoro +1 -1
- data/lib/teodoro.rb +4 -3
- data/lib/teodoro/arquivo_de_evento.rb +18 -0
- data/lib/teodoro/arquivo_de_evento_de_tabela.rb +1 -4
- data/lib/teodoro/arquivo_de_evento_nao_periodico.rb +1 -5
- data/lib/teodoro/execucao.rb +0 -3
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b847466dec2ee0dfa4debb804d5af16dd183dcceeeb28664d0adea46b3f4ec95
|
4
|
+
data.tar.gz: 4c7aacf5cfdaf9af17298538947fb59cdfa82fd069d1136f06300cde54d3f463
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dc6d426102161726682f79f701f2b481bf14c9a65f4838663d808c31cdf804a1fd651bc4f3116cc8a82ba7efec16405e8d336ea4ae484e26b2e8c651cbfdbf9
|
7
|
+
data.tar.gz: 07ce6e6d6f2e57a3358dd77d6a218c28e09b92f8abe1420924dd79d4c22fe62cfb1695cd4b0b9630d7e6bbca9fab27caee932258bc6fc8dbba6b44f7dedff23e
|
data/bin/teodoro
CHANGED
data/lib/teodoro.rb
CHANGED
@@ -5,9 +5,27 @@ module Teodoro
|
|
5
5
|
attr_reader :xml_do_evento, :xml_do_recibo, :destino_dos_arquivos_data
|
6
6
|
|
7
7
|
def criar_arquivo_data
|
8
|
+
raise if File.exist?(caminho_do_arquivo_data)
|
9
|
+
|
8
10
|
File.write(caminho_do_arquivo_data, conteudo_do_arquivo_data)
|
9
11
|
end
|
10
12
|
|
13
|
+
def caminho_do_arquivo_data
|
14
|
+
criar_caminho_do_arquivo_data(nome_do_arquivo_data)
|
15
|
+
end
|
16
|
+
|
17
|
+
def criar_caminho_do_arquivo_data(nome_do_arquivo)
|
18
|
+
# FIXME: Tales demais caracteres especiais
|
19
|
+
File.join(
|
20
|
+
destino_dos_arquivos_data,
|
21
|
+
"#{windows? ? nome_do_arquivo.gsub(%r{[<|>:"/\\?*]}, '_') : nome_do_arquivo}.data"
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def windows?
|
26
|
+
OS.windows?
|
27
|
+
end
|
28
|
+
|
11
29
|
def evento
|
12
30
|
@evento ||= XML.new(xml_do_evento)
|
13
31
|
end
|
@@ -38,10 +38,7 @@ module Teodoro
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def obter_caminho_do_arquivo_data(inicio_da_validade)
|
41
|
-
|
42
|
-
destino_dos_arquivos_data,
|
43
|
-
"#{nome_base_do_arquivo_data}[#{inicio_da_validade.delete('-')}].data"
|
44
|
-
)
|
41
|
+
criar_caminho_do_arquivo_data("#{nome_base_do_arquivo_data}[#{inicio_da_validade.delete('-')}]")
|
45
42
|
end
|
46
43
|
|
47
44
|
def nome_base_do_arquivo_data
|
@@ -32,7 +32,7 @@ module Teodoro
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def caminho_do_arquivo_data_original
|
35
|
-
|
35
|
+
criar_caminho_do_arquivo_data(nome_do_arquivo_original)
|
36
36
|
end
|
37
37
|
|
38
38
|
def nome_do_arquivo_original
|
@@ -50,9 +50,5 @@ module Teodoro
|
|
50
50
|
def numero_do_recibo
|
51
51
|
recibo['retornoEvento/recibo/nrRecibo']
|
52
52
|
end
|
53
|
-
|
54
|
-
def caminho_do_arquivo_data
|
55
|
-
File.join(destino_dos_arquivos_data, "#{nome_do_arquivo_data}.data")
|
56
|
-
end
|
57
53
|
end
|
58
54
|
end
|
data/lib/teodoro/execucao.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teodoro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clavius Tales
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: os
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rubyzip
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|