check_writer 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. data/Gemfile +2 -4
  2. data/Gemfile.lock +17 -17
  3. data/README.rdoc +7 -10
  4. data/Rakefile +0 -1
  5. data/VERSION +1 -1
  6. data/check_writer.gemspec +11 -33
  7. data/lib/check_writer/attribute_formatting.rb +3 -1
  8. data/lib/check_writer/check.rb +51 -25
  9. data/spec/assets/blank-0.12.0.pdf +177 -0
  10. data/spec/assets/two_in_one-0.12.0.pdf +0 -0
  11. data/spec/assets/void-0.12.0.pdf +0 -0
  12. data/spec/assets/with_second_signature_line-0.12.0.pdf +0 -0
  13. data/spec/assets/with_signature_image-0.12.0.pdf +0 -0
  14. data/spec/assets/with_stub_table_data-0.12.0.pdf +23 -24
  15. data/spec/assets/with_stubs-0.12.0.pdf +0 -0
  16. data/spec/assets/with_two_thirds_stub-0.12.0.pdf +0 -0
  17. data/spec/check_spec.rb +53 -2
  18. data/spec/spec_helper.rb +1 -1
  19. metadata +24 -62
  20. data/Appraisals +0 -11
  21. data/gemfiles/prawn0.12.0.gemfile +0 -14
  22. data/gemfiles/prawn0.12.0.gemfile.lock +0 -54
  23. data/gemfiles/prawn0.6.1.gemfile +0 -14
  24. data/gemfiles/prawn0.6.1.gemfile.lock +0 -55
  25. data/gemfiles/prawn0.6.3.gemfile +0 -14
  26. data/gemfiles/prawn0.6.3.gemfile.lock +0 -55
  27. data/spec/assets/test-0.6.1.pdf +0 -0
  28. data/spec/assets/test-0.6.3.pdf +0 -0
  29. data/spec/assets/two_in_one-0.6.1.pdf +0 -0
  30. data/spec/assets/two_in_one-0.6.3.pdf +0 -0
  31. data/spec/assets/with_second_signature_line-0.6.1.pdf +0 -0
  32. data/spec/assets/with_second_signature_line-0.6.3.pdf +0 -0
  33. data/spec/assets/with_signature_image-0.6.1.pdf +0 -0
  34. data/spec/assets/with_signature_image-0.6.3.pdf +0 -0
  35. data/spec/assets/with_stub_table_data-0.6.1.pdf +0 -939
  36. data/spec/assets/with_stub_table_data-0.6.3.pdf +0 -939
  37. data/spec/assets/with_stubs-0.6.1.pdf +0 -0
  38. data/spec/assets/with_stubs-0.6.3.pdf +0 -0
Binary file
Binary file
@@ -17,7 +17,7 @@ endobj
17
17
  >>
18
18
  endobj
19
19
  4 0 obj
20
- << /Length 19025
20
+ << /Length 18965
21
21
  >>
22
22
  stream
23
23
  q
@@ -254,7 +254,7 @@ S
254
254
  0.000 0.000 0.000 SCN
255
255
 
256
256
  BT
257
- 504.9489156251217 703.756 Td
257
+ 530.648 703.756 Td
258
258
  /F1.0 12 Tf
259
259
  [<416d6f756e74>] TJ
260
260
  ET
@@ -434,7 +434,7 @@ S
434
434
  0.000 0.000 0.000 SCN
435
435
 
436
436
  BT
437
- 504.9489156251217 679.884 Td
437
+ 518.624 679.884 Td
438
438
  /F1.0 12 Tf
439
439
  [<24312c3030302e3030>] TJ
440
440
  ET
@@ -614,7 +614,7 @@ S
614
614
  0.000 0.000 0.000 SCN
615
615
 
616
616
  BT
617
- 504.9489156251217 656.012 Td
617
+ 518.624 656.012 Td
618
618
  /F1.0 12 Tf
619
619
  [<24312c3030302e3030>] TJ
620
620
  ET
@@ -899,7 +899,7 @@ S
899
899
  0.000 0.000 0.000 SCN
900
900
 
901
901
  BT
902
- 504.9489156251217 469.75600000000003 Td
902
+ 530.648 469.75600000000003 Td
903
903
  /F1.0 12 Tf
904
904
  [<416d6f756e74>] TJ
905
905
  ET
@@ -1079,7 +1079,7 @@ S
1079
1079
  0.000 0.000 0.000 SCN
