zebra_printer 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 +7 -0
- data/.document +5 -0
- data/.rspec +3 -0
- data/.travis.yml +6 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +85 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +26 -0
- data/Rakefile +50 -0
- data/VERSION +1 -0
- data/features/ascii-text-rotation.feature +48 -0
- data/features/ascii-text-simple.feature +31 -0
- data/features/ascii-text-size.feature +44 -0
- data/features/barcode-code128.feature +59 -0
- data/features/barcode-datamatrix.feature +62 -0
- data/features/data.feature +17 -0
- data/features/position-epl2.feature +59 -0
- data/features/position-zpl2.feature +64 -0
- data/features/step_definitions/dsl_steps.rb +22 -0
- data/features/step_definitions/language_steps.rb +4 -0
- data/features/step_definitions/output_steps.rb +9 -0
- data/features/support/env.rb +1 -0
- data/lib/document_value.rb +4 -0
- data/lib/languages/epl2/barcode.rb +50 -0
- data/lib/languages/epl2/document.rb +27 -0
- data/lib/languages/epl2/font.rb +48 -0
- data/lib/languages/epl2/position.rb +11 -0
- data/lib/languages/epl2/text.rb +27 -0
- data/lib/languages/epl2.rb +78 -0
- data/lib/languages/generic/dots.rb +37 -0
- data/lib/languages/generic/integer.rb +5 -0
- data/lib/languages/generic/millimetres.rb +60 -0
- data/lib/languages/generic/position.rb +64 -0
- data/lib/languages/generic.rb +7 -0
- data/lib/languages/zpl2/barcode.rb +48 -0
- data/lib/languages/zpl2/document.rb +27 -0
- data/lib/languages/zpl2/font.rb +52 -0
- data/lib/languages/zpl2/position.rb +11 -0
- data/lib/languages/zpl2/text.rb +15 -0
- data/lib/languages/zpl2.rb +76 -0
- data/lib/languages.rb +8 -0
- data/lib/utils/array.rb +5 -0
- data/lib/zebra_printer.rb +4 -0
- data/lib/zebra_printer_document.rb +47 -0
- data/spec/lib/languages/epl2/barcode_1d_spec.rb +19 -0
- data/spec/lib/languages/epl2/barcode_2d_spec.rb +11 -0
- data/spec/lib/languages/epl2/barcode_factory_spec.rb +17 -0
- data/spec/lib/languages/epl2/document_spec.rb +23 -0
- data/spec/lib/languages/epl2/font_spec.rb +49 -0
- data/spec/lib/languages/epl2/position_spec.rb +9 -0
- data/spec/lib/languages/epl2/text_spec.rb +17 -0
- data/spec/lib/languages/generic/dots.rb +18 -0
- data/spec/lib/languages/generic/millimetres.rb +36 -0
- data/spec/lib/languages/generic/position_spec.rb +24 -0
- data/spec/lib/languages/languages.rb +18 -0
- data/spec/lib/languages/zpl2/barcode1d_spec.rb +18 -0
- data/spec/lib/languages/zpl2/barcode2d_spec.rb +11 -0
- data/spec/lib/languages/zpl2/barcode_factory_spec.rb +17 -0
- data/spec/lib/languages/zpl2/document_spec.rb +23 -0
- data/spec/lib/languages/zpl2/font_spec.rb +49 -0
- data/spec/lib/languages/zpl2/position_spec.rb +10 -0
- data/spec/lib/languages/zpl2/text_spec.rb +6 -0
- data/spec/lib/zebra_printer_document.rb +40 -0
- data/spec/spec_helper.rb +16 -0
- data/zebra_printer.gemspec +119 -0
- metadata +193 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
class ZebraPrinterDocument
|
2
|
+
def initialize(data=nil, &block)
|
3
|
+
@language = :epl2
|
4
|
+
@data = data
|
5
|
+
if block_given?
|
6
|
+
instance_eval(&block)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def language(lang)
|
11
|
+
@language = lang
|
12
|
+
@language_processor = nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def language_processor
|
16
|
+
@language_processor ||= Languages.const_get(@language.to_s.capitalize).new
|
17
|
+
end
|
18
|
+
|
19
|
+
def process(&block)
|
20
|
+
instance_eval(&block)
|
21
|
+
self
|
22
|
+
end
|
23
|
+
|
24
|
+
def document
|
25
|
+
language_processor.document
|
26
|
+
end
|
27
|
+
|
28
|
+
def data
|
29
|
+
@data
|
30
|
+
end
|
31
|
+
|
32
|
+
def method_missing(method,*args,&block)
|
33
|
+
if language_processor.respond_to? method
|
34
|
+
if block_given?
|
35
|
+
language_processor.public_send(method,*args,&block)
|
36
|
+
else
|
37
|
+
language_processor.public_send(method,*args)
|
38
|
+
end
|
39
|
+
else
|
40
|
+
super(method,*args,&block)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def respond_to?(method)
|
45
|
+
language_processor.respond_to?(method) || super(method)
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Epl2::Barcode1D do
|
4
|
+
context "code 128" do
|
5
|
+
it "#render" do
|
6
|
+
font = Languages::Epl2::Font.new
|
7
|
+
barcode = Languages::Epl2::Barcode1D.new :code_128, :at => [1,2], :text => "3"
|
8
|
+
expect(barcode.render).to eq("B1,2,0,1,2,2,50,B,\"3\"")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
context "ean13" do
|
12
|
+
it "#render" do
|
13
|
+
font = Languages::Epl2::Font.new
|
14
|
+
barcode = Languages::Epl2::Barcode1D.new :ean13, :at => [1,2], :text => "3"
|
15
|
+
expect(barcode.render).to eq("B1,2,0,E30,2,2,50,B,\"3\"")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Epl2::Barcode2D do
|
4
|
+
context "data_matrix" do
|
5
|
+
it "#render" do
|
6
|
+
font = Languages::Epl2::Font.new
|
7
|
+
barcode = Languages::Epl2::Barcode2D.new :data_matrix, :font => font, :at => [1,2], :text => "3"
|
8
|
+
expect(barcode.render).to eq("b1,2,D,c16,r16,\"3\"")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Epl2::BarcodeFactory do
|
4
|
+
context ".create_barcode" do
|
5
|
+
it "code_type = code_128" do
|
6
|
+
expect(Languages::Epl2::BarcodeFactory.create_barcode(:code_128)).to be_an_instance_of Languages::Epl2::Barcode1D
|
7
|
+
end
|
8
|
+
|
9
|
+
it "code_type = ean13" do
|
10
|
+
expect(Languages::Epl2::BarcodeFactory.create_barcode(:ean13)).to be_an_instance_of Languages::Epl2::Barcode1D
|
11
|
+
end
|
12
|
+
|
13
|
+
it "code_type = data_matrix" do
|
14
|
+
expect(Languages::Epl2::BarcodeFactory.create_barcode(:data_matrix)).to be_an_instance_of Languages::Epl2::Barcode2D
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ostruct'
|
3
|
+
|
4
|
+
describe Languages::Epl2::Document do
|
5
|
+
let(:document_output) { subject.render.strip }
|
6
|
+
it "starts with N" do
|
7
|
+
expect(document_output).to start_with("N")
|
8
|
+
end
|
9
|
+
|
10
|
+
it "concat strings" do
|
11
|
+
subject << "hello_world"
|
12
|
+
expect(document_output).to include("hello_world")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "calls render on objects" do
|
16
|
+
subject << OpenStruct.new(:render => 'hello_world')
|
17
|
+
expect(document_output).to include("hello_world")
|
18
|
+
end
|
19
|
+
|
20
|
+
it "ends with P1" do
|
21
|
+
expect(document_output).to end_with("P1")
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Epl2::Font do
|
4
|
+
context "#font_size :normal" do
|
5
|
+
subject { Languages::Epl2::Font.new :size => :normal}
|
6
|
+
its(:name) { should eq 2 }
|
7
|
+
its(:rotation) { should eq 0 }
|
8
|
+
its(:height) { should eq 1 }
|
9
|
+
its(:width) { should eq 1 }
|
10
|
+
end
|
11
|
+
context "#font_size :small" do
|
12
|
+
subject { Languages::Epl2::Font.new :size => :small}
|
13
|
+
its(:name) { should eq 1 }
|
14
|
+
its(:rotation) { should eq 0 }
|
15
|
+
its(:height) { should eq 1 }
|
16
|
+
its(:width) { should eq 1 }
|
17
|
+
end
|
18
|
+
context "#font_size :large" do
|
19
|
+
subject { Languages::Epl2::Font.new :size => :large}
|
20
|
+
its(:name) { should eq 3 }
|
21
|
+
its(:rotation) { should eq 0 }
|
22
|
+
its(:height) { should eq 1 }
|
23
|
+
its(:width) { should eq 1 }
|
24
|
+
end
|
25
|
+
context "#font_size :x_large" do
|
26
|
+
subject { Languages::Epl2::Font.new :size => :x_large}
|
27
|
+
its(:name) { should eq 4 }
|
28
|
+
its(:rotation) { should eq 0 }
|
29
|
+
its(:height) { should eq 1 }
|
30
|
+
its(:width) { should eq 1 }
|
31
|
+
end
|
32
|
+
|
33
|
+
context "#font_rotation" do
|
34
|
+
let(:font) { Languages::Epl2::Font.new }
|
35
|
+
it ":by_90" do
|
36
|
+
expect(font.font_rotation(:by_90)).to eq 1
|
37
|
+
end
|
38
|
+
it ":by_180" do
|
39
|
+
expect(font.font_rotation(:by_180)).to eq 2
|
40
|
+
end
|
41
|
+
it ":by_270" do
|
42
|
+
expect(font.font_rotation(:by_270)).to eq 3
|
43
|
+
end
|
44
|
+
it ":by_0" do
|
45
|
+
expect(font.font_rotation(:by_0)).to eq 0
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Epl2::Text do
|
4
|
+
it "#render" do
|
5
|
+
expect(subject.render).to be_a(String)
|
6
|
+
end
|
7
|
+
|
8
|
+
it "#x" do
|
9
|
+
subject.x = 10
|
10
|
+
expect(subject.render.split(',')[0]).to eq("A10")
|
11
|
+
end
|
12
|
+
|
13
|
+
it "#y" do
|
14
|
+
subject.y = 10
|
15
|
+
expect(subject.render.split(',')[1]).to eq("10")
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Generic::Dots do
|
4
|
+
let(:dots_a) { Languages::Generic::Dots.new 25 }
|
5
|
+
let(:dots_b) { Languages::Generic::Dots.new 25 }
|
6
|
+
|
7
|
+
it "can add dots" do
|
8
|
+
expect(dots_a + dots_b).to eq(Languages::Generic::Dots.new(50))
|
9
|
+
end
|
10
|
+
|
11
|
+
it "can subtract dots" do
|
12
|
+
expect(dots_a - dots_b).to eq(Languages::Generic::Dots.new(0))
|
13
|
+
end
|
14
|
+
|
15
|
+
it "compare dots" do
|
16
|
+
expect(dots_a).to eq(dots_b)
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Generic::Millimetres do
|
4
|
+
let(:mm_a) { Languages::Generic::Millimetres.new 25 }
|
5
|
+
let(:mm_b) { Languages::Generic::Millimetres.new 20 }
|
6
|
+
|
7
|
+
it "can add mm" do
|
8
|
+
expect(mm_a + mm_b).to eq(Languages::Generic::Millimetres.new(45))
|
9
|
+
end
|
10
|
+
|
11
|
+
it "can subtract mm" do
|
12
|
+
expect(mm_a - mm_b).to eq(Languages::Generic::Millimetres.new(5))
|
13
|
+
end
|
14
|
+
|
15
|
+
it "can add int" do
|
16
|
+
expect(5 + mm_b).to eq(mm_a)
|
17
|
+
expect(mm_b + 5).to eq(mm_a)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "can subtract mm" do
|
21
|
+
expect(25 - mm_b).to eq(Languages::Generic::Millimetres.new(5))
|
22
|
+
expect(mm_a - 20).to eq(Languages::Generic::Millimetres.new(5))
|
23
|
+
end
|
24
|
+
|
25
|
+
it "compare mm" do
|
26
|
+
expect(mm_a).to eq(Languages::Generic::Millimetres.new(25))
|
27
|
+
end
|
28
|
+
|
29
|
+
it "25 mm at 203 DPI" do
|
30
|
+
expect(mm_a.to_dots).to eq(Languages::Generic::Dots.new(200))
|
31
|
+
end
|
32
|
+
|
33
|
+
it "25 mm at 300 DPI" do
|
34
|
+
expect(mm_a.to_dots(:dpi300)).to eq(Languages::Generic::Dots.new(295))
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Generic::Position do
|
4
|
+
let(:test_class) { Class.new { include Languages::Generic::Position }}
|
5
|
+
|
6
|
+
it "can add positions" do
|
7
|
+
a = test_class[1,2]
|
8
|
+
b = test_class[2,3]
|
9
|
+
expect(a+b).to eq(test_class[3,5])
|
10
|
+
end
|
11
|
+
|
12
|
+
it "can compare positions" do
|
13
|
+
a = test_class[1,2]
|
14
|
+
b = test_class[1,2]
|
15
|
+
expect(a).to eq(b)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "can take elements from array" do
|
19
|
+
a = [1,2]
|
20
|
+
b = test_class[1,2]
|
21
|
+
c = test_class.from_array a
|
22
|
+
expect(c).to eq(b)
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Languages support DSL" do
|
4
|
+
context "EPL2" do
|
5
|
+
[:text, :barcode, :position, :font, :rotate].each do |method|
|
6
|
+
it "##{method.to_s}" do
|
7
|
+
expect(Languages::Epl2.instance_methods).to include(method)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
context "ZPL2" do
|
12
|
+
[:text, :barcode, :position, :font, :rotate].each do |method|
|
13
|
+
it "##{method.to_s}" do
|
14
|
+
expect(Languages::Zpl2.instance_methods).to include(method)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Zpl2::Barcode1D do
|
4
|
+
context "code 128" do
|
5
|
+
it "#render" do
|
6
|
+
font = Languages::Zpl2::Font.new
|
7
|
+
barcode = Languages::Zpl2::Barcode1D.new :code_128, :font => font, :text => 'hello_world'
|
8
|
+
expect(barcode.render).to eq("^BCN,#{font.height*2},Y,N,N^FDhello_world^FS")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
context "ean13" do
|
12
|
+
it "#render" do
|
13
|
+
font = Languages::Zpl2::Font.new
|
14
|
+
barcode = Languages::Zpl2::Barcode1D.new :ean13, :font => font, :text => 'hello_world'
|
15
|
+
expect(barcode.render).to eq("^BEN,#{font.height*2},Y,N,N^FDhello_world^FS")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Zpl2::Barcode2D do
|
4
|
+
context "data_matrix" do
|
5
|
+
it "#render" do
|
6
|
+
font = Languages::Zpl2::Font.new
|
7
|
+
barcode = Languages::Zpl2::Barcode2D.new :data_matrix, :font => font, :text => 'hello_world'
|
8
|
+
expect(barcode.render).to eq("^BXN,4,200,16,16^FDhello_world^FS")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Zpl2::BarcodeFactory do
|
4
|
+
context ".create_barcode" do
|
5
|
+
it "code_type = code_128" do
|
6
|
+
expect(Languages::Zpl2::BarcodeFactory.create_barcode(:code_128)).to be_an_instance_of Languages::Zpl2::Barcode1D
|
7
|
+
end
|
8
|
+
|
9
|
+
it "code_type = ean13" do
|
10
|
+
expect(Languages::Zpl2::BarcodeFactory.create_barcode(:ean13)).to be_an_instance_of Languages::Zpl2::Barcode1D
|
11
|
+
end
|
12
|
+
|
13
|
+
it "code_type = data_matrix" do
|
14
|
+
expect(Languages::Zpl2::BarcodeFactory.create_barcode(:data_matrix)).to be_an_instance_of Languages::Zpl2::Barcode2D
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ostruct'
|
3
|
+
|
4
|
+
describe Languages::Zpl2::Document do
|
5
|
+
let(:document_output) { subject.render.strip }
|
6
|
+
it "starts with ^XA" do
|
7
|
+
expect(document_output).to start_with("^XA")
|
8
|
+
end
|
9
|
+
|
10
|
+
it "concat strings" do
|
11
|
+
subject << "hello_world"
|
12
|
+
expect(document_output).to include("hello_world")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "calls render on objects" do
|
16
|
+
subject << OpenStruct.new(:render => 'hello_world')
|
17
|
+
expect(document_output).to include("hello_world")
|
18
|
+
end
|
19
|
+
|
20
|
+
it "ends with ^XZ" do
|
21
|
+
expect(document_output).to end_with("^XZ")
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Languages::Zpl2::Font do
|
4
|
+
context "#font_size :normal" do
|
5
|
+
subject { Languages::Zpl2::Font.new :size => :normal}
|
6
|
+
its(:name) { should eq "0" }
|
7
|
+
its(:rotation) { should eq "N" }
|
8
|
+
its(:height) { should eq 25 }
|
9
|
+
its(:width) { should eq 25 }
|
10
|
+
end
|
11
|
+
context "#font_size :small" do
|
12
|
+
subject { Languages::Zpl2::Font.new :size => :small}
|
13
|
+
its(:name) { should eq "0" }
|
14
|
+
its(:rotation) { should eq "N" }
|
15
|
+
its(:height) { should eq 20 }
|
16
|
+
its(:width) { should eq 20 }
|
17
|
+
end
|
18
|
+
context "#font_size :large" do
|
19
|
+
subject { Languages::Zpl2::Font.new :size => :large}
|
20
|
+
its(:name) { should eq "0" }
|
21
|
+
its(:rotation) { should eq "N" }
|
22
|
+
its(:height) { should eq 40 }
|
23
|
+
its(:width) { should eq 40 }
|
24
|
+
end
|
25
|
+
context "#font_size :x_large" do
|
26
|
+
subject { Languages::Zpl2::Font.new :size => :x_large}
|
27
|
+
its(:name) { should eq "0" }
|
28
|
+
its(:rotation) { should eq "N" }
|
29
|
+
its(:height) { should eq 60 }
|
30
|
+
its(:width) { should eq 60 }
|
31
|
+
end
|
32
|
+
|
33
|
+
context "#font_rotation" do
|
34
|
+
let(:font) { Languages::Zpl2::Font.new }
|
35
|
+
it ":by_90" do
|
36
|
+
expect(font.font_rotation(:by_90)).to eq "R"
|
37
|
+
end
|
38
|
+
it ":by_180" do
|
39
|
+
expect(font.font_rotation(:by_180)).to eq "I"
|
40
|
+
end
|
41
|
+
it ":by_270" do
|
42
|
+
expect(font.font_rotation(:by_270)).to eq "B"
|
43
|
+
end
|
44
|
+
it ":by_0" do
|
45
|
+
expect(font.font_rotation(:by_0)).to eq "N"
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ZebraPrinterDocument do
|
4
|
+
context "language :epl2" do
|
5
|
+
before :each do
|
6
|
+
subject.language :epl2
|
7
|
+
end
|
8
|
+
|
9
|
+
it "language_processor is correct" do
|
10
|
+
expect(subject.language_processor).to be_a Languages::Epl2
|
11
|
+
end
|
12
|
+
|
13
|
+
context "DSL" do
|
14
|
+
[:text, :barcode, :position, :font, :rotate].each do |method|
|
15
|
+
it "#{method.to_s}" do
|
16
|
+
expect(subject).to respond_to method
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
context "language :zpl2" do
|
24
|
+
before :each do
|
25
|
+
subject.language :zpl2
|
26
|
+
end
|
27
|
+
|
28
|
+
it "language_processor is correct" do
|
29
|
+
expect(subject.language_processor).to be_a Languages::Zpl2
|
30
|
+
end
|
31
|
+
|
32
|
+
context "DSL" do
|
33
|
+
[:text, :barcode, :position, :font, :rotate].each do |method|
|
34
|
+
it "#{method.to_s}" do
|
35
|
+
expect(subject).to respond_to method
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "codeclimate-test-reporter"
|
2
|
+
CodeClimate::TestReporter.start
|
3
|
+
|
4
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
5
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
6
|
+
|
7
|
+
require 'rspec'
|
8
|
+
require 'zebra_printer'
|
9
|
+
|
10
|
+
# Requires supporting files with custom matchers and macros, etc,
|
11
|
+
# in ./support/ and its subdirectories.
|
12
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
13
|
+
|
14
|
+
RSpec.configure do |config|
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: zebra_printer 0.1.1 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "zebra_printer"
|
9
|
+
s.version = "0.1.1"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.authors = ["Paul Mitchell"]
|
14
|
+
s.date = "2014-10-17"
|
15
|
+
s.description = "This DSL is for zebra printers and support languages ZPLII and EPLII"
|
16
|
+
s.email = "paul.d.mitchell@ed.ac.uk"
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
".rspec",
|
24
|
+
".travis.yml",
|
25
|
+
"Gemfile",
|
26
|
+
"Gemfile.lock",
|
27
|
+
"LICENSE.txt",
|
28
|
+
"README.rdoc",
|
29
|
+
"Rakefile",
|
30
|
+
"VERSION",
|
31
|
+
"features/ascii-text-rotation.feature",
|
32
|
+
"features/ascii-text-simple.feature",
|
33
|
+
"features/ascii-text-size.feature",
|
34
|
+
"features/barcode-code128.feature",
|
35
|
+
"features/barcode-datamatrix.feature",
|
36
|
+
"features/data.feature",
|
37
|
+
"features/position-epl2.feature",
|
38
|
+
"features/position-zpl2.feature",
|
39
|
+
"features/step_definitions/dsl_steps.rb",
|
40
|
+
"features/step_definitions/language_steps.rb",
|
41
|
+
"features/step_definitions/output_steps.rb",
|
42
|
+
"features/support/env.rb",
|
43
|
+
"lib/document_value.rb",
|
44
|
+
"lib/languages.rb",
|
45
|
+
"lib/languages/epl2.rb",
|
46
|
+
"lib/languages/epl2/barcode.rb",
|
47
|
+
"lib/languages/epl2/document.rb",
|
48
|
+
"lib/languages/epl2/font.rb",
|
49
|
+
"lib/languages/epl2/position.rb",
|
50
|
+
"lib/languages/epl2/text.rb",
|
51
|
+
"lib/languages/generic.rb",
|
52
|
+
"lib/languages/generic/dots.rb",
|
53
|
+
"lib/languages/generic/integer.rb",
|
54
|
+
"lib/languages/generic/millimetres.rb",
|
55
|
+
"lib/languages/generic/position.rb",
|
56
|
+
"lib/languages/zpl2.rb",
|
57
|
+
"lib/languages/zpl2/barcode.rb",
|
58
|
+
"lib/languages/zpl2/document.rb",
|
59
|
+
"lib/languages/zpl2/font.rb",
|
60
|
+
"lib/languages/zpl2/position.rb",
|
61
|
+
"lib/languages/zpl2/text.rb",
|
62
|
+
"lib/utils/array.rb",
|
63
|
+
"lib/zebra_printer.rb",
|
64
|
+
"lib/zebra_printer_document.rb",
|
65
|
+
"spec/lib/languages/epl2/barcode_1d_spec.rb",
|
66
|
+
"spec/lib/languages/epl2/barcode_2d_spec.rb",
|
67
|
+
"spec/lib/languages/epl2/barcode_factory_spec.rb",
|
68
|
+
"spec/lib/languages/epl2/document_spec.rb",
|
69
|
+
"spec/lib/languages/epl2/font_spec.rb",
|
70
|
+
"spec/lib/languages/epl2/position_spec.rb",
|
71
|
+
"spec/lib/languages/epl2/text_spec.rb",
|
72
|
+
"spec/lib/languages/generic/dots.rb",
|
73
|
+
"spec/lib/languages/generic/millimetres.rb",
|
74
|
+
"spec/lib/languages/generic/position_spec.rb",
|
75
|
+
"spec/lib/languages/languages.rb",
|
76
|
+
"spec/lib/languages/zpl2/barcode1d_spec.rb",
|
77
|
+
"spec/lib/languages/zpl2/barcode2d_spec.rb",
|
78
|
+
"spec/lib/languages/zpl2/barcode_factory_spec.rb",
|
79
|
+
"spec/lib/languages/zpl2/document_spec.rb",
|
80
|
+
"spec/lib/languages/zpl2/font_spec.rb",
|
81
|
+
"spec/lib/languages/zpl2/position_spec.rb",
|
82
|
+
"spec/lib/languages/zpl2/text_spec.rb",
|
83
|
+
"spec/lib/zebra_printer_document.rb",
|
84
|
+
"spec/spec_helper.rb",
|
85
|
+
"zebra_printer.gemspec"
|
86
|
+
]
|
87
|
+
s.homepage = "http://github.com/yatsura/zebra_printer"
|
88
|
+
s.licenses = ["MIT"]
|
89
|
+
s.rubygems_version = "2.2.2"
|
90
|
+
s.summary = "Zebra printer DSL"
|
91
|
+
|
92
|
+
if s.respond_to? :specification_version then
|
93
|
+
s.specification_version = 4
|
94
|
+
|
95
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
96
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.14.0"])
|
97
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
98
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
99
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
|
100
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
101
|
+
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
102
|
+
else
|
103
|
+
s.add_dependency(%q<rspec>, ["~> 2.14.0"])
|
104
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
105
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
106
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
107
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
108
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
109
|
+
end
|
110
|
+
else
|
111
|
+
s.add_dependency(%q<rspec>, ["~> 2.14.0"])
|
112
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
113
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
114
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
115
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
116
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|