sapos-print 1.1.0 → 1.1.1

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: cc0f0e2c23bfce7306d2f9ad61b8c22133ea9a899bfbe7715ad412742e3dc0d1
4
- data.tar.gz: 50c06d2cc61e089350ac62b05317d1ad894cf25debe67aba26baa6ddf0b14e35
3
+ metadata.gz: 9efee936fd5ce8384e2d893f19802b36fddf950dd3a7dc9a19f2c2aa075a2ea7
4
+ data.tar.gz: 1f7dc058f121b6711c98673c391560c4959042492b120bc3b37ca5e1a732e609
5
5
  SHA512:
6
- metadata.gz: bfe1ac23eb6b6696a3f97ee41d5574014e7979fc73735b3befec56c39c5e189d5175111da32e488cda1d9e7525d45a6950cbde53865fcfdfdfd7912714711ab5
7
- data.tar.gz: 0fd6bd0aa7a28908221f6ed4a8f08666138542be8d6ae5d728840ede8a06da3f8c9d1e1a9a06a0696862a083a70b8503721ee0caf30c19940deff0e2f9eace03
6
+ metadata.gz: a94fbcb1e6fccdcc38579c1d1125e13b521bb87d5cdc0faa8e5d604e40cb300dae76fced7ae65e772f43476254b2bfaf1255849373a119073065ff9d13d2b180
7
+ data.tar.gz: 805d382cf37df0f32628784daab89238717ce85fa616b8ea4b34a7fa02118b4fd942769147009a22b84fd3fcc1e81bcee77b17ae51a765e910546d1b580846e1
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sapos-print (1.0.10)
5
- activesupport
4
+ sapos-print (1.1.0)
5
+ activesupport (~> 6.1)
6
6
  awesome_print
7
7
  json
8
8
  pubnub (~> 4.8.0)
@@ -12,12 +12,13 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (7.0.3)
15
+ activesupport (6.1.7.3)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 1.6, < 2)
18
18
  minitest (>= 5.1)
19
19
  tzinfo (~> 2.0)
20
- addressable (2.8.1)
20
+ zeitwerk (~> 2.3)
21
+ addressable (2.8.4)
21
22
  public_suffix (>= 2.0.2, < 6.0)
22
23
  awesome_print (1.9.2)
23
24
  concurrent-ruby (1.1.10)
@@ -25,49 +26,49 @@ GEM
25
26
  concurrent-ruby (~> 1.1.5)
26
27
  domain_name (0.5.20190701)
27
28
  unf (>= 0.0.5, < 1.0.0)
28
- dry-configurable (0.16.1)
29
- dry-core (~> 0.6)
29
+ dry-configurable (1.0.1)
30
+ dry-core (~> 1.0, < 2)
30
31
  zeitwerk (~> 2.6)
31
- dry-container (0.11.0)
32
- concurrent-ruby (~> 1.0)
33
- dry-core (0.9.1)
32
+ dry-core (1.0.0)
34
33
  concurrent-ruby (~> 1.0)
35
34
  zeitwerk (~> 2.6)
36
- dry-inflector (0.2.1)
35
+ dry-inflector (1.0.0)
37
36
  dry-initializer (3.1.1)
38
- dry-logic (1.2.0)
37
+ dry-logic (1.5.0)
39
38
  concurrent-ruby (~> 1.0)
40
- dry-core (~> 0.5, >= 0.5)
41
- dry-schema (1.8.0)
39
+ dry-core (~> 1.0, < 2)
40
+ zeitwerk (~> 2.6)
41
+ dry-schema (1.13.2)
42
42
  concurrent-ruby (~> 1.0)
43
- dry-configurable (~> 0.13, >= 0.13.0)
44
- dry-core (~> 0.5, >= 0.5)
43
+ dry-configurable (~> 1.0, >= 1.0.1)
44
+ dry-core (~> 1.0, < 2)
45
45
  dry-initializer (~> 3.0)
46
- dry-logic (~> 1.0)
47
- dry-types (~> 1.5)
48
- dry-types (1.5.1)
46
+ dry-logic (>= 1.4, < 2)
47
+ dry-types (>= 1.7, < 2)
48
+ zeitwerk (~> 2.6)
49
+ dry-types (1.7.1)
49
50
  concurrent-ruby (~> 1.0)
50
- dry-container (~> 0.3)
51
- dry-core (~> 0.5, >= 0.5)
52
- dry-inflector (~> 0.1, >= 0.1.2)
53
- dry-logic (~> 1.0, >= 1.0.2)
54
- dry-validation (1.7.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)
55
56
  concurrent-ruby (~> 1.0)
56
- dry-container (~> 0.7, >= 0.7.1)
57
- dry-core (~> 0.5, >= 0.5)
57
+ dry-core (~> 1.0, < 2)
58
58
  dry-initializer (~> 3.0)
59
- dry-schema (~> 1.8, >= 1.8.0)
59
+ dry-schema (>= 1.12, < 2)
60
+ zeitwerk (~> 2.6)
60
61
  http-accept (1.7.0)
61
62
  http-cookie (1.0.5)
62
63
  domain_name (~> 0.5)
63
64
  httpclient (2.8.3)
64
- i18n (1.12.0)
65
+ i18n (1.14.1)
65
66
  concurrent-ruby (~> 1.0)
66
67
  json (2.6.3)
67
68
  mime-types (3.4.1)