1080
1080
 
1081
1081
  BT
1082
- 504.9489156251217 445.884 Td
1082
+ 518.624 445.884 Td
1083
1083
  /F1.0 12 Tf
1084
1084
  [<24312c3030302e3030>] TJ
1085
1085
  ET
@@ -1259,7 +1259,7 @@ S
1259
1259
  0.000 0.000 0.000 SCN
1260
1260
 
1261
1261
  BT
1262
- 504.9489156251217 422.012 Td
1262
+ 518.624 422.012 Td
1263
1263
  /F1.0 12 Tf
1264
1264
  [<24312c3030302e3030>] TJ
1265
1265
  ET
@@ -1467,7 +1467,7 @@ endobj
1467
1467
  endobj
1468
1468
  7 0 obj
1469
1469
  << /Type /Font
1470
- /BaseFont /AAAAAC+GnuMICR
1470
+ /BaseFont /AAAAAF+GnuMICR
1471
1471
  /Subtype /TrueType
1472
1472
  /FontDescriptor 9 0 R
1473
1473
  /FirstChar 32
@@ -1477,22 +1477,21 @@ endobj
1477
1477
  >>
1478
1478
  endobj
1479
1479
  8 0 obj
1480
- << /Length 1385
1480
+ << /Length 1386
1481
1481
  /Length1 3728
1482
1482
  /Filter /FlateDecode
1483
1483
  >>
1484
1484
  stream
