sapos-print 1.1.1 → 1.1.2

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: 9efee936fd5ce8384e2d893f19802b36fddf950dd3a7dc9a19f2c2aa075a2ea7
4
- data.tar.gz: 1f7dc058f121b6711c98673c391560c4959042492b120bc3b37ca5e1a732e609
3
+ metadata.gz: 0c0a29b86357ada2f1116d8f2012c74f99264d3a34f740ce12f65e528f959487
4
+ data.tar.gz: d9515bce72b57773fb6f88a52c0485e95cd5eda5a4bd164a3489dff5081cb55c
5
5
  SHA512:
6
- metadata.gz: a94fbcb1e6fccdcc38579c1d1125e13b521bb87d5cdc0faa8e5d604e40cb300dae76fced7ae65e772f43476254b2bfaf1255849373a119073065ff9d13d2b180
7
- data.tar.gz: 805d382cf37df0f32628784daab89238717ce85fa616b8ea4b34a7fa02118b4fd942769147009a22b84fd3fcc1e81bcee77b17ae51a765e910546d1b580846e1
6
+ metadata.gz: 0cd5690622d9c0384549cdc61f664768122243c8b184bc9be36b9d321e913552d1d0758893e4589f94d95d4b93f935bdedf0ccd07492cbfc68aabe1a25ab7f31
7
+ data.tar.gz: e4108effa15449ccaed23a93787369d20e54ceab92ee690b503f7969fc621bf6444621c4399f4568932298d3c87534e930a02e6dde5f3f173ecaeac0a33d1dcb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sapos-print (1.1.0)
4
+ sapos-print (1.1.1)
5
5
  activesupport (~> 6.1)
6
6
  awesome_print
7
7
  json
@@ -26,38 +26,38 @@ GEM
26
26
  concurrent-ruby (~> 1.1.5)
27
27
  domain_name (0.5.20190701)
28
28
  unf (>= 0.0.5, < 1.0.0)
29
- dry-configurable (1.0.1)
30
- dry-core (~> 1.0, < 2)
29
+ dry-configurable (0.16.1)
30
+ dry-core (~> 0.6)
31
31
  zeitwerk (~> 2.6)
32
- dry-core (1.0.0)
32
+ dry-container (0.11.0)
33
33
  concurrent-ruby (~> 1.0)
34
- zeitwerk (~> 2.6)
35
- dry-inflector (1.0.0)
36
- dry-initializer (3.1.1)
37
- dry-logic (1.5.0)
34
+ dry-core (0.9.1)
38
35
  concurrent-ruby (~> 1.0)
39
- dry-core (~> 1.0, < 2)
40
36
  zeitwerk (~> 2.6)
41
- dry-schema (1.13.2)
37
+ dry-inflector (0.2.1)
38
+ dry-initializer (3.0.4)
39
+ dry-logic (1.2.0)
40
+ concurrent-ruby (~> 1.0)
41
+ dry-core (~> 0.5, >= 0.5)
42
+ dry-schema (1.8.0)
42
43
  concurrent-ruby (~> 1.0)
43
- dry-configurable (~> 1.0, >= 1.0.1)
44
- dry-core (~> 1.0, < 2)
44
+ dry-configurable (~> 0.13, >= 0.13.0)
45
+ dry-core (~> 0.5, >= 0.5)
45
46
  dry-initializer (~> 3.0)
46
- dry-logic (>= 1.4, < 2)
47
- dry-types (>= 1.7, < 2)
48
- zeitwerk (~> 2.6)
49
- dry-types (1.7.1)
47
+ dry-logic (~> 1.0)
48
+ dry-types (~> 1.5)
49
+ dry-types (1.5.1)
50
50
  concurrent-ruby (~> 1.0)
51
- dry-core (~> 1.0)
52
- dry-inflector (~> 1.0)
53
- dry-logic (~> 1.4)
54
- zeitwerk (~> 2.6)
55
- dry-validation (1.10.0)
51
+ dry-container (~> 0.3)
52
+ dry-core (~> 0.5, >= 0.5)
53
+ dry-inflector (~> 0.1, >= 0.1.2)
54
+ dry-logic (~> 1.0, >= 1.0.2)
55
+ dry-validation (1.7.0)
56
56
  concurrent-ruby (~> 1.0)
