sapos-print 1.1.2 → 1.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c0a29b86357ada2f1116d8f2012c74f99264d3a34f740ce12f65e528f959487
4
- data.tar.gz: d9515bce72b57773fb6f88a52c0485e95cd5eda5a4bd164a3489dff5081cb55c
3
+ metadata.gz: 397a8d310cfc4a8f6299f7e3ec9157290c0a840c2738ff5e2208c8aeb45337ec
4
+ data.tar.gz: 98c4ed59f8606fce18446340d077f1e41930c256a3278f7b27b713b9c654040d
5
5
  SHA512:
6
- metadata.gz: 0cd5690622d9c0384549cdc61f664768122243c8b184bc9be36b9d321e913552d1d0758893e4589f94d95d4b93f935bdedf0ccd07492cbfc68aabe1a25ab7f31
7
- data.tar.gz: e4108effa15449ccaed23a93787369d20e54ceab92ee690b503f7969fc621bf6444621c4399f4568932298d3c87534e930a02e6dde5f3f173ecaeac0a33d1dcb
6
+ metadata.gz: 61fe8e46842eb10bd29985d11a5ec1dc64207c5778979ee612460e8d0678a5c0a2e26f86407aaf82ee3e853919318033f6bde8ac9904ae5baa3fdcce5c1df9e9
7
+ data.tar.gz: 3426f8b36537d04b3106278173862690cf0f0e934f59c0d97834df5d8152f6cf3f4263107b04db95f27967904db99eb7111399d1a0cbb42110a55664160afb77
@@ -37,10 +37,13 @@ module Sapos
37
37
  config[:user_id] = user_id
38
38
  config[:duplicate_control] = ask("¿Control Duplicados por MSGID?", limited_to: ["si", "no"])
39
39
  config[:printers] = [config[:printer]]
40
+ config[:interfaces] = [config[:interface]]
40
41
 
41
42
  while yes?("¿Tiene impresoras adicionales?")
42
43
  name = ask("Nombre de la impresora adicional: ")
44
+ interface = ask("Interfaz de la impresora adicional: ", limited_to: ["text", "escp"])
43
45
  config[:printers] << name
46
+ config[:interfaces] << interface
44
47
  end
45
48
  if yes?("¿Esta seguro que desea guardar la configuración?")
46
49
  Sapos::Print::Configuration.write(config)
@@ -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
9
+ attr_accessor :printer, :adapter, :interface, :q, :key, :emv_path, :emv_terminal, :user_id, :verbose, :duplicate_control, :cache, :printers, :interfaces
10
10
 
11
11
  def self.write(args = {})
12
12
  config_file = "#{Sapos::Print.app_directory}/config.yml"
@@ -20,6 +20,7 @@ module Sapos
20
20
  result = YAML.load(template.result(binding))
21
21
  @printer = result[:printer]
22
22
  @printers = result[:printers] || []
23
+ @interfaces = result[:interfaces] || []
23
24
  @adapter = result[:adapter]
24
25
  @interface = result[:interface]
25
26
  @q = result[:q]
@@ -52,7 +53,7 @@ module Sapos
52
53
  end
53
54
 
54
55
  def to_h
55
- {printer: @printer, adapter: @adapter, interface: @interface, q: @q, key: @key, emv_path: @emv_path, emv_terminal: @emv_terminal, user_id: @user_id, duplicate_control: @duplicate_control, printers: @printers }
56
+ {printer: @printer, adapter: @adapter, interface: @interface, q: @q, key: @key, emv_path: @emv_path, emv_terminal: @emv_terminal, user_id: @user_id, duplicate_control: @duplicate_control, printers: @printers, interfaces: @interfaces }
56
57
  end
57
58
  end
58
59
  end
@@ -61,9 +61,10 @@ module Sapos
61
61
  @config = QReader.printer_config
62
62
  @printer = Printer.new(@config)
63
63
  @printers = {}
64
- @config.printers.each do |printer|
64
+ @config.printers.each_with_index do |printer, idx|
65
65
  config = @config.dup
66
66
  config.printer = printer
67
+ config.interface = @config.interfaces[idx]
67
68
  @printers[printer] = Printer.new(config)
68
69
  end
69
70
  @pubnub = Pubnub.new(subscribe_key: @config.key, user_id: @config.user_id, ssl: true)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sapos
4
4
  module Print
5
- VERSION = "1.1.2"
5
+ VERSION = "1.1.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sapos-print
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Sauter
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-19 00:00:00.000000000 Z
11
+ date: 2023-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -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.1.4
141
+ rubygems_version: 3.2.3
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: SAPOSCLOUD PRINT