bddgenx 0.1.14 → 0.1.15

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: 8cc789d1c3db724dd84b2b9c952024ef4d82a7698699c7802ed6f2f04995f254
4
- data.tar.gz: 45f519f2405da062b88a03d44022892a352f8e87d69f91689c5811614699fe30
3
+ metadata.gz: 0da9cd3383cb0aee1913bbc15027ca76e162583229057b73c875c635b39c9638
4
+ data.tar.gz: 20509237489c3e314c8092d06ec36bbbd6e366cd34c0103d7520ba98c5ddc8e6
5
5
  SHA512:
6
- metadata.gz: c9ddcd28a5df7b0b37cb2af741181c6a22c96806373eb0769f07ddaf517c275b837d67a586153eed5b4f92a9d4c13cdbff70a97b7767aaf6376ef3e253cb7c7a
7
- data.tar.gz: a16880e6a1bd5c0726615a5091a8924fd6cd8d6e51e39c5c8716ecb60a7234c76d0ed1ac05192598dfbbb59770be8ff0c106adb4f0650e8eb033a384abc68555
6
+ metadata.gz: 30f2a4569e8332add1094d37de9db31ce39740b1c1c2414b474595fd2c41c3f64a106144f007903da15e97c93bcc9995532becf4ccb034fd280943af5f1ba347
7
+ data.tar.gz: d1ca7cd92079d1560cf59579a4cd90798616613e086956cbbc3480fd6c99fddd0c42c51293f67fad46aeb4987175b0b9210b79efd9b95d85654eab9aa1656136
@@ -40,11 +40,16 @@ module Bddgenx
40
40
  end
41
41
 
42
42
  pdf.font_size 10
43
+ def self.sanitizar_utf8_para_ascii(linha)
44
+ linha.encode('Windows-1252', invalid: :replace, undef: :replace, replace: '?')
45
+ rescue Encoding::UndefinedConversionError
46
+ linha.tr('áéíóúãõçâêîôûÁÉÍÓÚÃÕÇÂÊÎÔÛ', 'aeiouaocaeiouAEIOUAOCAEOU')
47
+ end
43
48
  pdf.text "📄 #{File.basename(origem)}", style: :bold, size: 14
44
49
  pdf.move_down 10
45
50
 
46
51
  conteudo.each_line do |linha|
47
- linha = linha.strip
52
+ linha = fonte_existe ? linha.strip : sanitizar_utf8_para_ascii(linha.strip)
48
53
 
49
54
  case linha
50
55
  when /^#/
@@ -1,3 +1,3 @@
1
1
  module Bddgenx
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.15"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bddgenx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Nascimento