br_danfe 1.2.2 → 2.0.0
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/.github/workflows/config.yml +2 -2
- data/Gemfile +14 -0
- data/Gemfile.lock +59 -42
- data/README.md +10 -4
- data/br_danfe.gemspec +2 -13
- data/lib/br_danfe/cce_lib/document.rb +2 -2
- data/lib/br_danfe/danfe_lib/nfce_lib/document.rb +2 -2
- data/lib/br_danfe/danfe_lib/nfce_lib/header.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfe_lib/document.rb +4 -4
- data/lib/br_danfe/danfe_lib/nfe_lib/infadic.rb +1 -1
- data/lib/br_danfe/document_builder.rb +2 -2
- data/lib/br_danfe/logo_options.rb +1 -1
- data/lib/br_danfe/mdfe_lib/document.rb +2 -2
- data/lib/br_danfe/version.rb +1 -1
- data/lib/br_danfe.rb +1 -1
- data/lib/prawn/font.rb +1 -1
- data/spec/br_danfe/cce_lib/barcode_spec.rb +1 -1
- data/spec/br_danfe/cce_lib/correction_spec.rb +1 -1
- data/spec/br_danfe/cce_lib/document_spec.rb +7 -7
- data/spec/br_danfe/cce_lib/footer_spec.rb +1 -1
- data/spec/br_danfe/cce_lib/header_spec.rb +1 -1
- data/spec/br_danfe/cce_lib/nfe_key_spec.rb +1 -1
- data/spec/br_danfe/cce_lib/protocol_spec.rb +1 -1
- data/spec/br_danfe/cce_spec.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/document_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfce_lib/footer_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfce_lib/header_spec.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/key_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfce_lib/nfce_identification_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfce_lib/product_list_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfce_lib/recipient_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfce_lib/total_list_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfce_spec.rb +3 -3
- data/spec/br_danfe/danfe_lib/nfe_lib/dest_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/det_body_spec.rb +8 -8
- data/spec/br_danfe/danfe_lib/nfe_lib/document_spec.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfe_lib/dup_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/emit_header_spec.rb +3 -3
- data/spec/br_danfe/danfe_lib/nfe_lib/entrega_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/icmstot_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/infadic_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/infadic_vol_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/issqn_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/ticket_spec.rb +3 -3
- data/spec/br_danfe/danfe_lib/nfe_lib/transp_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/vol_spec.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfe_spec.rb +6 -6
- data/spec/br_danfe/mdfe_lib/fisco_control_spec.rb +1 -1
- data/spec/br_danfe/mdfe_lib/header_spec.rb +1 -1
- data/spec/br_danfe/mdfe_lib/notes_spec.rb +1 -1
- data/spec/br_danfe/mdfe_spec.rb +2 -2
- data/spec/br_danfe/qr_code_spec.rb +1 -1
- data/spec/fixtures/cce/lib/barcode#render.pdf +14 -14
- data/spec/fixtures/cce/lib/correction#render.pdf +0 -0
- data/spec/fixtures/cce/lib/document#box.pdf +14 -14
- data/spec/fixtures/cce/lib/document#box.with.block.pdf +0 -0
- data/spec/fixtures/cce/lib/document#text.align.pdf +0 -0
- data/spec/fixtures/cce/lib/document#text.pad.pdf +0 -0
- data/spec/fixtures/cce/lib/document#text.simple.pdf +0 -0
- data/spec/fixtures/cce/lib/document#text.size.pdf +0 -0
- data/spec/fixtures/cce/lib/document#text.style.pdf +0 -0
- data/spec/fixtures/cce/lib/footer#render.pdf +0 -0
- data/spec/fixtures/cce/lib/header#render.pdf +0 -0
- data/spec/fixtures/cce/lib/nfe_key#render.pdf +0 -0
- data/spec/fixtures/cce/lib/protocol#render.pdf +0 -0
- data/spec/fixtures/cce/v1.00/cce.fixture.pdf +265 -149
- data/spec/fixtures/mdfe/lib/fisco_control#barcode.pdf +0 -0
- data/spec/fixtures/mdfe/lib/fisco_control#without-barcode.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-qr-code.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-with_logo.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-without-qr-code.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-without_logo.pdf +0 -0
- data/spec/fixtures/mdfe/lib/mdfe-with-multiple-pages.pdf +344 -176
- data/spec/fixtures/mdfe/lib/mdfe.fixture.pdf +336 -168
- data/spec/fixtures/mdfe/lib/notes#render-big-aditional-information.pdf +219 -151
- data/spec/fixtures/nfce/lib/document#render.pdf +20 -20
- data/spec/fixtures/nfce/lib/footer#render-with_additional_information.pdf +0 -0
- data/spec/fixtures/nfce/lib/footer#render.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-homologation.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-long_name_with_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-long_name_without_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-short_name_with_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-short_name_without_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/key#render.pdf +0 -0
- data/spec/fixtures/nfce/lib/nfce_identification#render.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_many_products.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_many_products_and_long_names.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_single_product.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_single_product_and_long_name.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-company.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-consumer_without_document.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-foreign.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-individual.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-unidentified_consumer.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#does_not_render-payment_methods.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render-grouped_payment_methods.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render-totals.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render-without_payment.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/multiples_xmls_on_the_same_pdf.pdf +336 -205
- data/spec/fixtures/nfce/v4.00/nfce-unauthorized-hom.fixture.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/nfce-unauthorized-prod.fixture.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/rendered_nfce.fixture.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/saved_nfce.fixture.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-v2.00.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-v3.10.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-v4.00.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-with-address-bigger.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-with_cnpj.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-with_cpf.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-with_ie.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-without-address-complement.pdf +0 -0
- data/spec/fixtures/nfe/lib/det_body#render-csosn.pdf +144 -82
- data/spec/fixtures/nfe/lib/det_body#render-cst.pdf +129 -81
- data/spec/fixtures/nfe/lib/det_body#render-fci.pdf +124 -85
- data/spec/fixtures/nfe/lib/det_body#render-icms_st.pdf +133 -89
- data/spec/fixtures/nfe/lib/det_body#render-quantity_with_custom_precision.pdf +122 -84
- data/spec/fixtures/nfe/lib/det_body#render-three_pages.pdf +140 -85
- data/spec/fixtures/nfe/lib/det_body#render-two_pages.pdf +140 -85
- data/spec/fixtures/nfe/lib/det_body#render-unit_price_with_custom_precision.pdf +122 -84
- data/spec/fixtures/nfe/lib/det_body#render-with_entrega.pdf +118 -64
- data/spec/fixtures/nfe/lib/det_body#render-with_infadprod.pdf +131 -76
- data/spec/fixtures/nfe/lib/det_body#render-with_issqn.pdf +140 -85
- data/spec/fixtures/nfe/lib/det_body#render-without_issqn.pdf +140 -85
- data/spec/fixtures/nfe/lib/document#lcnpj-blank.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lcnpj-invalid.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lcnpj-valid.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lie-blank-uf-invalid.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lie-blank.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lie-invalid.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lie-valid.pdf +0 -0
- data/spec/fixtures/nfe/lib/dup#render-with_entrega.pdf +0 -0
- data/spec/fixtures/nfe/lib/dup#render.pdf +0 -0
- data/spec/fixtures/nfe/lib/emit_header#render-nfe_key.pdf +283 -151
- data/spec/fixtures/nfe/lib/emit_header#render-second_page.pdf +283 -151
- data/spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf +283 -151
- data/spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf +264 -132
- data/spec/fixtures/nfe/lib/entrega#render-v2.00.pdf +0 -0
- data/spec/fixtures/nfe/lib/entrega#render-with-address-bigger.pdf +0 -0
- data/spec/fixtures/nfe/lib/entrega#render-with_cpf.pdf +0 -0
- data/spec/fixtures/nfe/lib/icmstot#render-with_entrega.pdf +0 -0
- data/spec/fixtures/nfe/lib/icmstot#render.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-all_the_informations.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-difal.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-extra_volume.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-with_complementary_information.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-with_dup_additional_information.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-with_fisco_additional_information.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-with_street_data.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-without_dup_additional_information.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic_vol#render-extra_volume.pdf +0 -0
- data/spec/fixtures/nfe/lib/issqn#render-with_entrega.pdf +0 -0
- data/spec/fixtures/nfe/lib/issqn#render-with_issqn.pdf +0 -0
- data/spec/fixtures/nfe/lib/issqn#render-with_one_issqn_value.pdf +0 -0
- data/spec/fixtures/nfe/lib/issqn#render-without_issqn.pdf +14 -14
- data/spec/fixtures/nfe/lib/ticket#render.pdf +0 -0
- data/spec/fixtures/nfe/lib/ticket#render_with_dEmit.pdf +0 -0
- data/spec/fixtures/nfe/lib/ticket#render_with_dhEmit.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_0.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_1.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_2.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_3.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_4.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_9.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-with_entrega.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render.pdf +0 -0
- data/spec/fixtures/nfe/lib/vol#render-blank-boxes.pdf +0 -0
- data/spec/fixtures/nfe/lib/vol#render-with_entrega.pdf +0 -0
- data/spec/fixtures/nfe/lib/vol#render.pdf +0 -0
- data/spec/fixtures/nfe/v2.00/custom_options.fixture.pdf +312 -185
- data/spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf +293 -166
- data/spec/fixtures/nfe/v2.00/nfe_with_entrega.xml.fixture.pdf +296 -166
- data/spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +419 -221
- data/spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf +311 -163
- data/spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf +309 -171
- data/spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf +303 -152
- data/spec/fixtures/nfe/v3.10/multiples.xmls.on.the.same.pdf.pdf +320 -152
- data/spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf +312 -144
- data/spec/fixtures/nfe/v3.10/with_footer.fixture.pdf +323 -169
- data/spec/fixtures/nfe/v3.10/with_issqn.fixture.pdf +314 -138
- data/spec/fixtures/nfe/v3.10/with_three_pages.fixture.pdf +330 -159
- data/spec/fixtures/nfe/v3.10/without_issqn.fixture.pdf +319 -148
- data/spec/fixtures/qr_code/qr_code#render.pdf +0 -0
- metadata +7 -160
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6957c52fda8133d7dbb9ddf4ae9f29f20bb45bb6ec41127c546ae93bd2221f2c
|
4
|
+
data.tar.gz: 2b5031a95eb542e75f457723dee23d193f8f3407d22ba26dd85ded6400f55c35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ec5cf3a1c2ded1acc9c010c440328052a6a9660f1aaddd0bf1dcd1b1ea7ddd42f356ca433462743bb2f5443d75fd383f91d8aba8437f8fbc183f24c78a4f017
|
7
|
+
data.tar.gz: 49b1f817299513b9ba693b2b19bb0d23971578c433193e980824046ae9900a69d63207b422f93046d9c68dba14874a9414c8e8039598baf6c478fce8f384cc9f
|
@@ -7,7 +7,7 @@ jobs:
|
|
7
7
|
strategy:
|
8
8
|
fail-fast: false # I understand this is to run on all versions.
|
9
9
|
matrix:
|
10
|
-
ruby: ['3.
|
10
|
+
ruby: ['3.3.5']
|
11
11
|
|
12
12
|
runs-on: ubuntu-latest
|
13
13
|
|
@@ -25,7 +25,7 @@ jobs:
|
|
25
25
|
strategy:
|
26
26
|
fail-fast: false # I understand this is to run on all versions.
|
27
27
|
matrix:
|
28
|
-
ruby: ['3.
|
28
|
+
ruby: ['3.3.5']
|
29
29
|
|
30
30
|
runs-on: ubuntu-latest
|
31
31
|
|
data/Gemfile
CHANGED
@@ -1,3 +1,17 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
|
+
|
5
|
+
group :development, :test do
|
6
|
+
gem 'byebug', '11.1.3'
|
7
|
+
gem 'guard', '~> 2.19.0'
|
8
|
+
gem 'guard-rspec', '~> 4.7.3'
|
9
|
+
gem 'pdf-inspector', '~> 1.3.0'
|
10
|
+
gem 'rake', '13.2.1'
|
11
|
+
gem 'rspec', '3.13.0'
|
12
|
+
gem 'rubocop', '~> 1.75.3'
|
13
|
+
gem 'rubocop-performance', '~> 1.19.0'
|
14
|
+
gem 'rubocop-rspec', '~> 2.25.0'
|
15
|
+
gem 'simplecov', '0.22.0'
|
16
|
+
gem 'simplecov-html', '0.13.1'
|
17
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
br_danfe (
|
4
|
+
br_danfe (2.0.0)
|
5
5
|
barby (= 0.6.9)
|
6
6
|
br_documents (>= 0.1.3)
|
7
7
|
i18n (>= 0.8.6)
|
8
8
|
nokogiri (>= 1.8)
|
9
|
-
prawn (~> 2.
|
9
|
+
prawn (~> 2.5.0)
|
10
10
|
prawn-table (= 0.2.2)
|
11
11
|
rqrcode (>= 2.1, < 2.3)
|
12
12
|
|
@@ -27,7 +27,7 @@ GEM
|
|
27
27
|
mutex_m
|
28
28
|
tzinfo (~> 2.0)
|
29
29
|
afm (0.2.2)
|
30
|
-
ast (2.4.
|
30
|
+
ast (2.4.3)
|
31
31
|
barby (0.6.9)
|
32
32
|
base64 (0.2.0)
|
33
33
|
bigdecimal (3.1.6)
|
@@ -43,9 +43,9 @@ GEM
|
|
43
43
|
docile (1.4.1)
|
44
44
|
drb (2.2.0)
|
45
45
|
ruby2_keywords
|
46
|
-
ffi (1.
|
46
|
+
ffi (1.17.0)
|
47
47
|
formatador (1.1.0)
|
48
|
-
guard (2.
|
48
|
+
guard (2.19.0)
|
49
49
|
formatador (>= 0.2.4)
|
50
50
|
listen (>= 2.7, < 4.0)
|
51
51
|
lumberjack (>= 1.0.12, < 2.0)
|
@@ -62,11 +62,15 @@ GEM
|
|
62
62
|
hashery (2.1.2)
|
63
63
|
i18n (1.14.5)
|
64
64
|
concurrent-ruby (~> 1.0)
|
65
|
-
|
65
|
+
json (2.11.3)
|
66
|
+
language_server-protocol (3.17.0.4)
|
67
|
+
lint_roller (1.1.0)
|
68
|
+
listen (3.9.0)
|
66
69
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
67
70
|
rb-inotify (~> 0.9, >= 0.9.10)
|
68
71
|
lumberjack (1.2.10)
|
69
|
-
|
72
|
+
matrix (0.4.2)
|
73
|
+
method_source (1.1.0)
|
70
74
|
mini_portile2 (2.8.7)
|
71
75
|
minitest (5.21.2)
|
72
76
|
mutex_m (0.2.0)
|
@@ -77,10 +81,11 @@ GEM
|
|
77
81
|
notiffany (0.1.3)
|
78
82
|
nenv (~> 0.1)
|
79
83
|
shellany (~> 0.0)
|
80
|
-
parallel (1.
|
81
|
-
parser (3.
|
84
|
+
parallel (1.27.0)
|
85
|
+
parser (3.3.8.0)
|
82
86
|
ast (~> 2.4.1)
|
83
|
-
|
87
|
+
racc
|
88
|
+
pdf-core (0.10.0)
|
84
89
|
pdf-inspector (1.3.0)
|
85
90
|
pdf-reader (>= 1.0, < 3.0.a)
|
86
91
|
pdf-reader (2.5.0)
|
@@ -89,23 +94,23 @@ GEM
|
|
89
94
|
hashery (~> 2.0)
|
90
95
|
ruby-rc4
|
91
96
|
ttfunk
|
92
|
-
prawn (2.
|
93
|
-
|
94
|
-
|
97
|
+
prawn (2.5.0)
|
98
|
+
matrix (~> 0.4)
|
99
|
+
pdf-core (~> 0.10.0)
|
100
|
+
ttfunk (~> 1.8)
|
95
101
|
prawn-table (0.2.2)
|
96
102
|
prawn (>= 1.3.0, < 3.0.0)
|
103
|
+
prism (1.4.0)
|
97
104
|
pry (0.14.2)
|
98
105
|
coderay (~> 1.1)
|
99
106
|
method_source (~> 1.0)
|
100
107
|
racc (1.8.1)
|
101
|
-
rainbow (3.
|
108
|
+
rainbow (3.1.1)
|
102
109
|
rake (13.2.1)
|
103
110
|
rb-fsevent (0.11.2)
|
104
|
-
rb-inotify (0.
|
111
|
+
rb-inotify (0.11.1)
|
105
112
|
ffi (~> 1.0)
|
106
|
-
regexp_parser (2.
|
107
|
-
rexml (3.3.3)
|
108
|
-
strscan
|
113
|
+
regexp_parser (2.10.0)
|
109
114
|
rqrcode (2.2.0)
|
110
115
|
chunky_png (~> 1.0)
|
111
116
|
rqrcode_core (~> 1.0)
|
@@ -123,24 +128,34 @@ GEM
|
|
123
128
|
diff-lcs (>= 1.2.0, < 2.0)
|
124
129
|
rspec-support (~> 3.13.0)
|
125
130
|
rspec-support (3.13.1)
|
126
|
-
rubocop (
|
131
|
+
rubocop (1.75.3)
|
132
|
+
json (~> 2.3)
|
133
|
+
language_server-protocol (~> 3.17.0.2)
|
134
|
+
lint_roller (~> 1.1.0)
|
127
135
|
parallel (~> 1.10)
|
128
|
-
parser (>=
|
136
|
+
parser (>= 3.3.0.2)
|
129
137
|
rainbow (>= 2.2.2, < 4.0)
|
130
|
-
regexp_parser (>=
|
131
|
-
|
132
|
-
rubocop-ast (>= 0.6.0)
|
138
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
139
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
133
140
|
ruby-progressbar (~> 1.7)
|
134
|
-
unicode-display_width (>=
|
135
|
-
rubocop-ast (1.
|
136
|
-
parser (>= 3.
|
137
|
-
|
138
|
-
|
141
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
142
|
+
rubocop-ast (1.44.1)
|
143
|
+
parser (>= 3.3.7.2)
|
144
|
+
prism (~> 1.4)
|
145
|
+
rubocop-capybara (2.22.1)
|
146
|
+
lint_roller (~> 1.1)
|
147
|
+
rubocop (~> 1.72, >= 1.72.1)
|
148
|
+
rubocop-factory_bot (2.27.1)
|
149
|
+
lint_roller (~> 1.1)
|
150
|
+
rubocop (~> 1.72, >= 1.72.1)
|
151
|
+
rubocop-performance (1.19.1)
|
152
|
+
rubocop (>= 1.7.0, < 2.0)
|
139
153
|
rubocop-ast (>= 0.4.0)
|
140
|
-
rubocop-rspec (
|
141
|
-
rubocop (~>
|
142
|
-
rubocop-
|
143
|
-
|
154
|
+
rubocop-rspec (2.25.0)
|
155
|
+
rubocop (~> 1.40)
|
156
|
+
rubocop-capybara (~> 2.17)
|
157
|
+
rubocop-factory_bot (~> 2.22)
|
158
|
+
ruby-progressbar (1.13.0)
|
144
159
|
ruby-rc4 (0.1.5)
|
145
160
|
ruby2_keywords (0.0.5)
|
146
161
|
shellany (0.0.1)
|
@@ -148,14 +163,16 @@ GEM
|
|
148
163
|
docile (~> 1.1)
|
149
164
|
simplecov-html (~> 0.11)
|
150
165
|
simplecov_json_formatter (~> 0.1)
|
151
|
-
simplecov-html (0.
|
166
|
+
simplecov-html (0.13.1)
|
152
167
|
simplecov_json_formatter (0.1.4)
|
153
|
-
|
154
|
-
|
155
|
-
|
168
|
+
thor (1.3.2)
|
169
|
+
ttfunk (1.8.0)
|
170
|
+
bigdecimal (~> 3.1)
|
156
171
|
tzinfo (2.0.6)
|
157
172
|
concurrent-ruby (~> 1.0)
|
158
|
-
unicode-display_width (1.
|
173
|
+
unicode-display_width (3.1.4)
|
174
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
175
|
+
unicode-emoji (4.0.4)
|
159
176
|
|
160
177
|
PLATFORMS
|
161
178
|
ruby
|
@@ -163,16 +180,16 @@ PLATFORMS
|
|
163
180
|
DEPENDENCIES
|
164
181
|
br_danfe!
|
165
182
|
byebug (= 11.1.3)
|
166
|
-
guard (~> 2.
|
183
|
+
guard (~> 2.19.0)
|
167
184
|
guard-rspec (~> 4.7.3)
|
168
185
|
pdf-inspector (~> 1.3.0)
|
169
186
|
rake (= 13.2.1)
|
170
187
|
rspec (= 3.13.0)
|
171
|
-
rubocop (~>
|
172
|
-
rubocop-performance (~> 1.
|
173
|
-
rubocop-rspec (~>
|
188
|
+
rubocop (~> 1.75.3)
|
189
|
+
rubocop-performance (~> 1.19.0)
|
190
|
+
rubocop-rspec (~> 2.25.0)
|
174
191
|
simplecov (= 0.22.0)
|
175
|
-
simplecov-html (= 0.
|
192
|
+
simplecov-html (= 0.13.1)
|
176
193
|
|
177
194
|
BUNDLED WITH
|
178
195
|
2.5.5
|
data/README.md
CHANGED
@@ -229,18 +229,24 @@ You can generate new data using [4devs generators](http://www.4devs.com.br).
|
|
229
229
|
|
230
230
|
## Deploy to Rubygems
|
231
231
|
|
232
|
-
1.
|
232
|
+
1. To deploy a new version:
|
233
233
|
|
234
|
-
|
234
|
+
* Define the new version at `lib/br_danfe/version.rb`;
|
235
|
+
* Execute `$ bundle`;
|
236
|
+
* Commit all and push to Github;
|
235
237
|
|
236
|
-
2.
|
238
|
+
2. Send the new version to Rubygems
|
239
|
+
|
240
|
+
* $ bundle exec rake release
|
241
|
+
|
242
|
+
3. Create a [new release on Github](https://github.com/asseinfo/br_danfe/releases/new)
|
237
243
|
|
238
244
|
* Choose **the new tag** (Ex.: v0.10.1)
|
239
245
|
* Fill the **Release title** (Ex.: 0.10.1)
|
240
246
|
* Click at **Generate release notes**
|
241
247
|
* Click at **Publish release**
|
242
248
|
|
243
|
-
|
249
|
+
4. Done!
|
244
250
|
|
245
251
|
You can build or install the gem using one of the above tasks
|
246
252
|
|
data/br_danfe.gemspec
CHANGED
@@ -11,7 +11,6 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.license = 'MIT'
|
12
12
|
|
13
13
|
spec.files = `git ls-files`.split("\n")
|
14
|
-
spec.test_files = `git ls-files -- { test,spec,features }/*`.split("\n")
|
15
14
|
spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
16
15
|
spec.require_paths = ['lib']
|
17
16
|
spec.required_ruby_version = '>= 3.0'
|
@@ -20,19 +19,9 @@ Gem::Specification.new do |spec|
|
|
20
19
|
spec.add_dependency 'br_documents', '>= 0.1.3'
|
21
20
|
spec.add_dependency 'i18n', '>= 0.8.6'
|
22
21
|
spec.add_dependency 'nokogiri', '>= 1.8'
|
23
|
-
spec.add_dependency 'prawn', '~> 2.
|
22
|
+
spec.add_dependency 'prawn', '~> 2.5.0'
|
24
23
|
spec.add_dependency 'prawn-table', '0.2.2'
|
25
24
|
spec.add_dependency 'rqrcode', '>= 2.1', '< 2.3'
|
26
25
|
|
27
|
-
spec.
|
28
|
-
spec.add_development_dependency 'guard', '~> 2.18.1'
|
29
|
-
spec.add_development_dependency 'guard-rspec', '~> 4.7.3'
|
30
|
-
spec.add_development_dependency 'pdf-inspector', '~> 1.3.0'
|
31
|
-
spec.add_development_dependency 'rake', '13.2.1'
|
32
|
-
spec.add_development_dependency 'rspec', '3.13.0'
|
33
|
-
spec.add_development_dependency 'rubocop', '~> 0.93.1'
|
34
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.10.2'
|
35
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 1.44.1'
|
36
|
-
spec.add_development_dependency 'simplecov', '0.22.0'
|
37
|
-
spec.add_development_dependency 'simplecov-html', '0.12.3'
|
26
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
38
27
|
end
|
@@ -15,9 +15,9 @@ module BrDanfe
|
|
15
15
|
@document.line_width = 0.3
|
16
16
|
end
|
17
17
|
|
18
|
-
def method_missing(method_name,
|
18
|
+
def method_missing(method_name, ...)
|
19
19
|
if @document.respond_to? method_name
|
20
|
-
@document.send
|
20
|
+
@document.send(method_name, ...)
|
21
21
|
else
|
22
22
|
super
|
23
23
|
end
|
@@ -20,9 +20,9 @@ module BrDanfe
|
|
20
20
|
@document.text ' ', size: font_size
|
21
21
|
end
|
22
22
|
|
23
|
-
def method_missing(method_name,
|
23
|
+
def method_missing(method_name, ...)
|
24
24
|
if @document.respond_to? method_name
|
25
|
-
@document.send
|
25
|
+
@document.send(method_name, ...)
|
26
26
|
else
|
27
27
|
super
|
28
28
|
end
|
@@ -24,7 +24,7 @@ module BrDanfe
|
|
24
24
|
def render_company_info
|
25
25
|
one_line = 1
|
26
26
|
|
27
|
-
@pdf.text_box
|
27
|
+
@pdf.text_box @xml['emit/xNome'].to_s, at: [x_position, @pdf.cursor], height: 36, size: 9, align: :left, style: :bold, overflow: :shrink_to_fit
|
28
28
|
@pdf.move_down 36
|
29
29
|
|
30
30
|
@pdf.text_box cnpj(@xml['emit/CNPJ']), at: [x_position, @pdf.cursor], height: 9, size: 9, align: :left, overflow: :shrink_to_fit
|
@@ -17,9 +17,9 @@ module BrDanfe
|
|
17
17
|
@document.line_width = 0.3
|
18
18
|
end
|
19
19
|
|
20
|
-
def method_missing(method_name,
|
20
|
+
def method_missing(method_name, ...)
|
21
21
|
if @document.respond_to? method_name
|
22
|
-
@document.send
|
22
|
+
@document.send(method_name, ...)
|
23
23
|
else
|
24
24
|
super
|
25
25
|
end
|
@@ -97,12 +97,12 @@ module BrDanfe
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def inumeric(h, w, x, y, i18n = '', data = '', options = {})
|
100
|
-
label = i18n
|
100
|
+
label = i18n == '' ? '' : I18n.t("danfe.#{i18n}")
|
101
101
|
numeric [x.cm, Helper.invert(y.cm)], w.cm, h.cm, label, data, options
|
102
102
|
end
|
103
103
|
|
104
104
|
def i18n_lbox(h, w, x, y, i18n = '', info = '', options = {})
|
105
|
-
label = i18n
|
105
|
+
label = i18n == '' ? '' : I18n.t("danfe.#{i18n}")
|
106
106
|
ibox h, w, x, y, label, info, options
|
107
107
|
end
|
108
108
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BrDanfe
|
2
2
|
class DocumentBuilder
|
3
|
-
def self.build(
|
4
|
-
document = Prawn::Document.new(
|
3
|
+
def self.build(...)
|
4
|
+
document = Prawn::Document.new(...)
|
5
5
|
|
6
6
|
document.font_families['tinos'] = {
|
7
7
|
bold: "#{BrDanfe.root_path}/fonts/tinos_bold.ttf",
|
@@ -10,9 +10,9 @@ module BrDanfe
|
|
10
10
|
@document.font 'tinos'
|
11
11
|
end
|
12
12
|
|
13
|
-
def method_missing(method_name,
|
13
|
+
def method_missing(method_name, ...)
|
14
14
|
if @document.respond_to? method_name
|
15
|
-
@document.send
|
15
|
+
@document.send(method_name, ...)
|
16
16
|
else
|
17
17
|
super
|
18
18
|
end
|
data/lib/br_danfe/version.rb
CHANGED
data/lib/br_danfe.rb
CHANGED
@@ -9,7 +9,7 @@ require 'yaml'
|
|
9
9
|
require 'i18n'
|
10
10
|
require 'br_documents'
|
11
11
|
|
12
|
-
Dir["#{File.dirname(__FILE__)}/**/*.rb"].sort.each { |f| require f }
|
12
|
+
Dir["#{File.dirname(__FILE__)}/**/*.rb"].sort.each { |f| require f } # rubocop:disable Lint/RedundantDirGlobSort
|
13
13
|
|
14
14
|
I18n.load_path << File.expand_path('../config/locales/pt-BR.yml', __dir__)
|
15
15
|
I18n.available_locales = ['pt-BR']
|
data/lib/prawn/font.rb
CHANGED
@@ -7,7 +7,7 @@ describe BrDanfe::CceLib::Document do
|
|
7
7
|
describe '#box' do
|
8
8
|
context "when a block isn't passed" do
|
9
9
|
before do
|
10
|
-
|
10
|
+
FileUtils.rm_f(output_pdf)
|
11
11
|
subject.box(height: 50)
|
12
12
|
end
|
13
13
|
|
@@ -22,7 +22,7 @@ describe BrDanfe::CceLib::Document do
|
|
22
22
|
|
23
23
|
context 'when a block is passed' do
|
24
24
|
before do
|
25
|
-
|
25
|
+
FileUtils.rm_f(output_pdf)
|
26
26
|
subject.box(height: 50) { subject.text 'sample text' }
|
27
27
|
end
|
28
28
|
|
@@ -39,7 +39,7 @@ describe BrDanfe::CceLib::Document do
|
|
39
39
|
describe '#text' do
|
40
40
|
context 'when is a simple text' do
|
41
41
|
before do
|
42
|
-
|
42
|
+
FileUtils.rm_f(output_pdf)
|
43
43
|
subject.text 'simple text'
|
44
44
|
end
|
45
45
|
|
@@ -54,7 +54,7 @@ describe BrDanfe::CceLib::Document do
|
|
54
54
|
|
55
55
|
context 'when is a text with style' do
|
56
56
|
before do
|
57
|
-
|
57
|
+
FileUtils.rm_f(output_pdf)
|
58
58
|
subject.text 'bold text', style: :bold
|
59
59
|
end
|
60
60
|
|
@@ -69,7 +69,7 @@ describe BrDanfe::CceLib::Document do
|
|
69
69
|
|
70
70
|
context 'when is a text with size' do
|
71
71
|
before do
|
72
|
-
|
72
|
+
FileUtils.rm_f(output_pdf)
|
73
73
|
subject.text 'big text', size: 25
|
74
74
|
end
|
75
75
|
|
@@ -84,7 +84,7 @@ describe BrDanfe::CceLib::Document do
|
|
84
84
|
|
85
85
|
context 'when is a text with pad' do
|
86
86
|
before do
|
87
|
-
|
87
|
+
FileUtils.rm_f(output_pdf)
|
88
88
|
subject.text 'text with pad', pad: 50
|
89
89
|
end
|
90
90
|
|
@@ -99,7 +99,7 @@ describe BrDanfe::CceLib::Document do
|
|
99
99
|
|
100
100
|
context 'when is a text with align' do
|
101
101
|
before do
|
102
|
-
|
102
|
+
FileUtils.rm_f(output_pdf)
|
103
103
|
subject.text 'text in center', align: :center
|
104
104
|
end
|
105
105
|
|
data/spec/br_danfe/cce_spec.rb
CHANGED
@@ -8,14 +8,14 @@ describe BrDanfe::Cce do
|
|
8
8
|
|
9
9
|
describe '#render_pdf' do
|
10
10
|
it 'renders the correction letter' do
|
11
|
-
expected =
|
11
|
+
expected = File.binread("#{base_dir}cce.fixture.pdf")
|
12
12
|
|
13
13
|
expect(subject.render_pdf).to eq expected
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#save_pdf' do
|
18
|
-
before {
|
18
|
+
before { FileUtils.rm_f(output_pdf) }
|
19
19
|
|
20
20
|
it 'saves the pdf' do
|
21
21
|
expect(File.exist?(output_pdf)).to be_falsey
|
@@ -6,7 +6,7 @@ describe BrDanfe::DanfeLib::NfceLib::ProductList do
|
|
6
6
|
|
7
7
|
let(:subject) { BrDanfe::DanfeLib::NfceLib::Document.new(8.cm, 1.8.cm) }
|
8
8
|
|
9
|
-
before {
|
9
|
+
before { FileUtils.rm_f(output_pdf) }
|
10
10
|
|
11
11
|
it 'render the document with blank lines' do
|
12
12
|
expect(File.exist?(output_pdf)).to be_falsey
|
@@ -27,7 +27,7 @@ describe BrDanfe::DanfeLib::NfceLib::Footer do
|
|
27
27
|
subject { described_class.new pdf, xml_footer }
|
28
28
|
|
29
29
|
describe '#render' do
|
30
|
-
before {
|
30
|
+
before { FileUtils.rm_f(output_pdf) }
|
31
31
|
|
32
32
|
it 'renders footer to the pdf' do
|
33
33
|
subject.render
|
@@ -49,10 +49,10 @@ describe BrDanfe::DanfeLib::NfceLib::Header do
|
|
49
49
|
describe '#render' do
|
50
50
|
before do
|
51
51
|
subject.render
|
52
|
-
|
52
|
+
FileUtils.rm_f(output_pdf)
|
53
53
|
end
|
54
54
|
|
55
|
-
after {
|
55
|
+
after { FileUtils.rm_f(output_pdf) }
|
56
56
|
|
57
57
|
context 'when has a short name' do
|
58
58
|
let(:company_name) { 'Test company' }
|