nfse_issnet 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 112fe9e344ce587de1ebb8560397ea8018d70de504c9227b4b0110d9cc8758cd
4
- data.tar.gz: db319b077e627bee21a1e84a1cb533b8b1d8ccad3fb6c57fdda2cd0fbebee8ce
3
+ metadata.gz: 1b422ffc05a6a4544205307e28cdd4ad4e0a76111eda800be5ee3bcc8d7e532d
4
+ data.tar.gz: 83690395f48a3bfb6de1643082c2ebd1ac747d52a6e62d8d7b903f02ec5c3e49
5
5
  SHA512:
6
- metadata.gz: 15e81388bc6e78ae807a2c2869f054fea70a91dc7fe79e64aeb28e6288af1e337737bcbe4c05de19fe075a414409332325d053656d544f8920d292a2bfc60abe
7
- data.tar.gz: bb4d3fe6a77ff4b954918d12eab3cce720f94c2142fc69e6427631287483cd2948b8c09d3172a5825f5cb5b60959e1abd1ff98d04b696f73626a13a353726b5e
6
+ metadata.gz: cf9931dac00fde20dab649cf7dd1926622de19f7ac66e262e0faff2eaa7891822e5ac1129103c843c660159f60634db59566f5f584deabba6a38ad68a2ac7c30
7
+ data.tar.gz: c4bc8b9c821086d981b0dba53774cf09831fb8ee3c056c9215291b4df2072eb5bb6eb305452a00d59ceaadb39df774628478ad992378eaf3f1675bf216b0ded3
data/docker-compose.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: '3'
2
2
  services:
3
- web:
3
+ nfse:
4
4
  build: .
5
5
  tty: true
6
6
  stdin_open: true
@@ -1,35 +1,37 @@
1
- module Utils
2
- module Assinatura
1
+ module NfseIssnet
2
+ module Utils
3
+ module Assinatura
3
4
 
4
- class << self
5
- attr_accessor :certificate, :certificate_key
5
+ class << self
6
+ attr_accessor :certificate, :certificate_key
6
7
 
7
- def certificate
8
- @certificate ||= certificate_pkcs12&.certificate
9
- end
8
+ def certificate
9
+ @certificate ||= certificate_pkcs12&.certificate
10
+ end
10
11
 
11
- def certificate_key
12
- @certificate_key ||= certificate_pkcs12&.key
13
- end
12
+ def certificate_key
13
+ @certificate_key ||= certificate_pkcs12&.key
14
+ end
14
15
 
15
- private
16
+ private
16
17
 
17
- attr_accessor :certificate_pkcs12_value, :certificate_pkcs12
18
+ attr_accessor :certificate_pkcs12_value, :certificate_pkcs12
18
19
 
19
- def certificate_pkcs12_value
20
- @certificate_pkcs12_value ||= File.read(NfseIssnet.configuration.certificate_pkcs12_path)
21
- end
20
+ def certificate_pkcs12_value
21
+ @certificate_pkcs12_value ||= File.read(NfseIssnet.configuration.certificate_pkcs12_path)
22
+ end
22
23
 
23
- def certificate_pkcs12
24
- return @certificate_pkcs12 if @certificate_pkcs12
25
- @certificate_pkcs12 = nil
26
- Thread.new do
27
- @certificate_pkcs12 = OpenSSL::PKCS12.new(certificate_pkcs12_value, NfseIssnet.configuration.certificate_pkcs12_password)
28
- end.join
24
+ def certificate_pkcs12
25
+ return @certificate_pkcs12 if @certificate_pkcs12
26
+ @certificate_pkcs12 = nil
27
+ Thread.new do
28
+ @certificate_pkcs12 = OpenSSL::PKCS12.new(certificate_pkcs12_value, NfseIssnet.configuration.certificate_pkcs12_password)
29
+ end.join
29
30
 
30
- @certificate_pkcs12
31
- rescue
32
- nil
31
+ @certificate_pkcs12
32
+ rescue
33
+ nil
34
+ end
33
35
  end
34
36
  end
35
37
  end
@@ -1,18 +1,20 @@
1
- module Utils
1
+ module NfseIssnet
2
2
  module Utils
3
- class << self
4
- def snakecase(key)
5
- #gsub(/::/, '/').
6
- key.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
7
- gsub(/([a-z\d])([A-Z])/, '\1_\2').
8
- tr('-', '_').
9
- gsub(/\s/, '_').
10
- gsub(/__+/, '_').
11
- downcase
12
- end
3
+ module Utils
4
+ class << self
5
+ def snakecase(key)
6
+ #gsub(/::/, '/').
7
+ key.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
8
+ gsub(/([a-z\d])([A-Z])/, '\1_\2').
9
+ tr('-', '_').
10
+ gsub(/\s/, '_').
11
+ gsub(/__+/, '_').
12
+ downcase
13
+ end
13
14
 
14
- def remove_quebras(str)
15
- str.gsub(/\n/, '').gsub(/\t/, '').strip
15
+ def remove_quebras(str)
16
+ str.gsub(/\n/, '').gsub(/\t/, '').strip
17
+ end
16
18
  end
17
19
  end
18
20
  end
@@ -1,30 +1,32 @@
1
- module Utils
2
- module XML
3
- class << self
4
- def render(file_name, opts = {})
5
- opts ||= {}
6
- opts[:context] ||= self
1
+ module NfseIssnet
2
+ module Utils
3
+ module XML
4
+ class << self
5
+ def render(file_name, opts = {})
6
+ opts ||= {}
7
+ opts[:context] ||= self
7
8
 
8
- # Inicializa a variavel xml com nil para comparar se oa rquivo foi de fato encontrado.
9
- xml = find(file_name, "#{NfseIssnet.root}/lib/nfse_issnet/xml", opts[:context], opts)
9
+ # Inicializa a variavel xml com nil para comparar se oa rquivo foi de fato encontrado.
10
+ xml = find(file_name, "#{NfseIssnet.root}/lib/nfse_issnet/xml", opts[:context], opts)
10
11
 
11
- # Lança uma excessão se não for encontrado o xml
12
- # Deve verificar se é nil pois o arquivo xml pode estar vazio
13
- if xml.nil?
14
- raise "Arquivo #{file_name}.xml.slim não encontrado nos diretórios"
12
+ # Lança uma excessão se não for encontrado o xml
13
+ # Deve verificar se é nil pois o arquivo xml pode estar vazio
14
+ if xml.nil?
15
+ raise "Arquivo #{file_name}.xml.slim não encontrado nos diretórios"
16
+ end
17
+ xml
15
18
  end
16
- xml
17
- end
18
19
 
19
- private
20
+ private
20
21
 
21
- def namespace_for_tags
22
- 'tc:'
23
- end
22
+ def namespace_for_tags
23
+ 'tc:'
24
+ end
24
25
 
25
- def find(file_name, dir, context = nil, options = {})
26
- if File.exists?("#{dir}/#{file_name}.xml.slim")
27
- %Q{#{Slim::Template.new("#{dir}/#{file_name}.xml.slim", disable_escape: true).render(context, options)}}
26
+ def find(file_name, dir, context = nil, options = {})
27
+ if File.exists?("#{dir}/#{file_name}.xml.slim")
28
+ %Q{#{Slim::Template.new("#{dir}/#{file_name}.xml.slim", disable_escape: true).render(context, options)}}
29
+ end
28
30
  end
29
31
  end
30
32
  end
@@ -1,3 +1,3 @@
1
1
  module NfseIssnet
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nfse_issnet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Scottini