easyzpl 0.1.0 → 0.1.1
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/README.md +7 -1
- data/lib/easyzpl/label.rb +1 -1
- data/lib/easyzpl/version.rb +1 -1
- data/spec/easyzpl_spec.rb +10 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59403aadf3d599aff9df52a1357aef250fd4bd31
|
4
|
+
data.tar.gz: 3949b1ba5472090dd37ab2610b44aae8e8207096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4b835840c2ff972f5f1b3d619690f80395540af31c3651e84caf2729f724a260371e8708f5c7cf50cb792a2f09a1b427a9fdd2614a84c02e08281717f6ba20d
|
7
|
+
data.tar.gz: 57c78844b7345a801bf1965a0be38ce14ebe227fa80721b5d49fec11f33695a51effe497b997f9a54574fe6a67ae6f94397e525e45d7aeb632e69c4f0720fe36
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ Or install it yourself as:
|
|
29
29
|
label.text_field('ZEBRA', 10, 10)
|
30
30
|
label.bar_code_39('ZEBRA', 10, 30)
|
31
31
|
puts label.to_s
|
32
|
-
|
32
|
+
|
33
33
|
# Create a stored template
|
34
34
|
label = Easyzpl::LabelTemplate.new('Template1')
|
35
35
|
label.home_position(30, 30)
|
@@ -38,6 +38,12 @@ Or install it yourself as:
|
|
38
38
|
label.variable_bar_code_39(10, 30)
|
39
39
|
puts label.to_s
|
40
40
|
|
41
|
+
# Created ZPL code to access the stored template created above
|
42
|
+
label = Easyzpl::StoredLabel.new('Template1')
|
43
|
+
label.add_field('ZEBRA')
|
44
|
+
label.add_field('ZEBRA')
|
45
|
+
puts label.to_s
|
46
|
+
|
41
47
|
## Contributing
|
42
48
|
|
43
49
|
1. Fork it ( https://github.com/[my-github-username]/easyzpl/fork )
|
data/lib/easyzpl/label.rb
CHANGED
@@ -47,7 +47,7 @@ module Easyzpl
|
|
47
47
|
y = 0 unless numeric?(y)
|
48
48
|
options = { height: 10.to_s, width: 10.to_s }.merge(params)
|
49
49
|
label_data.push('^FO' + x.to_s + ',' + y.to_s + '^AFN,' +
|
50
|
-
options[:height] + ',' + options[:width] +
|
50
|
+
options[:height].to_s + ',' + options[:width].to_s +
|
51
51
|
'^FD' + text + '^FS')
|
52
52
|
end
|
53
53
|
|
data/lib/easyzpl/version.rb
CHANGED
data/spec/easyzpl_spec.rb
CHANGED
@@ -20,7 +20,7 @@ describe 'Testing easyzpl Gem' do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
context 'When creating a stored template' do
|
23
|
-
it 'should output a label
|
23
|
+
it 'should output a label template with one variable text field and one variable barcode' do
|
24
24
|
label = Easyzpl::LabelTemplate.new('Template1')
|
25
25
|
label.home_position(30, 30)
|
26
26
|
label.draw_border(0, 0, 400, 300)
|
@@ -29,4 +29,13 @@ describe 'Testing easyzpl Gem' do
|
|
29
29
|
expect(label.to_s).to eq('^XA^DFTemplate1^FS^LH30,30^FO0,0^GB400,300,1^FS^FO10,10^FN1^FS^FO10,30^B3N,Y,20,N,N^FN2^FS^PQ1^XZ')
|
30
30
|
end
|
31
31
|
end
|
32
|
+
|
33
|
+
context 'When accessing the stored template' do
|
34
|
+
it 'should output a label with only two fields of data that are passed into a saved template' do
|
35
|
+
label = Easyzpl::StoredLabel.new('Template1')
|
36
|
+
label.add_field('ZEBRA')
|
37
|
+
label.add_field('ZEBRA')
|
38
|
+
expect(label.to_s).to eq('^XA^XFTemplate1^FS^FN1^FDZEBRA^FS^FN2^FDZEBRA^FS^PQ1^XZ')
|
39
|
+
end
|
40
|
+
end
|
32
41
|
end
|