bddgenx 0.1.12 → 0.1.14

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: 67645045af3cc9180b3e34f3743bd21fe90d8743a56febed112b1e1d787b5b85
4
- data.tar.gz: dc0368773bc04a891a03085a99251a98223f840d5a75b0c7bd698575ee97e5ba
3
+ metadata.gz: 8cc789d1c3db724dd84b2b9c952024ef4d82a7698699c7802ed6f2f04995f254
4
+ data.tar.gz: 45f519f2405da062b88a03d44022892a352f8e87d69f91689c5811614699fe30
5
5
  SHA512:
6
- metadata.gz: a8fc504876ececf91dbe5bcc2a48ba2596c9241b602aed83c813bacc0c4bc138a4257fa078483d9abbdb60f7584eb7cf0e7437851726a538c43ad9884ef1a317
7
- data.tar.gz: a23d58672473d4b8f0809199f4da232abc798e57bd95632d93af6f73a78c40d8f2bb44c9546c61ac912bbb9dd30ce3c3d51d0de20c628870590979c1555b92a1
6
+ metadata.gz: c9ddcd28a5df7b0b37cb2af741181c6a22c96806373eb0769f07ddaf517c275b837d67a586153eed5b4f92a9d4c13cdbff70a97b7767aaf6376ef3e253cb7c7a
7
+ data.tar.gz: a16880e6a1bd5c0726615a5091a8924fd6cd8d6e51e39c5c8716ecb60a7234c76d0ed1ac05192598dfbbb59770be8ff0c106adb4f0650e8eb033a384abc68555
@@ -22,19 +22,25 @@ module Bddgenx
22
22
  conteudo = File.read(origem, encoding: 'utf-8')
23
23
 
24
24
  Prawn::Document.generate(destino) do |pdf|
25
- # Fontes externas com suporte UTF-8
26
- pdf.font_families.update(
27
- "DejaVu" => {
28
- normal: "fonts/DejaVuSansMono.ttf",
29
- bold: "fonts/DejaVuSansMono-Bold.ttf",
30
- italic: "fonts/DejaVuSansMono-Oblique.ttf",
31
- bold_italic: "fonts/DejaVuSansMono-BoldOblique.ttf"
32
- }
33
- )
34
- pdf.font "DejaVu"
35
- pdf.font_size 10
25
+ fonte_existe = File.exist?("fonts/DejaVuSansMono.ttf")
26
+
27
+ if fonte_existe
28
+ pdf.font_families.update(
29
+ "DejaVu" => {
30
+ normal: "fonts/DejaVuSansMono.ttf",
31
+ bold: "fonts/DejaVuSansMono-Bold.ttf",
32
+ italic: "fonts/DejaVuSansMono-Oblique.ttf",
33
+ bold_italic: "fonts/DejaVuSansMono-BoldOblique.ttf"
34
+ }
35
+ )
36
+ pdf.font "DejaVu"
37
+ else
38
+ puts "⚠️ Fonte personalizada não encontrada. Usando fonte padrão."
39
+ pdf.font "Courier" # embutida no Prawn
40
+ end
36
41
 
37
- pdf.text "📄 #{File.basename(origem)}", style: :normal, size: 14
42
+ pdf.font_size 10
43
+ pdf.text "📄 #{File.basename(origem)}", style: :bold, size: 14
38
44
  pdf.move_down 10
39
45
 
40
46
  conteudo.each_line do |linha|
@@ -45,38 +51,24 @@ module Bddgenx
45
51
  pdf.fill_color "888888"
46
52
  pdf.text linha, style: :italic, size: 8
47
53
  pdf.fill_color "000000"
48
-
49
54
  when /^Funcionalidade:|^Feature:/
50
55
  pdf.move_down 6
51
56
  pdf.text linha, style: :bold, size: 12
52
57
  pdf.move_down 4
53
-
54
58
  when /^Cenário:|^Scenario:|^Esquema do Cenário:|^Scenario Outline:/
55
59
  pdf.move_down 4
56
60
  pdf.text linha, style: :bold
57
-
58
61
  when /^@/
59
62
  pdf.text linha, style: :italic, color: "555555"
60
-
61
63
  when /^(Dado|Quando|Então|E|Mas|Given|When|Then|And|But)\b/
62
- pdf.indent(20) do
63
- pdf.text linha
64
- end
65
-
64
+ pdf.indent(20) { pdf.text linha }
66
65
  when /^Exemplos:|^Examples:/
67
66
  pdf.move_down 4
68
67
  pdf.text linha, style: :bold
69
-
70
68
  when /^\|.*\|$/
71
- pdf.indent(20) do
72
- pdf.font_size 9
73
- pdf.text linha, font: "DejaVu"
74
- pdf.font_size 10
75
- end
76
-
69
+ pdf.indent(20) { pdf.text linha }
77
70
  when /^\s*$/
78
71
  pdf.move_down 4
79
-
80
72
  else
81
73
  pdf.text linha
82
74
  end
@@ -85,8 +77,8 @@ module Bddgenx
85
77
  pdf.move_down 20
86
78
  pdf.number_pages "Página <page> de <total>", align: :right, size: 8
87
79
  end
88
- rescue => e
89
- puts "❌ Erro ao gerar PDF de #{origem}: #{e.message}"
80
+ rescue => e
81
+ puts "❌ Erro ao gerar PDF de #{origem}: #{e.message}"
90
82
  end
91
83
  end
92
84
  end
@@ -1,3 +1,3 @@
1
1
  module Bddgenx
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.14"
3
3
  end
data/lib/bddgenx.rb CHANGED
@@ -15,7 +15,7 @@ cont_steps = 0
15
15
  cont_ignorados = 0
16
16
 
17
17
  # Exibe menu inicial e pergunta quais arquivos processar
18
- arquivos = Bddgenx::CLI.selecionar_arquivos_txt('input')
18
+ arquivos = Bddgenx::Cli.selecionar_arquivos_txt('input')
19
19
 
20
20
  arquivos.each do |arquivo_path|
21
21
  puts "\n🔍 Processando: #{arquivo_path}"
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.12
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Nascimento