57
- dry-core (~> 1.0, < 2)
57
+ dry-container (~> 0.7, >= 0.7.1)
58
+ dry-core (~> 0.5, >= 0.5)
58
59
  dry-initializer (~> 3.0)
59
- dry-schema (>= 1.12, < 2)
60
- zeitwerk (~> 2.6)
60
+ dry-schema (~> 1.8, >= 1.8.0)
61
61
  http-accept (1.7.0)
62
62
  http-cookie (1.0.5)
63
63
  domain_name (~> 0.5)
@@ -68,7 +68,7 @@ GEM
68
68
  mime-types (3.4.1)
69
69
  mime-types-data (~> 3.2015)
70
70
  mime-types-data (3.2023.0218.1)
71
- minitest (5.18.1)
71
+ minitest (5.18.0)
72
72
  netrc (0.11.0)
73
73
  public_suffix (5.0.1)
74
74
  pubnub (4.8.0)
@@ -85,13 +85,13 @@ GEM
85
85
  mime-types (>= 1.16, < 4.0)
86
86
  netrc (~> 0.8)
87
87
  thor (1.2.2)
88
- timers (4.3.5)
88
+ timers (4.3.3)
89
89
  tzinfo (2.0.6)
90
90
  concurrent-ruby (~> 1.0)
91
91
  unf (0.1.4)
92
92
  unf_ext
93
93
  unf_ext (0.0.8.2)
94
- zeitwerk (2.6.8)
94
+ zeitwerk (2.6.7)
95
95
 
96
96
  PLATFORMS
97
97
  arm64-darwin-21
@@ -6,7 +6,7 @@ module Sapos
6
6
  module Print
7
7
  class Configuration
8
8
 
9
- attr_accessor :printer, :adapter, :interface, :q, :key, :emv_path, :emv_terminal, :user_id, :verbose, :duplicate_control, :cache, :printers, :verbose
9
+ attr_accessor :printer, :adapter, :interface, :q, :key, :emv_path, :emv_terminal, :user_id, :verbose, :duplicate_control, :cache, :printers
10
10
 
11
11
  def self.write(args = {})
12
12
  config_file = "#{Sapos::Print.app_directory}/config.yml"
@@ -3,11 +3,16 @@ module Sapos
3
3
  class Printer
4
4
 
5
5
  attr_accessor :config
6
+ attr_accessor :name
6
7
 
7
8
  def initialize(config)
8
9
  @config = config
9
10
  end
10
11
 
12
+ def to_h
13
+ {config: config.printer}
14
+ end
15
+
11
16
  def print(args = {})
12
17
  raw_message = args[:document]
13
18
 
@@ -21,21 +21,23 @@ module Sapos
21
21
  document_number = nil
22
22
 
23
23
  puts msg.inspect if reader.config.verbose
24
-
24
+
25
+ printer_name = nil
25
26
  if msg.is_a?(Hash)
26
27
  print_control = msg['print_control']
27
28
  document_number = msg['document_number']
29
+ printer_name = msg["printer"]
28
30
  msg = msg['document']
29
31
  end
30
32
 
31
33
  document = Base64.decode64(msg)
32
34
 
33
35
  current_printer = reader.printer
34
- printer_name = 'default'
35
- if msg['printer'] && reader.printers[msg['printer']]
36
- printer_name = msg['printer']
37
- current_printer = reader.printers[msg['printer']]
36
+
37
+ if printer_name && reader.printers[printer_name]
38
+ current_printer = reader.printers[printer_name]
38
39
  end
40
+ puts "Printer Config: #{current_printer.to_h}" if reader.config.verbose
39
41
 
40
42
  if !current_printer.print(document: document, print_control: print_control, document_number: document_number, id: msgid, printer: printer_name)
41
43
  puts "Printer Error"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sapos
4
4
  module Print
5
- VERSION = "1.1.1"
5
+ VERSION = "1.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sapos-print
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Sauter
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubygems_version: 3.2.3
141
+ rubygems_version: 3.1.4
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: SAPOSCLOUD PRINT