check_writer 0.4.7 → 0.4.8
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.
- data/VERSION +1 -1
- data/check_writer.gemspec +2 -2
- data/lib/check_writer/check.rb +5 -5
- data/spec/assets/blank-0.12.0.pdf +14 -14
- data/spec/assets/test-0.12.0.pdf +0 -0
- data/spec/assets/two_in_one-0.12.0.pdf +0 -0
- data/spec/assets/with_second_signature_line-0.12.0.pdf +0 -0
- data/spec/assets/with_signature_image-0.12.0.pdf +0 -0
- data/spec/assets/with_stub_table_data-0.12.0.pdf +25 -25
- data/spec/assets/with_stubs-0.12.0.pdf +0 -0
- data/spec/assets/with_two_thirds_stub-0.12.0.pdf +0 -0
- data/spec/check_spec.rb +3 -3
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.8
|
data/check_writer.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "check_writer"
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ryan Winograd"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2015-08-03"
|
13
13
|
s.description = "Ruby library for generating PDF checks that you can take to the bank"
|
14
14
|
s.email = "ryan@thewinograds.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/check_writer/check.rb
CHANGED
@@ -120,15 +120,15 @@ module CheckWriter
|
|
120
120
|
# Payor and payee names
|
121
121
|
@pdf.move_to [@pdf.bounds.left, inches(0.5)]
|
122
122
|
@pdf.line_to [@pdf.bounds.right, inches(0.5)]
|
123
|
-
@pdf.bounding_box [@pdf.bounds.left + 8, inches(0.5) - 6], :width => inches(6.
|
123
|
+
@pdf.bounding_box [@pdf.bounds.left + 8, inches(0.5) - 6], :width => inches(6.5) do
|
124
124
|
@pdf.text "Payor: #{payor_name}"
|
125
125
|
@pdf.text "Payee: #{payee_name}"
|
126
126
|
end
|
127
127
|
|
128
128
|
# Amount
|
129
|
-
@pdf.move_to [@pdf.bounds.right - inches(2), inches(0.5)]
|
130
|
-
@pdf.line_to [@pdf.bounds.right - inches(2), 0]
|
131
|
-
@pdf.bounding_box [@pdf.bounds.left + inches(5.
|
129
|
+
@pdf.move_to [@pdf.bounds.right - inches(2.25), inches(0.5)]
|
130
|
+
@pdf.line_to [@pdf.bounds.right - inches(2.25), 0]
|
131
|
+
@pdf.bounding_box [@pdf.bounds.left + inches(5.25), inches(0.5) - 6], :width => inches(1.25), :height => inches(0.5) do
|
132
132
|
@pdf.text "Amount", :align => :center
|
133
133
|
@pdf.text formatted_amount, :align => :center
|
134
134
|
end
|
@@ -171,7 +171,7 @@ module CheckWriter
|
|
171
171
|
@pdf.bounding_box [@pdf.bounds.left + inches(4.5), @pdf.bounds.top - inches(1.25)], :width => inches(1) do
|
172
172
|
@pdf.text formatted_date
|
173
173
|
end
|
174
|
-
@pdf.bounding_box [@pdf.bounds.right - inches(
|
174
|
+
@pdf.bounding_box [@pdf.bounds.right - inches(2) - 4, @pdf.bounds.top - inches(1.25)], :width => inches(2) do
|
175
175
|
@pdf.text "<b>#{formatted_amount}</b>", :align => :right, :inline_format => true
|
176
176
|
end
|
177
177
|
@pdf.text_box "#{amount_in_words}#{" -"*72}", :at => [@pdf.bounds.left + 4, @pdf.bounds.top - inches(1.5)], :height => inches(0.2)
|
@@ -17,7 +17,7 @@ endobj
|
|
17
17
|
>>
|
18
18
|
endobj
|
19
19
|
4 0 obj
|
20
|
-
<< /Length
|
20
|
+
<< /Length 1668
|
21
21
|
>>
|
22
22
|
stream
|
23
23
|
q
|
@@ -46,20 +46,20 @@ BT
|
|
46
46
|
[<50> 40 <61> 30 <79> 20 <65653a204a6f686e20536d69746820776974682061205265616c6c79205265616c6c79> 100 <2c205265616c6c79205265616c6c79204c6f6e67204e616d65>] TJ
|
47
47
|
ET
|
48
48
|
|
49
|
-
|
50
|
-
|
49
|
+
414.000 576.000 m
|
50
|
+
414.000 540.000 l
|
51
51
|
|
52
52
|
BT
|
53
|
-
|
53
|
+
438.324 561.384 Td
|
54
54
|
/F1.0 12 Tf
|
55
55
|
[<416d6f756e74>] TJ
|
56
56
|
ET
|
57
57
|
|
58
58
|
|
59
59
|
BT
|
60
|
-
|
60
|
+
420.63599999999997 547.512 Td
|
61
61
|
/F1.0 12 Tf
|
62
|
-
[<
|
62
|
+
[<24312c3030302c3030332e3233>] TJ
|
63
63
|
ET
|
64
64
|
|
65
65
|
504.000 576.000 m
|
@@ -103,20 +103,20 @@ BT
|
|
103
103
|
[<50> 40 <61> 30 <79> 20 <65653a204a6f686e20536d69746820776974682061205265616c6c79205265616c6c79> 100 <2c205265616c6c79205265616c6c79204c6f6e67204e616d65>] TJ
|
104
104
|
ET
|
105
105
|
|
106
|
-
|
107
|
-
|
106
|
+
414.000 342.000 m
|
107
|
+
414.000 306.000 l
|
108
108
|
|
109
109
|
BT
|
110
|
-
|
110
|
+
438.324 327.384 Td
|
111
111
|
/F1.0 12 Tf
|
112
112
|
[<416d6f756e74>] TJ
|
113
113
|
ET
|
114
114
|
|
115
115
|
|
116
116
|
BT
|
117
|
-
|
117
|
+
420.63599999999997 313.512 Td
|
118
118
|
/F1.0 12 Tf
|
119
|
-
[<
|
119
|
+
[<24312c3030302c3030332e3233>] TJ
|
120
120
|
ET
|
121
121
|
|
122
122
|
504.000 342.000 m
|
@@ -165,13 +165,13 @@ xref
|
|
165
165
|
0000000109 00000 n
|
166
166
|
0000000158 00000 n
|
167
167
|
0000000215 00000 n
|
168
|
-
|
169
|
-
|
168
|
+
0000001935 00000 n
|
169
|
+
0000002113 00000 n
|
170
170
|
trailer
|
171
171
|
<< /Size 7
|
172
172
|
/Root 2 0 R
|
173
173
|
/Info 1 0 R
|
174
174
|
>>
|
175
175
|
startxref
|
176
|
-
|
176
|
+
2210
|
177
177
|
%%EOF
|
data/spec/assets/test-0.12.0.pdf
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -17,7 +17,7 @@ endobj
|
|
17
17
|
>>
|
18
18
|
endobj
|
19
19
|
4 0 obj
|
20
|
-
<< /Length
|
20
|
+
<< /Length 19332
|
21
21
|
>>
|
22
22
|
stream
|
23
23
|
q
|
@@ -636,20 +636,20 @@ BT
|
|
636
636
|
[<50> 40 <61> 30 <79> 20 <65653a204a6f686e20536d69746820776974682061205265616c6c79205265616c6c79> 100 <2c205265616c6c79205265616c6c79204c6f6e67204e616d65>] TJ
|
637
637
|
ET
|
638
638
|
|
639
|
-
|
640
|
-
|
639
|
+
414.000 576.000 m
|
640
|
+
414.000 540.000 l
|
641
641
|
|
642
642
|
BT
|
643
|
-
|
643
|
+
438.324 561.384 Td
|
644
644
|
/F1.0 12 Tf
|
645
645
|
[<416d6f756e74>] TJ
|
646
646
|
ET
|
647
647
|
|
648
648
|
|
649
649
|
BT
|
650
|
-
|
650
|
+
420.63599999999997 547.512 Td
|
651
651
|
/F1.0 12 Tf
|
652
|
-
[<
|
652
|
+
[<24312c3030302c3030332e3233>] TJ
|
653
653
|
ET
|
654
654
|
|
655
655
|
504.000 576.000 m
|
@@ -1281,20 +1281,20 @@ BT
|
|
1281
1281
|
[<50> 40 <61> 30 <79> 20 <65653a204a6f686e20536d69746820776974682061205265616c6c79205265616c6c79> 100 <2c205265616c6c79205265616c6c79204c6f6e67204e616d65>] TJ
|
1282
1282
|
ET
|
1283
1283
|
|
1284
|
-
|
1285
|
-
|
1284
|
+
414.000 342.000 m
|
1285
|
+
414.000 306.000 l
|
1286
1286
|
|
1287
1287
|
BT
|
1288
|
-
|
1288
|
+
438.324 327.384 Td
|
1289
1289
|
/F1.0 12 Tf
|
1290
1290
|
[<416d6f756e74>] TJ
|
1291
1291
|
ET
|
1292
1292
|
|
1293
1293
|
|
1294
1294
|
BT
|
1295
|
-
|
1295
|
+
420.63599999999997 313.512 Td
|
1296
1296
|
/F1.0 12 Tf
|
1297
|
-
[<
|
1297
|
+
[<24312c3030302c3030332e3233>] TJ
|
1298
1298
|
ET
|
1299
1299
|
|
1300
1300
|
504.000 342.000 m
|
@@ -1378,16 +1378,16 @@ ET
|
|
1378
1378
|
|
1379
1379
|
|
1380
1380
|
BT
|
1381
|
-
|
1381
|
+
495.272 153.38400000000001 Td
|
1382
1382
|
/F2.0 12 Tf
|
1383
|
-
[<
|
1383
|
+
[<24312c3030302c3030332e3233>] TJ
|
1384
1384
|
ET
|
1385
1385
|
|
1386
1386
|
|
1387
1387
|
BT
|
1388
1388
|
40 135.38400000000001 Td
|
1389
1389
|
/F1.0 12 Tf
|
1390
|
-
[<
|
1390
|
+
[<4f6e65204d696c6c696f6e20416e6420546872656520446f6c6c61727320416e642054> 120 <77> 10 <656e74792054687265652043656e7473202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d202d>] TJ
|
1391
1391
|
ET
|
1392
1392
|
|
1393
1393
|
|
@@ -1429,9 +1429,9 @@ ET
|
|
1429
1429
|
576.000 50.400 l
|
1430
1430
|
|
1431
1431
|
BT
|
1432
|
-
|
1432
|
+
421.76 42.656 Td
|
1433
1433
|
/F1.0 8 Tf
|
1434
|
-
[<4e4f> 40 <542056> 80 <414c4944204946204f> 50 <
|
1434
|
+
[<4e4f> 40 <542056> 80 <414c4944204946204f> 50 <5645522024312c3030302c3030332e3233>] TJ
|
1435
1435
|
ET
|
1436
1436
|
|
1437
1437
|
|
@@ -1531,19 +1531,19 @@ xref
|
|
1531
1531
|
0000000109 00000 n
|
1532
1532
|
0000000158 00000 n
|
1533
1533
|
0000000215 00000 n
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1534
|
+
0000019600 00000 n
|
1535
|
+
0000019802 00000 n
|
1536
|
+
0000019899 00000 n
|
1537
|
+
0000020001 00000 n
|
1538
|
+
0000020163 00000 n
|
1539
|
+
0000021636 00000 n
|
1540
|
+
0000021877 00000 n
|
1541
|
+
0000023237 00000 n
|
1542
1542
|
trailer
|
1543
1543
|
<< /Size 13
|
1544
1544
|
/Root 2 0 R
|
1545
1545
|
/Info 1 0 R
|
1546
1546
|
>>
|
1547
1547
|
startxref
|
1548
|
-
|
1548
|
+
24151
|
1549
1549
|
%%EOF
|
Binary file
|
Binary file
|
data/spec/check_spec.rb
CHANGED
@@ -28,18 +28,18 @@ describe "CheckWriter::Check" do
|
|
28
28
|
:bank_fraction => '12-9876/1234',
|
29
29
|
:routing_number => '123456768',
|
30
30
|
:account_number => '123456789',
|
31
|
-
:amount => '
|
31
|
+
:amount => '1000003.23',
|
32
32
|
:memo => 'Memo: Void after 60 days'
|
33
33
|
)
|
34
34
|
end
|
35
35
|
|
36
36
|
it "knows how many dollars and cents" do
|
37
|
-
@check.dollars.should ==
|
37
|
+
@check.dollars.should == 1_000_003
|
38
38
|
@check.cents.should == 23
|
39
39
|
end
|
40
40
|
|
41
41
|
it "can format the amount as currency" do
|
42
|
-
@check.formatted_amount.should == "$1,003.23"
|
42
|
+
@check.formatted_amount.should == "$1,000,003.23"
|
43
43
|
end
|
44
44
|
|
45
45
|
context "a check for an amount with 0 cents" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: check_writer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -203,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
segments:
|
205
205
|
- 0
|
206
|
-
hash:
|
206
|
+
hash: -503875284365167166
|
207
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
208
|
none: false
|
209
209
|
requirements:
|