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: a9e2604496096165edb58b91671f58accaa0eee4
4
- data.tar.gz: cf9fc31220a07ed595d3de485a061c770b239311
3
+ metadata.gz: 4de582b25c3e82f9ef2a9e09d82f8452b5e38731
4
+ data.tar.gz: cdb47ae804a47dc61eb6050cb81a9eeea6a6b054
5
5
  SHA512:
6
- metadata.gz: 80f8449bf59b9453d0c018f31220f2a7c48d6cb1261219ef3de480e04e48ed88cccad1205bdeacea179db645362a67ebe2aa604ec349a54acf9dbe2b5faec2d9
7
- data.tar.gz: 9ff89893486470aa2fd2f381f53df570fabee337ee313a97419f40ab5a7348eb00d8607f6be4fb3f4e326c86753f1fdb38b6a3cedb7a728997507294b78e66c8
6
+ metadata.gz: da7ad859b39236776cd712819315630dbbb3ef08e79285ea14efd268c796e16f10139887de6cc4c9bbcf0af5a115e2a8c01e0ee4adc5e39ae6df571906034eca
7
+ data.tar.gz: 6b217f1405987333aa0f6ce14716c81eb02c78ffaa2a752d57533c733c432c0b310ac32402edc4437a2a4f04f70b8fe15c02c8926a25c2983fb289612ad4a629
data/.rubocop.yml CHANGED
@@ -27,3 +27,7 @@ Lint/AmbiguousBlockAssociation:
27
27
  Metrics/BlockLength:
28
28
  Exclude:
29
29
  - 'spec/**/*.rb'
30
+
31
+ Style/PercentLiteralDelimiters:
32
+ PreferredDelimiters:
33
+ '%i': '()'
@@ -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[public_place number complement neighborhood city state].map(&address.method(:[]))
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, generate_barcode_one(access_key), options)
75
- insert_image(pdf, generate_barcode_two(access_key), options)
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 generate_barcode_one(access_key)
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 :generate_barcode_one
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
  {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: br_invoices_pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.alpha.12
4
+ version: 0.2.0.alpha.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Ribeiro