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 +4 -4
- data/lib/bddgenx/pdf_exporter.rb +6 -1
- data/lib/bddgenx/version.rb +1 -1
- 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: 0da9cd3383cb0aee1913bbc15027ca76e162583229057b73c875c635b39c9638
|
4
|
+
data.tar.gz: 20509237489c3e314c8092d06ec36bbbd6e366cd34c0103d7520ba98c5ddc8e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30f2a4569e8332add1094d37de9db31ce39740b1c1c2414b474595fd2c41c3f64a106144f007903da15e97c93bcc9995532becf4ccb034fd280943af5f1ba347
|
7
|
+
data.tar.gz: d1ca7cd92079d1560cf59579a4cd90798616613e086956cbbc3480fd6c99fddd0c42c51293f67fad46aeb4987175b0b9210b79efd9b95d85654eab9aa1656136
|
data/lib/bddgenx/pdf_exporter.rb
CHANGED
@@ -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 /^#/
|
data/lib/bddgenx/version.rb
CHANGED