label_factory 1.0.3 → 1.0.4
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.
- checksums.yaml +4 -4
- data/Rakefile +8 -0
- data/lib/label_factory/batch/base.rb +2 -0
- data/lib/label_factory/version.rb +1 -1
- data/lib/label_factory.rb +1 -0
- data/templates/pimaco-templates.xml +32 -0
- data/test/test_pdf_label_page.rb +53 -17
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e434fb2a46de090cb1f8f99a5320af7070f33b5
|
4
|
+
data.tar.gz: bb83215195c08c5e4a720052ebf69bbd24adb46d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f73cf6eee1798263a7fa4b8d88a16a8cc11339629e52559f76f4c1baa49bd90fa559acc41fdc98a79518a7d759114c248ab51dcea75b60e2820fe5e0df78e89
|
7
|
+
data.tar.gz: 9152d70308213c483091a100515c770b220d595b742ad391f36cf40330193486fe154b2fb80913f0c70431d55944d7cc8c8995ed0ece79ab636abb1c2161db46
|
data/Rakefile
CHANGED
data/lib/label_factory.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<Glabels-templates>
|
3
|
+
<!-- =================================================================== -->
|
4
|
+
<!-- Pimaco 6080 family: Address Labels, 1'' x 2_5/8'', 30 per sheet x -->
|
5
|
+
<!-- =================================================================== -->
|
6
|
+
<Template name="Pimaco 6080" size="US-Letter" _description="Address Labels">
|
7
|
+
<Label-rectangle id="0" width="2.68in" height="1.026in" round="0.0625in">
|
8
|
+
<Markup-margin size="0.00in"/>
|
9
|
+
<Layout nx="3" ny="10" x0="0.045in" y0="0.390in" dx="2.83in" dy="1.026in"/>
|
10
|
+
</Label-rectangle>
|
11
|
+
</Template>
|
12
|
+
|
13
|
+
<!-- =================================================================== -->
|
14
|
+
<!-- Pimaco 6081 family: Address Labels, 1'' x 4'', 20 per sheet x -->
|
15
|
+
<!-- =================================================================== -->
|
16
|
+
<Template name="Pimaco 6081" size="US-Letter" _description="Address Labels">
|
17
|
+
<Label-rectangle id="0" width="4.100in" height="1.026in" round="0.0625in">
|
18
|
+
<Markup-margin size="0.00in"/>
|
19
|
+
<Layout nx="2" ny="10" x0="0.02in" y0="0.38in" dx="4.3in" dy="1.026in"/>
|
20
|
+
</Label-rectangle>
|
21
|
+
</Template>
|
22
|
+
|
23
|
+
<!-- =================================================================== -->
|
24
|
+
<!-- Pimaco 6082 family: Address Labels, 1'' x 4'', 14 per sheet x -->
|
25
|
+
<!-- =================================================================== -->
|
26
|
+
<Template name="Pimaco 6082" size="US-Letter" _description="Address Labels">
|
27
|
+
<Label-rectangle id="0" width="4.100in" height="1.37in" round="0.0625in">
|
28
|
+
<Markup-margin size="0.00in"/>
|
29
|
+
<Layout nx="2" ny="7" x0="0.02in" y0="0.70in" dx="4.3in" dy="1.37in"/>
|
30
|
+
</Label-rectangle>
|
31
|
+
</Template>
|
32
|
+
</Glabels-templates>
|
data/test/test_pdf_label_page.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
# encoding:
|
1
|
+
# encoding: UTF-8
|
2
2
|
require 'test/unit'
|
3
3
|
require 'label_factory'
|
4
4
|
|
5
5
|
class TestPdfLabelBatch < Test::Unit::TestCase
|
6
6
|
ROOT = File.expand_path(File.dirname(__FILE__) + "/../")
|
7
7
|
def setup
|
8
|
+
LabelFactory::Batch::Base.load_template_set
|
9
|
+
@staff_names = ["Dan Stark", "Pierce Morar II", "Casimer Runolfsson", "Bella Jacobi"]
|
8
10
|
end
|
9
11
|
|
10
12
|
def test_new_with_tempalte_name
|
@@ -36,22 +38,22 @@ class TestPdfLabelBatch < Test::Unit::TestCase
|
|
36
38
|
|
37
39
|
def test_PdfLabelBatch_load_tempalte_set
|
38
40
|
LabelFactory::Batch::Base.load_template_set("#{ROOT}/templates/avery-iso-templates.xml")
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
41
|
+
#Avery 7160 is found in avery-iso-templates
|
42
|
+
p = LabelFactory::Batch::Base.new("Avery 7160")
|
43
|
+
assert p
|
44
|
+
assert_equal p.pdf.page_width, 595.28
|
45
|
+
assert_equal p.pdf.page_height, 841.89
|
46
|
+
LabelFactory::Batch::Base.load_template_set("#{ROOT}/templates/avery-us-templates.xml")
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_PdfLabelBatch_all_template_names
|
50
|
+
#what happens if we havn't loaded a template yet?
|
51
|
+
t = LabelFactory::Batch::Base.all_template_names
|
52
|
+
assert t
|
53
|
+
assert_equal t.class, Array
|
54
|
+
assert_equal t.count, 292
|
55
|
+
assert_equal t.first, "Avery 5160"
|
56
|
+
end
|
55
57
|
|
56
58
|
def test_add_label_3_by_10
|
57
59
|
p = LabelFactory::Batch::Base.new("Avery 8160") # label is 2 x 10
|
@@ -131,4 +133,38 @@ class TestPdfLabelBatch < Test::Unit::TestCase
|
|
131
133
|
t.find_description
|
132
134
|
end
|
133
135
|
end
|
136
|
+
|
137
|
+
def test_staff_pimaco_labels_6080
|
138
|
+
LabelFactory::Batch::Base.load_template_set('templates/pimaco-templates.xml')
|
139
|
+
p = LabelFactory::Batch::Base.new("Pimaco 6080")
|
140
|
+
p.draw_boxes(false, true)
|
141
|
+
@staff_names.each_with_index { |name, i| p.add_label(name, position: i, justification: :center) }
|
142
|
+
|
143
|
+
p.save_as("#{ROOT}/test_staff_pimaco_labels_6080.pdf")
|
144
|
+
end
|
145
|
+
|
146
|
+
def test_staff_pimaco_labels_6081
|
147
|
+
LabelFactory::Batch::Base.load_template_set('templates/pimaco-templates.xml')
|
148
|
+
p = LabelFactory::Batch::Base.new("Pimaco 6081")
|
149
|
+
p.draw_boxes(false, true)
|
150
|
+
@staff_names.each_with_index { |name, i| p.add_label(name, position: i, justification: :center) }
|
151
|
+
|
152
|
+
p.save_as("#{ROOT}/test_staff_pimaco_labels_6081.pdf")
|
153
|
+
end
|
154
|
+
|
155
|
+
def test_staff_pimaco_labels_6082
|
156
|
+
LabelFactory::Batch::Base.load_template_set('templates/pimaco-templates.xml')
|
157
|
+
p = LabelFactory::Batch::Base.new("Pimaco 6082")
|
158
|
+
p.draw_boxes(false, true)
|
159
|
+
@staff_names.each_with_index { |name, i| p.add_label(name, position: i, justification: :center) }
|
160
|
+
|
161
|
+
p.save_as("#{ROOT}/test_staff_pimaco_labels_6082.pdf")
|
162
|
+
end
|
163
|
+
|
164
|
+
def test_get_labels_per_page
|
165
|
+
LabelFactory::Batch::Base.load_template_set('templates/pimaco-templates.xml')
|
166
|
+
p = LabelFactory::Batch::Base.new("Pimaco 6082")
|
167
|
+
assert p.labels_per_page
|
168
|
+
assert_equal 14, p.labels_per_page
|
169
|
+
end
|
134
170
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: label_factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gagoar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventioz-pdf-writer
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- templates/misc-other-templates.xml
|
118
118
|
- templates/misc-us-templates.xml
|
119
119
|
- templates/paper-sizes.xml
|
120
|
+
- templates/pimaco-templates.xml
|
120
121
|
- templates/zweckform-iso-templates.xml
|
121
122
|
- test/test_pdf_label_page.rb
|
122
123
|
homepage: http://github.com/eventioz/label_factory
|
@@ -139,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
140
|
version: '0'
|
140
141
|
requirements: []
|
141
142
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
143
|
+
rubygems_version: 2.1.11
|
143
144
|
signing_key:
|
144
145
|
specification_version: 4
|
145
146
|
summary: http://github.com/eventioz/label_factory
|