escpos 0.0.9 → 0.0.10
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/.gitlab-ci.yml +7 -0
- data/README.md +12 -0
- data/lib/escpos/printer.rb +6 -0
- data/lib/escpos/version.rb +1 -1
- data/test/lib/escpos/printer_test.rb +3 -1
- data/test/lib/escpos/report_test.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78b50a9ab0d75e8dbfccded3e7d2730621b406c4a0d4d63ec46cad94feac3247
|
4
|
+
data.tar.gz: 28c4e5baa3ab338bdf44b231a4fbe42e00d3a834d07d1e75157f82496e12ab27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b8a177454538538450bd383bd6769ffff3e117a5903dd56b786532c84dc0a1cb8ed89d1d7be0c13f38400513d352b3b9b99704cd62625eb15a1203aff07316b
|
7
|
+
data.tar.gz: aba4077ad84a45c94bb58762524c3437c37ffe504c1ca725a1f7ee905040bbe110d6a3c543359ea199107718488714df89a0621f34ec5757c16506ab718bdbf0
|
data/.gitlab-ci.yml
CHANGED
@@ -8,6 +8,13 @@ stages:
|
|
8
8
|
- test
|
9
9
|
|
10
10
|
before_script:
|
11
|
+
- apt-get update
|
12
|
+
- apt-get install -y locales
|
13
|
+
- echo "en_US UTF-8" > /etc/locale.gen
|
14
|
+
- locale-gen en_US.UTF-8
|
15
|
+
- export LANG=en_US.UTF-8
|
16
|
+
- export LANGUAGE=en_US:en
|
17
|
+
- export LC_ALL=en_US.UTF-8
|
11
18
|
- ruby -v
|
12
19
|
- bundle -v
|
13
20
|
- bundle install --jobs $(nproc) --path vendor
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[Build Status](https://gitlab.com/escpos/escpos/pipelines)
|
2
|
+
|
1
3
|
# Escpos
|
2
4
|
|
3
5
|
A ruby implementation of ESC/POS (thermal) printer command specification.
|
@@ -30,12 +32,22 @@ https://github.com/escpos/escpos-image
|
|
30
32
|
```ruby
|
31
33
|
# Add this line to your application's Gemfile if you want to print images
|
32
34
|
gem 'escpos-image'
|
35
|
+
# And depending on your image processor of choice
|
36
|
+
gem 'mini_magick'
|
37
|
+
# or
|
38
|
+
gem 'chunky_png'
|
33
39
|
```
|
34
40
|
Or install it yourself as:
|
35
41
|
```
|
36
42
|
gem install escpos-image
|
43
|
+
# and then depending on your image processor of choice
|
44
|
+
gem install mini_magick
|
45
|
+
# or
|
46
|
+
gem install chunky_png
|
37
47
|
```
|
38
48
|
|
49
|
+
__For more information about image processors, their options and supported formats please see https://github.com/escpos/escpos-image readme file.__
|
50
|
+
|
39
51
|
## Examples
|
40
52
|
|
41
53
|

|
data/lib/escpos/printer.rb
CHANGED
data/lib/escpos/version.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative '../../test_helper'
|
2
2
|
|
3
3
|
class PrinterTest < Minitest::Test
|
4
|
+
|
4
5
|
def setup
|
5
6
|
@printer = Escpos::Printer.new
|
6
7
|
end
|
@@ -12,7 +13,8 @@ class PrinterTest < Minitest::Test
|
|
12
13
|
@printer << result
|
13
14
|
@printer.cut!
|
14
15
|
file = File.join(__dir__, "../../results/#{__method__}.txt")
|
15
|
-
|
16
|
+
#@printer.save file
|
17
|
+
|
16
18
|
assert_equal IO.binread(file), @printer.to_escpos
|
17
19
|
end
|
18
20
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative '../../test_helper'
|
2
2
|
|
3
3
|
class TestReport < Minitest::Test
|
4
|
+
|
4
5
|
def setup
|
5
6
|
@printer = Escpos::Printer.new
|
6
7
|
end
|
@@ -24,7 +25,8 @@ class TestReport < Minitest::Test
|
|
24
25
|
@printer << report.render
|
25
26
|
@printer.cut!
|
26
27
|
file = File.join(__dir__, "../../results/#{__method__}.txt")
|
27
|
-
|
28
|
+
#@printer.save file
|
29
|
+
|
28
30
|
assert_equal IO.binread(file), @printer.to_escpos
|
29
31
|
end
|
30
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: escpos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Svoboda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|