1485
- x��V]hU��L���MӴi�l��M�&��l�����K!]���l6�?��iDDP}iR�P�A,V̓H�R�˾��EE�z����l�/�3��s���o�s�̂ �f�x1г-LO�=�]J�}s�k��|oe �x˗�82A��tr��@��_%�h:mś�k�/��?�X�;l��/��/_822z�����
1486
- Fph"<�Y{��N~hz@�~�}���B��c|�-d��ԃ5 ����oi
1487
- Hi{q/��b8�s�hNJ��"W����rZMw��v[:�-��M��v��{p㽠�����d�޽�.9��1g��ί- ��$5��ƀ�������v�M���Ħ0=/X��+��X��
1488
- H p8<L���*e�B<�`Yy>^Vp*_�e� ��VT��Y+k����R��+iW�R�� I��W�Lu>K)�3 +_�����b�҅
1489
- �����ۡ�>����,�v���7����`6V(��Yw��&i�"�)c�R�i<Q�f�Q���6Bg]��d|j!SP����Y��p$"�ǿQ�<�T�LE
1490
- ��j%��f1�9�T��Vm(��_��a��z#L��~�F���G0��"�����1 ����b�[�lx>
1485
+ x��V]hU��L��Y��i��nS��Od��mR4R�RH�4�� �����cZ�b_"��"EĂ`A�<��!P,���K^Zl�����Mb}Ep��{ιߜ��w�Y0ADЊR2�(�m�P�s�mN�.����-����s�d"�u0&ӗ�W/�������3+�z�X"��{�K%�������󇆧�?!�� �b��a���+$�V���7��-��n����i`�4?B?��@��<Xs0[Z}�@[P�ωL�郱s�XW��0�ܵ�qvxt$6<:B�!f^d�/�ή�itwu0v������ڮ̸kh'���԰_���� �\��P��TH�����!�z:��d�ۣX��2�-���*Uw;jm���QWD3�|��25�1�ȑ�8�Ͳ�'�ٲ�}���&����C���3��yG�ltN��l���H����j���k��i�-��o�x�U��NuuDb;���w^yn6G�W_S�q�T]��P� �1����IML�9�������K�S}y�͛�FI�5�jw q��.�t��� 6����|
1486
+ jn�
1487
+ G(8 -����Hk�p�\z 1�ֹW�['%�U�k��ko9-ٺ;A@;�-��{܃��s�p�=��^�����f1�^`W�옳MunW�$57c/F�Ѧ�����u�M{{v�Maz^����<۱����Е����)��j~5��16��W����bM������G�}��hy�G���|��q��,��%����<��������I���1�l9��'�zu']�����H;�G�^B`�/�����^0O'�U�Qf4e3��tjr��p|f�6�wШD��-��G��ׅn��[����v�a�����z,�����`-m"ήk �F��0���#�_h��
1488
+ ��Uce �|6Y��~�`U�Ü�X9+Qfy��e^�Xj��^LI�t�Ƨksr*��
1489
+ k���ͅ)]XN�����8C�̐lgϜ����<�ŋ�|"�P���D8+e�R�����<*��Fl<�JL�f�<��c\� +�F���7���G U�P���Z a�Y���U�d�N6�D���/��Ԁ]K��~���I����'0�G"��ҍ��1(����߭�$>
1491
1490
  endstream
1492
1491
  endobj
1493
1492
  9 0 obj
1494
1493
  << /Type /FontDescriptor
1495
- /FontName /AAAAAC+GnuMICR
1494
+ /FontName /AAAAAF+GnuMICR
1496
1495
  /FontFile2 8 0 R
1497
1496
  /FontBBox [10 0 720 702]
1498
1497
  /Flags 4
@@ -1524,18 +1523,18 @@ xref
1524
1523
  0000000109 00000 n
1525
1524
  0000000158 00000 n
1526
1525
  0000000215 00000 n
1527
- 0000019293 00000 n
1528
- 0000019483 00000 n
1529
- 0000019580 00000 n
1530
- 0000019741 00000 n
1531
- 0000021213 00000 n
1532
- 0000021453 00000 n
1533
- 0000022813 00000 n
1526
+ 0000019233 00000 n
1527
+ 0000019423 00000 n
1528
+ 0000019520 00000 n
1529
+ 0000019681 00000 n
1530
+ 0000021154 00000 n
1531
+ 0000021394 00000 n
1532
+ 0000022754 00000 n
1534
1533
  trailer
1535
1534
  << /Size 12
1536
1535
  /Root 2 0 R
1537
1536
  /Info 1 0 R
1538
1537
  >>
1539
1538
  startxref
1540
- 23727
1539
+ 23668
1541
1540
  %%EOF
Binary file
data/spec/check_spec.rb CHANGED
@@ -64,6 +64,20 @@ describe "CheckWriter::Check" do
64
64
  assert_data_matches_file_content('test', data)
65
65
  end
66
66
 
67
+ context "void" do
68
+ before(:each) do
69
+ @check.void = true
70
+ @data = @check.to_pdf
71
+ end
72
+
73
+ it "generates a pdf with VOID on the check stub" do
74
+ # Use this line to re-write the PDF we test against
75
+ # write_content_to_file('void', @data)
76
+
77
+ assert_data_matches_file_content('void', @data)
78
+ end
79
+ end
80
+
67
81
  context "with stubs" do
68
82
  before(:each) do
69
83
  @check.with_stubs = true
@@ -76,6 +90,40 @@ describe "CheckWriter::Check" do
76
90
 
77
91
  assert_data_matches_file_content('with_stubs', @data)
78
92
  end
93
+
94
+ context "blank" do
95
+ before(:each) do
96
+ @check.blank = true
97
+ @data = @check.to_pdf
98
+ end
99
+
100
+ it "generates a pdf with VOID on the check stub" do
101
+ # Use this line to re-write the PDF we test against
102
+ # write_content_to_file('blank', @data)
103
+
104
+ assert_data_matches_file_content('blank', @data)
105
+ end
106
+ end
107
+ end
108
+
109
+ it "raises exception when stub_format invalid" do
110
+ expect { @check.stub_format = :wrong }.to raise_error
111
+ expect { @check.stub_format = :two_thirds }.to_not raise_error
112
+ end
113
+
114
+ context "with two-thirds stub" do
115
+ before(:each) do
116
+ @check.stub_format = :two_thirds
117
+ @check.with_stubs = true
118
+ @data = @check.to_pdf
119
+ end
120
+
121
+ it "generates a pdf with check stubs stroked and some basic info" do
122
+ # Use this line to re-write the PDF we test against
123
+ # write_content_to_file('with_two_thirds_stub', @data)
124
+
125
+ assert_data_matches_file_content('with_two_thirds_stub', @data)
126
+ end
79
127
  end
80
128
 
81
129
  context "with stub table data" do
@@ -87,6 +135,9 @@ describe "CheckWriter::Check" do
87
135
  ]
88
136
  @check.stub_table_data = @stub_table_data
89
137
  @check.stub_table_options = {:row_colors => ['ff0000', 'ffffff']}
138
+ @check.stub_table_lambda = lambda { |t|
139
+ t.cells.column(5).align = :right
140
+ }
90
141
  @check.with_stubs = true
91
142
  @data = @check.to_pdf
92
143
  end
@@ -95,7 +146,7 @@ describe "CheckWriter::Check" do
95
146
  # Use this line to re-write the PDF we test against
96
147
  # write_content_to_file('with_stub_table_data', @data)
97
148
 
98
- #assert_data_matches_file_content('with_stub_table_data', @data)
149
+ assert_data_matches_file_content('with_stub_table_data', @data)
99
150
  end
100
151
  end
101
152
 
@@ -106,7 +157,7 @@ describe "CheckWriter::Check" do
106
157
  end
107
158
  it "generates a pdf with a second signature line" do
108
159
  # Use this line to re-write the PDF we test against
109
- write_content_to_file('with_second_signature_line', @data)
160
+ # write_content_to_file('with_second_signature_line', @data)
110
161
 
111
162
  assert_data_matches_file_content('with_second_signature_line', @data)
112
163
  end
data/spec/spec_helper.rb CHANGED
@@ -8,7 +8,7 @@ require 'check_writer'
8
8
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
9
 
10
10
  RSpec.configure do |config|
11
-
11
+
12
12
  end
13
13
 
14
14
  TEST_ASSETS = File.expand_path("assets", File.dirname(__FILE__)).to_s
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.3
4
+ version: 0.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-12 00:00:00.000000000 Z
12
+ date: 2013-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &4661240 !ruby/object:Gem::Requirement
16
+ requirement: &15079860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,21 +21,21 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *4661240
24
+ version_requirements: *15079860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: prawn
27
- requirement: &4821120 !ruby/object:Gem::Requirement
27
+ requirement: &15078580 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
- version: '0'
32
+ version: 0.12.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *4821120
35
+ version_requirements: *15078580
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: linguistics
38
- requirement: &4840080 !ruby/object:Gem::Requirement
38
+ requirement: &15076160 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,21 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *4840080
47
- - !ruby/object:Gem::Dependency
48
- name: appraisal
49
- requirement: &5116060 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- type: :development
56
- prerelease: false
57
- version_requirements: *5116060
46
+ version_requirements: *15076160
58
47
  - !ruby/object:Gem::Dependency
59
48
  name: rake
60
- requirement: &5136480 !ruby/object:Gem::Requirement
49
+ requirement: &15074340 !ruby/object:Gem::Requirement
61
50
  none: false
62
51
  requirements:
63
52
  - - ! '>='
@@ -65,10 +54,10 @@ dependencies:
65
54
  version: '0'
66
55
  type: :development
67
56
  prerelease: false
68
- version_requirements: *5136480
57
+ version_requirements: *15074340
69
58
  - !ruby/object:Gem::Dependency
70
59
  name: jeweler
71
- requirement: &5134100 !ruby/object:Gem::Requirement
60
+ requirement: &15087380 !ruby/object:Gem::Requirement
72
61
  none: false
73
62
  requirements:
74
63
  - - ~>
@@ -76,21 +65,10 @@ dependencies:
76
65
  version: 1.8.3
77
66
  type: :development
78
67
  prerelease: false
79
- version_requirements: *5134100
80
- - !ruby/object:Gem::Dependency
81
- name: appraisal
82
- requirement: &5132300 !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
85
- - - ! '>='
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
- type: :development
89
- prerelease: false
90
- version_requirements: *5132300
68
+ version_requirements: *15087380
91
69
  - !ruby/object:Gem::Dependency
92
70
  name: rspec
93
- requirement: &5130580 !ruby/object:Gem::Requirement
71
+ requirement: &15085360 !ruby/object:Gem::Requirement
94
72
  none: false
95
73
  requirements:
96
74
  - - ~>
@@ -98,10 +76,10 @@ dependencies:
98
76
  version: 2.8.0
99
77
  type: :development
100
78
  prerelease: false
101
- version_requirements: *5130580
79
+ version_requirements: *15085360
102
80
  - !ruby/object:Gem::Dependency
103
81
  name: rdoc
104
- requirement: &5267620 !ruby/object:Gem::Requirement
82
+ requirement: &15083560 !ruby/object:Gem::Requirement
105
83
  none: false
106
84
  requirements:
107
85
  - - ~>
@@ -109,18 +87,18 @@ dependencies:
109
87
  version: '3.12'
110
88
  type: :development
111
89
  prerelease: false
112
- version_requirements: *5267620
90
+ version_requirements: *15083560
113
91
  - !ruby/object:Gem::Dependency
114
92
  name: bundler
115
- requirement: &5265200 !ruby/object:Gem::Requirement
93
+ requirement: &15082780 !ruby/object:Gem::Requirement
116
94
  none: false
117
95
  requirements:
118
- - - ~>
96
+ - - ! '>='
119
97
  - !ruby/object:Gem::Version
120
98
  version: 1.1.0
121
99
  type: :development
122
100
  prerelease: false
123
- version_requirements: *5265200
101
+ version_requirements: *15082780
124
102
  description: Ruby library for generating PDF checks that you can take to the bank
125
103
  email: ryan@thewinograds.com
126
104
  executables: []
@@ -131,7 +109,6 @@ extra_rdoc_files:
131
109
  files:
132
110
  - .document
133
111
  - .rspec
134
- - Appraisals
135
112
  - Gemfile
136
113
  - Gemfile.lock
137
114
  - LICENSE.txt
@@ -139,34 +116,19 @@ files:
139
116
  - Rakefile
140
117
  - VERSION
141
118
  - check_writer.gemspec
142
- - gemfiles/prawn0.12.0.gemfile
143
- - gemfiles/prawn0.12.0.gemfile.lock
144
- - gemfiles/prawn0.6.1.gemfile
145
- - gemfiles/prawn0.6.1.gemfile.lock
146
- - gemfiles/prawn0.6.3.gemfile
147
- - gemfiles/prawn0.6.3.gemfile.lock
148
119
  - lib/check_writer.rb
149
120
  - lib/check_writer/attribute_formatting.rb
150
121
  - lib/check_writer/check.rb
122
+ - spec/assets/blank-0.12.0.pdf
151
123
  - spec/assets/sample-signature.png
152
124
  - spec/assets/test-0.12.0.pdf
153
- - spec/assets/test-0.6.1.pdf
154
- - spec/assets/test-0.6.3.pdf
155
125
  - spec/assets/two_in_one-0.12.0.pdf
156
- - spec/assets/two_in_one-0.6.1.pdf
157
- - spec/assets/two_in_one-0.6.3.pdf
126
+ - spec/assets/void-0.12.0.pdf
158
127
  - spec/assets/with_second_signature_line-0.12.0.pdf
159
- - spec/assets/with_second_signature_line-0.6.1.pdf
160
- - spec/assets/with_second_signature_line-0.6.3.pdf
161
128
  - spec/assets/with_signature_image-0.12.0.pdf
162
- - spec/assets/with_signature_image-0.6.1.pdf
163
- - spec/assets/with_signature_image-0.6.3.pdf
164
129
  - spec/assets/with_stub_table_data-0.12.0.pdf
165
- - spec/assets/with_stub_table_data-0.6.1.pdf
166
- - spec/assets/with_stub_table_data-0.6.3.pdf
167
130
  - spec/assets/with_stubs-0.12.0.pdf
168
- - spec/assets/with_stubs-0.6.1.pdf
169
- - spec/assets/with_stubs-0.6.3.pdf
131
+ - spec/assets/with_two_thirds_stub-0.12.0.pdf
170
132
  - spec/check_spec.rb
171
133
  - spec/spec_helper.rb
172
134
  - vendor/GnuMICR-0.30/AUTHORS
@@ -201,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
201
163
  version: '0'
202
164
  segments:
203
165
  - 0
204
- hash: -3966918035493978081
166
+ hash: -2768344481441059442
205
167
  required_rubygems_version: !ruby/object:Gem::Requirement
206
168
  none: false
207
169
  requirements:
data/Appraisals DELETED
@@ -1,11 +0,0 @@
1
- appraise "prawn0.12.0" do
2
- gem "prawn", '0.12.0'
3
- end
4
-
5
- appraise "prawn0.6.3" do
6
- gem "prawn", '0.6.3'
7
- end
8
-
9
- appraise "prawn0.6.1" do
10
- gem "prawn", '0.6.1'
11
- end
@@ -1,14 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "activesupport"
6
- gem "linguistics"
7
- gem "rake"
8
- gem "jeweler", "~> 1.8.3"
9
- gem "appraisal"
10
- gem "rspec", "~> 2.8.0"
11
- gem "rdoc", "~> 3.12"
12
- gem "bundler", "~> 1.1.0"
13
- gem "prawn", "0.12.0"
14
-