easyzpl 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b81e4c749aa17a2e9734d74765102aa527fbdab
4
- data.tar.gz: fc024aafd5ac34ee63a5138c02f65d7b8cd0306a
3
+ metadata.gz: 59403aadf3d599aff9df52a1357aef250fd4bd31
4
+ data.tar.gz: 3949b1ba5472090dd37ab2610b44aae8e8207096
5
5
  SHA512:
6
- metadata.gz: 74d5fb8f62b747631a7919c0da2ec3bcc57b4d221fa017bfa525c25c1a051250a1919b4297dbc8e073257953284461fe7828440ee45875e969f4b582e3341833
7
- data.tar.gz: 7125f9c186fdb766595fa446dbd37856bc64c73cace11059e0a243d4a644e804f1e6426c691616c38451c0d2a43a9bd4528c32186fec319c9302b5b1e4134fa2
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
 
@@ -1,4 +1,4 @@
1
1
  # Section holds the version number of the Gem
2
2
  module Easyzpl
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
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 templage with one variable text field and one variable barcode' do
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyzpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Grigajtis