68
69
  mime-types-data (~> 3.2015)
69
- mime-types-data (3.2022.0105)
70
- minitest (5.17.0)
70
+ mime-types-data (3.2023.0218.1)
71
+ minitest (5.18.1)
71
72
  netrc (0.11.0)
72
73
  public_suffix (5.0.1)
73
74
  pubnub (4.8.0)
@@ -83,14 +84,14 @@ GEM
83
84
  http-cookie (>= 1.0.2, < 2.0)
84
85
  mime-types (>= 1.16, < 4.0)
85
86
  netrc (~> 0.8)
86
- thor (1.2.1)
87
- timers (4.3.3)
88
- tzinfo (2.0.5)
87
+ thor (1.2.2)
88
+ timers (4.3.5)
89
+ tzinfo (2.0.6)
89
90
  concurrent-ruby (~> 1.0)
90
91
  unf (0.1.4)
91
92
  unf_ext
92
93
  unf_ext (0.0.8.2)
93
- zeitwerk (2.6.6)
94
+ zeitwerk (2.6.8)
94
95
 
95
96
  PLATFORMS
96
97
  arm64-darwin-21
@@ -111,6 +111,27 @@ module Sapos
111
111
  end
112
112
  end
113
113
 
114
+ desc "test_q", "q reader test"
115
+ def test_q
116
+ config = Sapos::Print.config
117
+ puts ["Q=#{config.q.to_s}", "Printer=#{config.printer.to_s}", "Adapter=#{config.adapter.to_s}", "Interface=#{config.interface}", "DC=#{config.duplicate_control?}"].join(";")
118
+
119
+ Sapos::Print::QReader.printer_config = config
120
+ reader = QReader.new
121
+ puts reader.printer
122
+
123
+ message = {:document => "doc", :printer => "Daniel"}
124
+ ap reader.printers
125
+
126
+ Sapos::Print.config.printers.each do |p|
127
+ printer = reader.printers[p]
128
+ puts "Printing to: #{printer.config.printer}"
129
+ message[:document] = "Docu. #{p}"
130
+ printer.print(message)
131
+ end
132
+
133
+ end
134
+
114
135
  no_tasks do
115
136
  def info
116
137
  if @printed.nil?
@@ -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, :verbose
10
10
 
11
11
  def self.write(args = {})
12
12
  config_file = "#{Sapos::Print.app_directory}/config.yml"
@@ -28,6 +28,7 @@ module Sapos
28
28
  @emv_terminal = result[:emv_terminal]
29
29
  @user_id = result[:user_id]
30
30
  @duplicate_control = result[:duplicate_control]
31
+ @verbose = result[:verbose]
31
32
  @cache = []
32
33
  else
33
34
  raise Sapos::Print::Error, "Configuration is missing. Make sure to create this file: #{config_file}"
@@ -2,6 +2,7 @@ module Sapos
2
2
  module Print
3
3
  class Printer
4
4
 
5
+ attr_accessor :config
5
6
 
6
7
  def initialize(config)
7
8
  @config = config
@@ -11,6 +12,7 @@ module Sapos
11
12
  raw_message = args[:document]
12
13
 
13
14
  log_text = "id=#{args[:id]},doc=#{args[:document_number]},control=#{args[:print_control] ? "SI" : "NO"},cache=0\t"
15
+ log_text += "printer=#{args[:printer]}\t" if args[:printer]
14
16
  filename = "#{args[:document_number]}.print" if args[:document_number]
15
17
  filename = SecureRandom.hex if filename.nil?
16
18
  result = false
@@ -85,6 +87,7 @@ module Sapos
85
87
  case @config.adapter
86
88
  when 'console'
87
89
  puts "=> CONSOLE: file: #{opts[:file]}<=\n\n"
90
+ puts "=> Printer: #{@config.printer}"
88
91
  puts File.read(opts[:file])
89
92
  puts "\n=> END CONSOLE =<"
90
93
  return true
@@ -31,12 +31,13 @@ module Sapos
31
31
  document = Base64.decode64(msg)
32
32
 
33
33
  current_printer = reader.printer
34
-
34
+ printer_name = 'default'
35
35
  if msg['printer'] && reader.printers[msg['printer']]
36
+ printer_name = msg['printer']
36
37
  current_printer = reader.printers[msg['printer']]
37
38
  end
38
39
 
39
- if !current_printer.print(document: document, print_control: print_control, document_number: document_number, id: msgid)
40
+ if !current_printer.print(document: document, print_control: print_control, document_number: document_number, id: msgid, printer: printer_name)
40
41
  puts "Printer Error"
41
42
  end
42
43
  rescue => e
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sapos
4
4
  module Print
5
- VERSION = "1.1.0"
5
+ VERSION = "1.1.1"
6
6
  end
7
7
  end
data/sapos-print.gemspec CHANGED
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
40
40
  spec.add_dependency "pubnub", "~> 4.8.0"
41
41
  spec.add_dependency "rest-client"
42
42
  spec.add_dependency "awesome_print"
43
- spec.add_dependency "activesupport"
43
+ spec.add_dependency "activesupport", "~> 6.1"
44
44
  spec.add_dependency "json"
45
45
 
46
46
  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.0
4
+ version: 1.1.1
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-05-26 00:00:00.000000000 Z
11
+ date: 2023-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: activesupport
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '6.1'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '6.1'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: json
85
85
  requirement: !ruby/object:Gem::Requirement