bddgenx 0.1.18 → 0.1.20

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: 94a0f0c3d58d4244048cc2b01054fbdde3ffaf2c627d36ea531d25bb64fd295d
4
- data.tar.gz: fa9590c3a6e81c863ae6ea706e7bd24e0577cf9b31ef851c868f8c5a81c181bf
3
+ metadata.gz: 919bbf1314c68b9cd828e92b4eb07624bd7de3d4b2fbf5eb767c321422d19014
4
+ data.tar.gz: b46ac8838b38115277c61a702b726e71ad5f7eb506db4358e98a76445ce7304b
5
5
  SHA512:
6
- metadata.gz: a6cb0637977eab5b05790e0b0900d9862ebd4a7633b24d2a8d0c1daf0b5ff1259adcc1110f51e89607d07a335cb80f3cd05cca958c24332f93651d120a2eba4a
7
- data.tar.gz: df1f2fe658088fb4fa27cea0be63547228d1ac677333191cbc68a59bd59c5b58ae056b75e3c4f7017b43b00879244fa63e81f3da905771f63692322a7397b133
6
+ metadata.gz: 172de9e09a66b96d69e7e340001b8c04f659aa513ea8fc033fe7b3d78955e841717f8ebaab0aaeed268689d8ac928c3662069bf417d6990a67eb7b15ad0f0219
7
+ data.tar.gz: 781b4cfcab32df206a2415d5c92029c54666c7dcad944cda1c9305da748bbd333a5de47010ffca07fa37b998b882c95c45f84195c8dc9f726296e337ba3aa4c8
data/README.md CHANGED
@@ -6,37 +6,37 @@ Este projeto gera arquivos `.feature` (Gherkin) e `steps.rb` automaticamente a p
6
6
 
7
7
  ## 📂 Estrutura do Projeto
8
8
  ```txt
9
- bdd_generator/
10
- ├── doc/
11
- ├── configuracao-padra.md
12
- │ └── configuracao-rake.md
13
- ├── assets/
14
- │ └── fonts/
15
- │ ├── DejaVuSansMono.ttf
16
- │ ├── DejaVuSansMono-Bold.ttf
17
- │ ├── DejaVuSansMono-Oblique.ttf
18
- │ └── DejaVuSansMono-BoldOblique.ttf
19
- ├── input/ # Arquivos .txt com histórias de usuário
20
- ├── features/ # Arquivos .feature gerados
21
- ├── steps/ # Arquivos com step definitions
22
- ├── output/
23
- │ └── rastreabilidade.csv
24
- ├── pdf/ # Relatórios PDF gerados
25
- ├── backup/ # Versões antigas de arquivos sobrescritos
26
- ├── lib/
27
- │ ├── bddgenx/
9
+ bddgenx/ # raiz do repositório
10
+ ├── bin/ # executáveis CLI
11
+ └── bddgenx # script que chama Bddgenx::Runner.executar
12
+ ├── lib/ # código-fonte da gem
13
+ ├── bddgenx/ # namespace principal
28
14
  │ │ ├── parser.rb
15
+ │ │ ├── validator.rb
29
16
  │ │ ├── generator.rb
30
17
  │ │ ├── steps_generator.rb
31
- │ │ ├── validator.rb
32
18
  │ │ ├── tracer.rb
33
19
  │ │ ├── backup.rb
34
20
  │ │ ├── pdf_exporter.rb
35
- │ │ └── utils/
21
+ │ │ └── utils/ # helpers e módulos auxiliares
36
22
  │ │ └── verificador.rb
37
- │ └── bddgenx.rb # Arquivo principal de execução
38
- ├── Rakefile
39
- └── README.md
23
+ │ └── bddgenx.rb # entrypoint: require_relative de tudo
24
+ ├── features/ # specs Cucumber para testar a gem
25
+ └── support/ # support files para os testes
26
+ ├── spec/ or test/ # unit tests (RSpec, Minitest)
27
+ ├── input/ # exemplos de .txt de usuários
28
+ ├── output/ # artefatos gerados (rastreabilidade.csv, etc.)
29
+ ├── pdf/ # PDFs gerados
30
+ ├── backup/ # backups automáticos
31
+ ├── doc/ # documentação (markdown)
32
+ │ ├── configuracao-padra.md
33
+ │ └── configuracao-rake.md
34
+ ├── bddgenx.gemspec # gemspec
35
+ ├── Gemfile # dependências de desenvolvimento
36
+ ├── Rakefile # tarefas: build, test, release, clean…
37
+ ├── .gitignore
38
+ └── README.md # descrição, instalação, exemplos de uso
39
+
40
40
  ```
41
41
  ## ▶️ Como Executar
42
42
 
@@ -1,5 +1,6 @@
1
1
  require 'prawn'
2
2
  require 'fileutils'
3
+ require 'unicode_normalize'
3
4
 
4
5
  module Bddgenx
5
6
  class PDFExporter
@@ -19,6 +20,18 @@ module Bddgenx
19
20
  end
20
21
  end
21
22
 
23
+ def self.sanitizar_utf8_para_ascii(texto)
24
+ # Decompõe caracteres Unicode em forma compatível (NFKD),
25
+ # remove marcas de combinação (acentos) e retorna apenas ASCII
26
+ texto
27
+ .unicode_normalize(:nfkd) # separa base + acentos
28
+ .chars
29
+ .reject { |c| c.match?(/\p{Mn}/) } # remove marcas de combinação
30
+ .join
31
+ .encode('ASCII', undef: :replace, replace: '?')
32
+ end
33
+
34
+
22
35
  def self.exportar_arquivo(origem, destino)
23
36
  conteudo = File.read(origem, encoding: 'utf-8')
24
37
 
@@ -42,11 +55,6 @@ module Bddgenx
42
55
  end
43
56
 
44
57
  pdf.font_size 10
45
- def self.sanitizar_utf8_para_ascii(linha)
46
- linha.encode('Windows-1252', invalid: :replace, undef: :replace, replace: '?')
47
- rescue Encoding::UndefinedConversionError
48
- linha.tr('áéíóúãõçâêîôûÁÉÍÓÚÃÕÇÂÊÎÔÛ', 'aeiouaocaeiouAEIOUAOCAEOU')
49
- end
50
58
  pdf.text "📄 #{File.basename(origem)}", style: :bold, size: 14
51
59
  pdf.move_down 10
52
60
 
@@ -1,3 +1,3 @@
1
1
  module Bddgenx
2
- VERSION = "0.1.18"
2
+ VERSION = "0.1.20"
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.18
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Nascimento