ruby-zint 1.6.0-aarch64-mingw-ucrt
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
- checksums.yaml.gz.sig +0 -0
- data/.yardopts +9 -0
- data/CHANGELOG.md +37 -0
- data/LICENSE.txt +21 -0
- data/README.md +146 -0
- data/ext/ruby-zint/extconf.rb +113 -0
- data/lib/3.4/libzint.so +0 -0
- data/lib/ruby-zint.rb +1 -0
- data/lib/zint/aus_post.rb +8 -0
- data/lib/zint/aus_redirect.rb +8 -0
- data/lib/zint/aus_reply.rb +8 -0
- data/lib/zint/aus_route.rb +8 -0
- data/lib/zint/azrune.rb +8 -0
- data/lib/zint/aztec.rb +8 -0
- data/lib/zint/barcode.rb +566 -0
- data/lib/zint/bc_412.rb +8 -0
- data/lib/zint/bitmap.rb +4 -0
- data/lib/zint/bitmap_pixel.rb +4 -0
- data/lib/zint/c25iata.rb +8 -0
- data/lib/zint/c25ind.rb +8 -0
- data/lib/zint/c25inter.rb +8 -0
- data/lib/zint/c25logic.rb +8 -0
- data/lib/zint/c25matrix.rb +8 -0
- data/lib/zint/c25standard.rb +8 -0
- data/lib/zint/cep_net.rb +8 -0
- data/lib/zint/channel.rb +8 -0
- data/lib/zint/codabar.rb +8 -0
- data/lib/zint/codablock_f.rb +8 -0
- data/lib/zint/code11.rb +8 -0
- data/lib/zint/code128.rb +8 -0
- data/lib/zint/code128ab.rb +8 -0
- data/lib/zint/code128b.rb +5 -0
- data/lib/zint/code16k.rb +8 -0
- data/lib/zint/code32.rb +8 -0
- data/lib/zint/code39.rb +8 -0
- data/lib/zint/code49.rb +8 -0
- data/lib/zint/code93.rb +8 -0
- data/lib/zint/code_one.rb +8 -0
- data/lib/zint/constants/capability_flags.rb +22 -0
- data/lib/zint/constants/debug_flags.rb +9 -0
- data/lib/zint/constants/errors.rb +20 -0
- data/lib/zint/constants/input_data_types.rb +17 -0
- data/lib/zint/constants/output_options.rb +25 -0
- data/lib/zint/constants/specific_options.rb +13 -0
- data/lib/zint/constants/symbologies.rb +144 -0
- data/lib/zint/constants/warn_levels.rb +9 -0
- data/lib/zint/constants/warnings.rb +12 -0
- data/lib/zint/constants.rb +8 -0
- data/lib/zint/daft.rb +8 -0
- data/lib/zint/data_matrix.rb +19 -0
- data/lib/zint/dbarexp.rb +8 -0
- data/lib/zint/dbarexpstk.rb +8 -0
- data/lib/zint/dbarltd.rb +8 -0
- data/lib/zint/dbaromn.rb +8 -0
- data/lib/zint/dbaromnstk.rb +8 -0
- data/lib/zint/dbarstk.rb +8 -0
- data/lib/zint/dependencies.rb +15 -0
- data/lib/zint/dot_code.rb +8 -0
- data/lib/zint/dpd.rb +8 -0
- data/lib/zint/dpident.rb +8 -0
- data/lib/zint/dpleit.rb +8 -0
- data/lib/zint/dxfilmedge.rb +8 -0
- data/lib/zint/ean128.rb +8 -0
- data/lib/zint/ean13.rb +8 -0
- data/lib/zint/ean14.rb +8 -0
- data/lib/zint/ean8.rb +8 -0
- data/lib/zint/eanx.rb +15 -0
- data/lib/zint/eanxchk.rb +15 -0
- data/lib/zint/excode39.rb +8 -0
- data/lib/zint/fim.rb +8 -0
- data/lib/zint/flat.rb +8 -0
- data/lib/zint/grid_matrix.rb +8 -0
- data/lib/zint/gs1_128.rb +10 -0
- data/lib/zint/hanxin.rb +8 -0
- data/lib/zint/hibc128.rb +8 -0
- data/lib/zint/hibc39.rb +8 -0
- data/lib/zint/hibcaztec.rb +8 -0
- data/lib/zint/hibcblockf.rb +8 -0
- data/lib/zint/hibcdm.rb +8 -0
- data/lib/zint/hibcmicpdf.rb +8 -0
- data/lib/zint/hibcpdf.rb +8 -0
- data/lib/zint/hibcqr.rb +8 -0
- data/lib/zint/isbnx.rb +8 -0
- data/lib/zint/itf14.rb +8 -0
- data/lib/zint/japan_post.rb +8 -0
- data/lib/zint/kix.rb +8 -0
- data/lib/zint/korea_post.rb +8 -0
- data/lib/zint/logmars.rb +8 -0
- data/lib/zint/mailmark.rb +8 -0
- data/lib/zint/mailmark_2d.rb +8 -0
- data/lib/zint/mailmark_4s.rb +8 -0
- data/lib/zint/maxi_code.rb +8 -0
- data/lib/zint/micro_pdf417.rb +8 -0
- data/lib/zint/micro_qr.rb +8 -0
- data/lib/zint/msiplessey.rb +8 -0
- data/lib/zint/native.rb +106 -0
- data/lib/zint/nve18.rb +8 -0
- data/lib/zint/one_code.rb +8 -0
- data/lib/zint/pdf417.rb +8 -0
- data/lib/zint/pdf417comp.rb +8 -0
- data/lib/zint/pdf417trunc.rb +8 -0
- data/lib/zint/pharma.rb +8 -0
- data/lib/zint/pharmatwo.rb +8 -0
- data/lib/zint/planet.rb +8 -0
- data/lib/zint/plessey.rb +8 -0
- data/lib/zint/postnet.rb +8 -0
- data/lib/zint/pzn.rb +8 -0
- data/lib/zint/qr.rb +18 -0
- data/lib/zint/rmqr.rb +8 -0
- data/lib/zint/rss14.rb +8 -0
- data/lib/zint/rss14stack.rb +8 -0
- data/lib/zint/rss14stackomni.rb +8 -0
- data/lib/zint/rssexp.rb +8 -0
- data/lib/zint/rssexpstack.rb +8 -0
- data/lib/zint/rssltd.rb +8 -0
- data/lib/zint/structs/seg.rb +26 -0
- data/lib/zint/structs/structapp.rb +25 -0
- data/lib/zint/structs/symbol.rb +55 -0
- data/lib/zint/structs/vector.rb +54 -0
- data/lib/zint/structs/vector_circle.rb +32 -0
- data/lib/zint/structs/vector_hexagon.rb +31 -0
- data/lib/zint/structs/vector_rect.rb +37 -0
- data/lib/zint/structs/vector_string.rb +50 -0
- data/lib/zint/telepen.rb +8 -0
- data/lib/zint/telepennum.rb +8 -0
- data/lib/zint/ultra.rb +8 -0
- data/lib/zint/upc_a.rb +8 -0
- data/lib/zint/upc_a_chk.rb +8 -0
- data/lib/zint/upc_e.rb +8 -0
- data/lib/zint/upc_e_chk.rb +8 -0
- data/lib/zint/upnqr.rb +8 -0
- data/lib/zint/upu_s10.rb +8 -0
- data/lib/zint/uspsimail.rb +8 -0
- data/lib/zint/version.rb +3 -0
- data/lib/zint/vin.rb +8 -0
- data/lib/zint/zint_recipe.rb +31 -0
- data/lib/zint.rb +172 -0
- data/ruby-zint.gemspec +44 -0
- data.tar.gz.sig +0 -0
- metadata +340 -0
- metadata.gz.sig +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module Zint
|
|
2
|
+
module Structs
|
|
3
|
+
class Vector < FFI::Struct
|
|
4
|
+
layout :width, :float, # Width, height of barcode image (including text, whitespace)
|
|
5
|
+
:height, :float,
|
|
6
|
+
:rectangles, VectorRect.by_ref, # Pointer to first rectangle
|
|
7
|
+
:hexagons, VectorHexagon.by_ref, # Pointer to first hexagon
|
|
8
|
+
:strings, VectorString.by_ref, # Pointer to first string
|
|
9
|
+
:circles, VectorCircle.by_ref # Pointer to first circle
|
|
10
|
+
|
|
11
|
+
# Height of barcode image (including text, whitespace)
|
|
12
|
+
def height
|
|
13
|
+
self[:height]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Width of barcode image (including text, whitespace)
|
|
17
|
+
def width
|
|
18
|
+
self[:width]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Calls the given block and passes a {VectorRect} object for each rectangle to be printed.
|
|
22
|
+
def each_rectangle(&block)
|
|
23
|
+
each_vector(:rectangles, &block)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Calls the given block and passes a {VectorHexagon} object for each hexagon to be printed.
|
|
27
|
+
def each_hexagon(&block)
|
|
28
|
+
each_vector(:hexagons, &block)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Calls the given block and passes a {VectorString} object for each text string to be printed.
|
|
32
|
+
def each_string(&block)
|
|
33
|
+
each_vector(:strings, &block)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Calls the given block and passes a {VectorCircle} object for each circle to be printed.
|
|
37
|
+
def each_circle(&block)
|
|
38
|
+
each_vector(:circles, &block)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
private def each_vector(attr)
|
|
42
|
+
return to_enum(:each_vector, attr) unless block_given?
|
|
43
|
+
|
|
44
|
+
o = self[attr]
|
|
45
|
+
until o.null?
|
|
46
|
+
# Avoid garbage collection of Vector (and hence Barcode) before Vector*, since all memory is freed by ZBarcode_Delete()
|
|
47
|
+
o.instance_variable_set(:@vector, self)
|
|
48
|
+
yield o
|
|
49
|
+
o = o[:next]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module Zint
|
|
2
|
+
module Structs
|
|
3
|
+
class VectorCircle < FFI::Struct
|
|
4
|
+
layout :x, :float,
|
|
5
|
+
:y, :float,
|
|
6
|
+
:diameter, :float, # Circle diameter. Does not include width (if any)
|
|
7
|
+
:width, :float, # Width of circle perimeter (circumference). 0 for fill (disc)
|
|
8
|
+
:colour, :int, # Non-zero for draw with background colour (else draw with foreground colour)
|
|
9
|
+
:next, VectorCircle.by_ref # Pointer to next circle
|
|
10
|
+
|
|
11
|
+
# x position
|
|
12
|
+
def x
|
|
13
|
+
self[:x]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# y position
|
|
17
|
+
def y
|
|
18
|
+
self[:y]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# diameter
|
|
22
|
+
def diameter
|
|
23
|
+
self[:diameter]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Non-zero for draw with background colour
|
|
27
|
+
def colour
|
|
28
|
+
self[:colour]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module Zint
|
|
2
|
+
module Structs
|
|
3
|
+
class VectorHexagon < FFI::Struct
|
|
4
|
+
layout :x, :float,
|
|
5
|
+
:y, :float,
|
|
6
|
+
:diameter, :float,
|
|
7
|
+
:rotation, :int, # 0, 90, 180, 270 degrees
|
|
8
|
+
:next, VectorHexagon.by_ref # Pointer to next hexagon
|
|
9
|
+
|
|
10
|
+
# x position
|
|
11
|
+
def x
|
|
12
|
+
self[:x]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# y position
|
|
16
|
+
def y
|
|
17
|
+
self[:y]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# diameter
|
|
21
|
+
def diameter
|
|
22
|
+
self[:diameter]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# 0, 90, 180, 270 degrees
|
|
26
|
+
def rotation
|
|
27
|
+
self[:rotation]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module Zint
|
|
2
|
+
module Structs
|
|
3
|
+
class VectorRect < FFI::Struct
|
|
4
|
+
layout :x, :float,
|
|
5
|
+
:y, :float,
|
|
6
|
+
:height, :float,
|
|
7
|
+
:width, :float,
|
|
8
|
+
:colour, :int, # -1 for foreground, 1-8 for Cyan, Blue, Magenta, Red, Yellow, Green, Black, White
|
|
9
|
+
:next, VectorRect.by_ref # Pointer to next rectangle
|
|
10
|
+
|
|
11
|
+
# x position
|
|
12
|
+
def x
|
|
13
|
+
self[:x]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# y position
|
|
17
|
+
def y
|
|
18
|
+
self[:y]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# height
|
|
22
|
+
def height
|
|
23
|
+
self[:height]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# width
|
|
27
|
+
def width
|
|
28
|
+
self[:width]
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# -1 for foreground, 1-8 for Cyan, Blue, Magenta, Red, Yellow, Green, Black, White
|
|
32
|
+
def colour
|
|
33
|
+
self[:colour]
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
module Zint
|
|
2
|
+
module Structs
|
|
3
|
+
class VectorString < FFI::Struct
|
|
4
|
+
layout :x, :float, # x, y position relative to halign
|
|
5
|
+
:y, :float,
|
|
6
|
+
:fsize, :float, # font size
|
|
7
|
+
:width, :float, # Suggested string width, may be 0 if none recommended
|
|
8
|
+
:length, :int, # Number of characters
|
|
9
|
+
:rotation, :int, # 0, 90, 180, 270 degrees
|
|
10
|
+
:halign, :int, # Horizontal alignment: 0 for centre, 1 for left, 2 for right (end)
|
|
11
|
+
:text, :pointer, # the text string to be printed
|
|
12
|
+
:next, VectorString.by_ref # Pointer to next string
|
|
13
|
+
|
|
14
|
+
# x position relative to halign
|
|
15
|
+
def x
|
|
16
|
+
self[:x]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# y position
|
|
20
|
+
def y
|
|
21
|
+
self[:y]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# font size
|
|
25
|
+
def fsize
|
|
26
|
+
self[:fsize]
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Suggested string width, may be 0 if none recommended
|
|
30
|
+
def width
|
|
31
|
+
self[:width]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# 0, 90, 180, 270 degrees
|
|
35
|
+
def rotation
|
|
36
|
+
self[:rotation]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Horizontal alignment: 0 for centre, 1 for left, 2 for right (end)
|
|
40
|
+
def halign
|
|
41
|
+
self[:halign]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# the text string to be printed
|
|
45
|
+
def text
|
|
46
|
+
self[:text].read_bytes(self[:length])
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
data/lib/zint/telepen.rb
ADDED
data/lib/zint/ultra.rb
ADDED
data/lib/zint/upc_a.rb
ADDED
data/lib/zint/upc_e.rb
ADDED
data/lib/zint/upnqr.rb
ADDED
data/lib/zint/upu_s10.rb
ADDED
data/lib/zint/version.rb
ADDED
data/lib/zint/vin.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require_relative "dependencies"
|
|
2
|
+
require "rubygems"
|
|
3
|
+
# Keep the version constraint in sync with libusb.gemspec
|
|
4
|
+
gem "mini_portile2", Zint::MINI_PORTILE_VERSION
|
|
5
|
+
require "mini_portile2"
|
|
6
|
+
|
|
7
|
+
module Zint
|
|
8
|
+
class ZintRecipe < MiniPortileCMake
|
|
9
|
+
ROOT = File.expand_path("../../..", __FILE__)
|
|
10
|
+
|
|
11
|
+
def initialize(name, vers, url, sha256)
|
|
12
|
+
super(name, vers)
|
|
13
|
+
self.target = File.join(ROOT, "ports")
|
|
14
|
+
self.files = [url: url, sha256: sha256]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def port_path
|
|
18
|
+
"#{target}/#{RUBY_PLATFORM}"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def cook_and_activate
|
|
22
|
+
checkpoint = File.join(target, "#{name}-#{version}-#{RUBY_PLATFORM}.installed")
|
|
23
|
+
unless File.exist?(checkpoint)
|
|
24
|
+
cook
|
|
25
|
+
FileUtils.touch checkpoint
|
|
26
|
+
end
|
|
27
|
+
activate
|
|
28
|
+
self
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
data/lib/zint.rb
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
require "ffi"
|
|
2
|
+
|
|
3
|
+
require "zint/version"
|
|
4
|
+
require "zint/dependencies"
|
|
5
|
+
|
|
6
|
+
# Zint constants
|
|
7
|
+
require "zint/constants/capability_flags"
|
|
8
|
+
require "zint/constants/debug_flags"
|
|
9
|
+
require "zint/constants/errors"
|
|
10
|
+
require "zint/constants/input_data_types"
|
|
11
|
+
require "zint/constants/output_options"
|
|
12
|
+
require "zint/constants/specific_options"
|
|
13
|
+
require "zint/constants/symbologies"
|
|
14
|
+
require "zint/constants/warn_levels"
|
|
15
|
+
require "zint/constants/warnings"
|
|
16
|
+
|
|
17
|
+
# Zint structs
|
|
18
|
+
require "zint/structs/vector_circle"
|
|
19
|
+
require "zint/structs/vector_hexagon"
|
|
20
|
+
require "zint/structs/vector_rect"
|
|
21
|
+
require "zint/structs/vector_string"
|
|
22
|
+
require "zint/structs/vector"
|
|
23
|
+
require "zint/structs/seg"
|
|
24
|
+
require "zint/structs/structapp"
|
|
25
|
+
require "zint/structs/symbol"
|
|
26
|
+
require "zint/native"
|
|
27
|
+
|
|
28
|
+
module Zint
|
|
29
|
+
# Zint constants
|
|
30
|
+
include Constants::CapabilityFlags
|
|
31
|
+
include Constants::DebugFlags
|
|
32
|
+
include Constants::Errors
|
|
33
|
+
include Constants::InputDataTypes
|
|
34
|
+
include Constants::OutputOptions
|
|
35
|
+
include Constants::SpecificOptions
|
|
36
|
+
include Constants::Symbologies
|
|
37
|
+
include Constants::WarnLevels
|
|
38
|
+
include Constants::Warnings
|
|
39
|
+
|
|
40
|
+
# Barcode
|
|
41
|
+
autoload :Bc412, "zint/bc_412"
|
|
42
|
+
autoload :Bitmap, "zint/bitmap"
|
|
43
|
+
autoload :BitmapPixel, "zint/bitmap_pixel"
|
|
44
|
+
autoload :Barcode, "zint/barcode"
|
|
45
|
+
autoload :AusPost, "zint/aus_post"
|
|
46
|
+
autoload :AusRedirect, "zint/aus_redirect"
|
|
47
|
+
autoload :AusReply, "zint/aus_reply"
|
|
48
|
+
autoload :AusRoute, "zint/aus_route"
|
|
49
|
+
autoload :Azrune, "zint/azrune"
|
|
50
|
+
autoload :Aztec, "zint/aztec"
|
|
51
|
+
autoload :Bind, "zint/bind"
|
|
52
|
+
autoload :Box, "zint/box"
|
|
53
|
+
autoload :C25iata, "zint/c25iata"
|
|
54
|
+
autoload :C25ind, "zint/c25ind"
|
|
55
|
+
autoload :C25inter, "zint/c25inter"
|
|
56
|
+
autoload :C25logic, "zint/c25logic"
|
|
57
|
+
autoload :C25matrix, "zint/c25matrix"
|
|
58
|
+
autoload :C25standard, "zint/c25standard"
|
|
59
|
+
autoload :CepNet, "zint/cep_net"
|
|
60
|
+
autoload :Channel, "zint/channel"
|
|
61
|
+
autoload :Codabar, "zint/codabar"
|
|
62
|
+
autoload :CodablockF, "zint/codablock_f"
|
|
63
|
+
autoload :Code11, "zint/code11"
|
|
64
|
+
autoload :Code128, "zint/code128"
|
|
65
|
+
autoload :Code128AB, "zint/code128ab"
|
|
66
|
+
autoload :Code128B, "zint/code128b"
|
|
67
|
+
autoload :Code16k, "zint/code16k"
|
|
68
|
+
autoload :Code32, "zint/code32"
|
|
69
|
+
autoload :Code39, "zint/code39"
|
|
70
|
+
autoload :Code49, "zint/code49"
|
|
71
|
+
autoload :Code93, "zint/code93"
|
|
72
|
+
autoload :CodeOne, "zint/code_one"
|
|
73
|
+
autoload :Daft, "zint/daft"
|
|
74
|
+
autoload :DataMatrix, "zint/data_matrix"
|
|
75
|
+
autoload :DbarExp, "zint/dbarexp"
|
|
76
|
+
autoload :DbarExpstk, "zint/dbarexpstk"
|
|
77
|
+
autoload :DbarLtd, "zint/dbarltd"
|
|
78
|
+
autoload :DbarOmn, "zint/dbaromn"
|
|
79
|
+
autoload :DbarOmnstk, "zint/dbaromnstk"
|
|
80
|
+
autoload :DbarStk, "zint/dbarstk"
|
|
81
|
+
autoload :DotCode, "zint/dot_code"
|
|
82
|
+
autoload :DottyMode, "zint/dotty_mode"
|
|
83
|
+
autoload :Dpd, "zint/dpd"
|
|
84
|
+
autoload :Dpident, "zint/dpident"
|
|
85
|
+
autoload :Dpleit, "zint/dpleit"
|
|
86
|
+
autoload :Dxfilmedge, "zint/dxfilmedge"
|
|
87
|
+
autoload :Ean128, "zint/ean128"
|
|
88
|
+
autoload :Ean13, "zint/ean13"
|
|
89
|
+
autoload :Ean14, "zint/ean14"
|
|
90
|
+
autoload :Ean8, "zint/ean8"
|
|
91
|
+
autoload :Eanx, "zint/eanx"
|
|
92
|
+
autoload :EanxChk, "zint/eanxchk"
|
|
93
|
+
autoload :Excode39, "zint/excode39"
|
|
94
|
+
autoload :Fim, "zint/fim"
|
|
95
|
+
autoload :Flat, "zint/flat"
|
|
96
|
+
autoload :GridMatrix, "zint/grid_matrix"
|
|
97
|
+
autoload :Gs1_128, "zint/gs1_128"
|
|
98
|
+
autoload :Hanxin, "zint/hanxin"
|
|
99
|
+
autoload :Hibc128, "zint/hibc128"
|
|
100
|
+
autoload :Hibc39, "zint/hibc39"
|
|
101
|
+
autoload :HibcAztec, "zint/hibcaztec"
|
|
102
|
+
autoload :HibcBlockf, "zint/hibcblockf"
|
|
103
|
+
autoload :HibcDm, "zint/hibcdm"
|
|
104
|
+
autoload :HibcMicpdf, "zint/hibcmicpdf"
|
|
105
|
+
autoload :HibcPdf, "zint/hibcpdf"
|
|
106
|
+
autoload :HibcQr, "zint/hibcqr"
|
|
107
|
+
autoload :Isbnx, "zint/isbnx"
|
|
108
|
+
autoload :Itf14, "zint/itf14"
|
|
109
|
+
autoload :JapanPost, "zint/japan_post"
|
|
110
|
+
autoload :Kix, "zint/kix"
|
|
111
|
+
autoload :KoreaPost, "zint/korea_post"
|
|
112
|
+
autoload :Logmars, "zint/logmars"
|
|
113
|
+
autoload :Mailmark, "zint/mailmark"
|
|
114
|
+
autoload :Mailmark2D, "zint/mailmark_2d"
|
|
115
|
+
autoload :Mailmark4S, "zint/mailmark_4s"
|
|
116
|
+
autoload :MaxiCode, "zint/maxi_code"
|
|
117
|
+
autoload :MicroPdf417, "zint/micro_pdf417"
|
|
118
|
+
autoload :MicroQr, "zint/micro_qr"
|
|
119
|
+
autoload :MsiPlessey, "zint/msiplessey"
|
|
120
|
+
autoload :NoAscii, "zint/noascii"
|
|
121
|
+
autoload :Nve18, "zint/nve18"
|
|
122
|
+
autoload :OneCode, "zint/one_code"
|
|
123
|
+
autoload :Pdf417, "zint/pdf417"
|
|
124
|
+
autoload :Pdf417comp, "zint/pdf417comp"
|
|
125
|
+
autoload :Pdf417trunc, "zint/pdf417trunc"
|
|
126
|
+
autoload :Pharma, "zint/pharma"
|
|
127
|
+
autoload :PharmaTwo, "zint/pharmatwo"
|
|
128
|
+
autoload :Planet, "zint/planet"
|
|
129
|
+
autoload :Plessey, "zint/plessey"
|
|
130
|
+
autoload :Postnet, "zint/postnet"
|
|
131
|
+
autoload :Pzn, "zint/pzn"
|
|
132
|
+
autoload :Qr, "zint/qr"
|
|
133
|
+
autoload :Rmqr, "zint/rmqr"
|
|
134
|
+
autoload :Rss14, "zint/rss14"
|
|
135
|
+
autoload :Rss14stack, "zint/rss14stack"
|
|
136
|
+
autoload :Rss14stackOmni, "zint/rss14stackomni"
|
|
137
|
+
autoload :RssExp, "zint/rssexp"
|
|
138
|
+
autoload :RssExpstack, "zint/rssexpstack"
|
|
139
|
+
autoload :RssLtd, "zint/rssltd"
|
|
140
|
+
autoload :Stdout, "zint/stdout"
|
|
141
|
+
autoload :Telepen, "zint/telepen"
|
|
142
|
+
autoload :TelepenNum, "zint/telepennum"
|
|
143
|
+
autoload :Ultra, "zint/ultra"
|
|
144
|
+
autoload :UpcA, "zint/upc_a"
|
|
145
|
+
autoload :UpcAChk, "zint/upc_a_chk"
|
|
146
|
+
autoload :UpcE, "zint/upc_e"
|
|
147
|
+
autoload :UpcEChk, "zint/upc_e_chk"
|
|
148
|
+
autoload :Upnqr, "zint/upnqr"
|
|
149
|
+
autoload :UpuS10, "zint/upu_s10"
|
|
150
|
+
autoload :UspsImail, "zint/uspsimail"
|
|
151
|
+
autoload :Vin, "zint/vin"
|
|
152
|
+
|
|
153
|
+
class Error < StandardError; end
|
|
154
|
+
|
|
155
|
+
ERROR_CLASS_FOR_RESULT = {}
|
|
156
|
+
|
|
157
|
+
# Define an exception class for each error code
|
|
158
|
+
ERRORS.to_h.each do |k, v|
|
|
159
|
+
klass = Class.new(Error)
|
|
160
|
+
klass.send(:define_method, :code) { v }
|
|
161
|
+
klass_name = k.to_s.split("_").collect(&:capitalize).join
|
|
162
|
+
const_set(klass_name, klass)
|
|
163
|
+
ERROR_CLASS_FOR_RESULT[v] = klass
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Returns library version of the current zint
|
|
167
|
+
#
|
|
168
|
+
# @return [Integer] library version
|
|
169
|
+
def self.library_version
|
|
170
|
+
Native.ZBarcode_Version
|
|
171
|
+
end
|
|
172
|
+
end
|
data/ruby-zint.gemspec
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require_relative "lib/zint/version"
|
|
2
|
+
require_relative "lib/zint/dependencies"
|
|
3
|
+
|
|
4
|
+
Gem::Specification.new do |spec|
|
|
5
|
+
spec.name = "ruby-zint"
|
|
6
|
+
spec.version = Zint::VERSION
|
|
7
|
+
spec.authors = ["Elias Fröhner", "Lars Kanis"]
|
|
8
|
+
spec.email = ["apiwalker96@gmail.com", "lars@greiz-reinsdorf.de"]
|
|
9
|
+
|
|
10
|
+
spec.summary = "Ruby FFI binding for libzint"
|
|
11
|
+
spec.homepage = "https://github.com/eliasfroehner/ruby-zint"
|
|
12
|
+
spec.license = "MIT"
|
|
13
|
+
spec.required_ruby_version = ">= 3.0.0"
|
|
14
|
+
|
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
16
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/eliasfroehner/ruby-zint/blob/master/CHANGELOG.md"
|
|
18
|
+
spec.metadata["msys2_mingw_dependencies"] = "cmake libpng"
|
|
19
|
+
spec.metadata["documentation_uri"] = "https://rubydoc.info/gems/ruby-zint"
|
|
20
|
+
|
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
23
|
+
spec.files = Dir.chdir(__dir__) do
|
|
24
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
|
25
|
+
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor .standard.yml .rspec Rakefile Gemfile rakelib])
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
spec.files << "ports/archives/zlib-#{Zint::LIBZ_VERSION}.tar.gz"
|
|
29
|
+
spec.files << "ports/archives/libpng-#{Zint::LIBPNG_VERSION}.tar.xz"
|
|
30
|
+
spec.files << "ports/archives/zint-#{Zint::ZINT_VERSION}-src.tar.gz"
|
|
31
|
+
|
|
32
|
+
spec.require_paths = ["lib"]
|
|
33
|
+
spec.extensions = ["ext/ruby-zint/extconf.rb"]
|
|
34
|
+
|
|
35
|
+
spec.add_dependency "ffi", "~> 1.15"
|
|
36
|
+
spec.add_dependency "mini_portile2", Zint::MINI_PORTILE_VERSION
|
|
37
|
+
|
|
38
|
+
yardopts = File.read(".yardopts")
|
|
39
|
+
spec.rdoc_options = ["--main", "README.md",
|
|
40
|
+
"--title", "Ruby FFI binding for libzint",
|
|
41
|
+
"--exclude", "/ext.ruby-zint/"]
|
|
42
|
+
docfiles = yardopts.lines.map(&:strip).select { |r| r =~ /^[^-]/ }
|
|
43
|
+
spec.extra_rdoc_files = `git ls-files -z #{docfiles.join(" ")}`.split("\x0")
|
|
44
|
+
end
|
data.tar.gz.sig
ADDED
|
Binary file
|