escpos 0.0.9 → 0.0.10

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
  SHA256:
3
- metadata.gz: f12f7b1678273bcd3b2c08172d70ef2adb7ef8d166a6dc008eee50986759b92e
4
- data.tar.gz: 3623dd3bbd6a560545882e8c2449525bd03774244e3a6e9b45ac801850d82d65
3
+ metadata.gz: 78b50a9ab0d75e8dbfccded3e7d2730621b406c4a0d4d63ec46cad94feac3247
4
+ data.tar.gz: 28c4e5baa3ab338bdf44b231a4fbe42e00d3a834d07d1e75157f82496e12ab27
5
5
  SHA512:
6
- metadata.gz: 951c55a10e3c72f0f31e05d8abb63d351d2947d7b2f3419a06f028570d30177e15cec57689da7ac95ac024598f31c1dfd678903283c7dc1ce38082023cea1d1d
7
- data.tar.gz: 1bceefc51522a00fe8dedfbc66aced270bda291ec5f2bb7da109964959792c9ee4777f740b294f2ad94eb0a5d169a4c56220520d6df599003e64bfc7d9aecf10
6
+ metadata.gz: 1b8a177454538538450bd383bd6769ffff3e117a5903dd56b786532c84dc0a1cb8ed89d1d7be0c13f38400513d352b3b9b99704cd62625eb15a1203aff07316b
7
+ data.tar.gz: aba4077ad84a45c94bb58762524c3437c37ffe504c1ca725a1f7ee905040bbe110d6a3c543359ea199107718488714df89a0621f34ec5757c16506ab718bdbf0
@@ -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
  ![](https://github.com/escpos/escpos/blob/master/examples/IMG_20160608_001339_HDR.jpg)
@@ -23,6 +23,12 @@ module Escpos
23
23
  @data << Escpos.sequence(PAPER_FULL_CUT)
24
24
  end
25
25
 
26
+ def save(path)
27
+ File.open(path, "wb") do |f|
28
+ f.print to_escpos
29
+ end
30
+ end
31
+
26
32
  def to_escpos
27
33
  @data
28
34
  end
@@ -1,3 +1,3 @@
1
1
  module Escpos
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -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
- #IO.binwrite file, @printer.to_escpos
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
- #IO.binwrite file, @printer.to_escpos
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.9
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-23 00:00:00.000000000 Z
11
+ date: 2019-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler