br_invoices_pdf 0.2.0.alpha.12 → 0.2.0.alpha.13
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4de582b25c3e82f9ef2a9e09d82f8452b5e38731
|
4
|
+
data.tar.gz: cdb47ae804a47dc61eb6050cb81a9eeea6a6b054
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da7ad859b39236776cd712819315630dbbb3ef08e79285ea14efd268c796e16f10139887de6cc4c9bbcf0af5a115e2a8c01e0ee4adc5e39ae6df571906034eca
|
7
|
+
data.tar.gz: 6b217f1405987333aa0f6ce14716c81eb02c78ffaa2a752d57533c733c432c0b310ac32402edc4437a2a4f04f70b8fe15c02c8926a25c2983fb289612ad4a629
|
data/.rubocop.yml
CHANGED
@@ -6,7 +6,7 @@ module BrInvoicesPdf
|
|
6
6
|
|
7
7
|
ADDRESS_FORMAT = '%s, %s, %s, %s, %s/%s'.freeze
|
8
8
|
def format_address(address)
|
9
|
-
ADDRESS_FORMAT % %i
|
9
|
+
ADDRESS_FORMAT % %i(public_place number complement neighborhood city state).map(&address.method(:[]))
|
10
10
|
end
|
11
11
|
|
12
12
|
def box(pdf, position, width)
|
@@ -71,8 +71,8 @@ module BrInvoicesPdf
|
|
71
71
|
def generate_barcodes(pdf, pdf_options)
|
72
72
|
options = barcode_options(pdf, pdf_options[:page_width], pdf_options[:barcodes_size])
|
73
73
|
access_key = pdf_options[:access_key]
|
74
|
-
insert_image(pdf,
|
75
|
-
insert_image(pdf,
|
74
|
+
insert_image(pdf, generate_barcode(access_key[0..21]), options)
|
75
|
+
insert_image(pdf, generate_barcode(access_key[22..44]), options)
|
76
76
|
end
|
77
77
|
private_class_method :generate_barcodes
|
78
78
|
|
@@ -82,19 +82,11 @@ module BrInvoicesPdf
|
|
82
82
|
end
|
83
83
|
private_class_method :insert_image
|
84
84
|
|
85
|
-
def
|
86
|
-
key = access_key[0..21]
|
85
|
+
def generate_barcode(key)
|
87
86
|
blob = Barby::PngOutputter.new(Barby::Code128A.new(key)).to_png
|
88
87
|
StringIO.new(blob)
|
89
88
|
end
|
90
|
-
private_class_method :
|
91
|
-
|
92
|
-
def generate_barcode_two(access_key)
|
93
|
-
key = access_key[22..44]
|
94
|
-
blob = Barby::PngOutputter.new(Barby::Code128A.new(key)).to_png
|
95
|
-
StringIO.new(blob)
|
96
|
-
end
|
97
|
-
private_class_method :generate_barcode_two
|
89
|
+
private_class_method :generate_barcode
|
98
90
|
|
99
91
|
def barcode_options(pdf, page_width, qrcode_size)
|
100
92
|
{
|