prawn-qrcode 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prawn/qrcode.rb +6 -3
- data/lib/prawn/qrcode/version.rb +1 -1
- data/prawn-qrcode.gemspec +1 -1
- data/test/test_qrcode_in_context.rb +8 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3587fc7dbd82b33c463d766acd6d5d66615c6fc4b8366c9bd454dd0e2bc19de3
|
4
|
+
data.tar.gz: b2ef597a09d3f33060ed1cc329f8feebf52f22d35882760acf2f9cada65cc47b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e64c1e7436259d33b6dd0949693946fbc785b114169c0cb8412f180ae99fc2bb742f58db46ee7b202e4ef534c074b192d858609c0da048dbaba6a8ba5d65b637
|
7
|
+
data.tar.gz: 0147b627f63876d455cf7e683c8efee880ab018a1c28db9740df7ace419aabc56502030d58992d1fd23d72e2b44d75bb0a18997d51b038f1664a5dc2e4a95ff5
|
data/lib/prawn/qrcode.rb
CHANGED
@@ -166,11 +166,11 @@ module Prawn
|
|
166
166
|
rlim = bounding_box.right
|
167
167
|
case @align
|
168
168
|
when :center
|
169
|
-
@
|
169
|
+
@pos[0] = (rlim / 2) - (extent / 2)
|
170
170
|
when :right
|
171
|
-
@
|
171
|
+
@pos[0] = rlim - extent
|
172
172
|
when :left
|
173
|
-
@
|
173
|
+
@pos[0] = 0
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
@@ -178,6 +178,9 @@ module Prawn
|
|
178
178
|
def render(pdf)
|
179
179
|
pdf.fill_color background_color
|
180
180
|
|
181
|
+
pos(pdf) # make sure the @pos attribute is set before calling align
|
182
|
+
align(pdf.bounds)
|
183
|
+
|
181
184
|
pdf.bounding_box(pos(pdf), width: extent, height: extent) do |_box|
|
182
185
|
pdf.fill_color foreground_color
|
183
186
|
margin_dist = margin * dot
|
data/lib/prawn/qrcode/version.rb
CHANGED
data/prawn-qrcode.gemspec
CHANGED
@@ -46,5 +46,5 @@ END_DESC
|
|
46
46
|
spec.add_development_dependency 'minitest', '~> 5.12', '>= 5.12.2'
|
47
47
|
spec.add_development_dependency 'prawn-table', '~> 0.2.2'
|
48
48
|
spec.add_development_dependency 'rake', '~> 13.0'
|
49
|
-
spec.add_development_dependency 'rubocop', '~>0.
|
49
|
+
spec.add_development_dependency 'rubocop', '~> 0.85.1'
|
50
50
|
end
|
@@ -7,4 +7,12 @@ class TestQrcodeInContext < Minitest::Test
|
|
7
7
|
context = Prawn::Document.new
|
8
8
|
assert(context.print_qr_code('HELOWORLD', margin: 0))
|
9
9
|
end
|
10
|
+
def test_render_with_alignment
|
11
|
+
context = Prawn::Document.new
|
12
|
+
left = context.print_qr_code('HELLOWORLD', align: :left)
|
13
|
+
center = context.print_qr_code('HELLOWORLD', align: :center)
|
14
|
+
right = context.print_qr_code('HELLOWORLD', align: :right)
|
15
|
+
assert(left.anchor[0] < center.anchor[0])
|
16
|
+
assert(center.anchor[0] < right.anchor[0])
|
17
|
+
end
|
10
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prawn-qrcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Hausherr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prawn
|
@@ -106,14 +106,14 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.
|
109
|
+
version: 0.85.1
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: 0.
|
116
|
+
version: 0.85.1
|
117
117
|
description: " Prawn/QRCode simplifies the generation and rendering of QRCodes in
|
118
118
|
Prawn PDF documents.\n"
|
119
119
|
email:
|
@@ -162,7 +162,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: 1.3.6
|
164
164
|
requirements: []
|
165
|
-
|
165
|
+
rubyforge_project:
|
166
|
+
rubygems_version: 2.7.7
|
166
167
|
signing_key:
|
167
168
|
specification_version: 4
|
168
169
|
summary: Print QR Codes in PDF
|