sapos-print 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sapos/print/cli.rb +3 -0
- data/lib/sapos/print/configuration.rb +3 -2
- data/lib/sapos/print/q_reader.rb +2 -1
- data/lib/sapos/print/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 397a8d310cfc4a8f6299f7e3ec9157290c0a840c2738ff5e2208c8aeb45337ec
|
4
|
+
data.tar.gz: 98c4ed59f8606fce18446340d077f1e41930c256a3278f7b27b713b9c654040d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61fe8e46842eb10bd29985d11a5ec1dc64207c5778979ee612460e8d0678a5c0a2e26f86407aaf82ee3e853919318033f6bde8ac9904ae5baa3fdcce5c1df9e9
|
7
|
+
data.tar.gz: 3426f8b36537d04b3106278173862690cf0f0e934f59c0d97834df5d8152f6cf3f4263107b04db95f27967904db99eb7111399d1a0cbb42110a55664160afb77
|
data/lib/sapos/print/cli.rb
CHANGED
@@ -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
|
data/lib/sapos/print/q_reader.rb
CHANGED
@@ -61,9 +61,10 @@ module Sapos
|
|
61
61
|
@config = QReader.printer_config
|
62
62
|
@printer = Printer.new(@config)
|
63
63
|
@printers = {}
|
64
|
-
@config.printers.
|
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)
|
data/lib/sapos/print/version.rb
CHANGED
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.
|
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-
|
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.
|
141
|
+
rubygems_version: 3.2.3
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: SAPOSCLOUD PRINT
|