rails_admin_telnet_print 1.2.11 → 1.2.12
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 +4 -4
- data/app/jobs/print_it_job.rb +5 -4
- data/lib/rails_admin_telnet_print/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d89dc05a824271ecf4192b6319253f20d6f5c3fc
|
4
|
+
data.tar.gz: 58292e0896102ad66d92551be15c0448a1184a63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fab57f772228e0ba132515944bde290bc4c4354c72c60edf9807971998d2a1fc3a63e06ff38c5c97acd822fc8f483670de0dd8b8d25d01c8286741dc17a368f
|
7
|
+
data.tar.gz: b95c5a9107937181663a61e4799700cd7c1a244ed0d8af1dda14b79343663f74800b186941c67bd9b68630f16a960fd7379631605c00650432361eb44a81da8d
|
data/app/jobs/print_it_job.rb
CHANGED
@@ -13,7 +13,7 @@ class PrintItJob < ApplicationJob
|
|
13
13
|
# Do something later
|
14
14
|
printer = Printer.find(printer_id.to_i)
|
15
15
|
print_template = printer.print_template
|
16
|
-
Rails.logger.info "PrintItJob: PRINTING MODEL: #{model_name
|
16
|
+
Rails.logger.info "PrintItJob: PRINTING MODEL: #{model_name}"
|
17
17
|
header = model_name.constantize.find(id)
|
18
18
|
items = header.records_for_print(id).order(code: :asc)
|
19
19
|
|
@@ -25,14 +25,14 @@ class PrintItJob < ApplicationJob
|
|
25
25
|
# Rails.logger.info "ITEMGROUP: #{item_group.inspect}"
|
26
26
|
barcodes = item_group.map(&:id)
|
27
27
|
barcodes = barcodes.fill("", barcodes.length..(print_template.number_of_barcodes - 1)) if print_template.number_of_barcodes > barcodes.length
|
28
|
-
|
28
|
+
Rails.logger.info "PrintItJob: PASSING THESE IDs TO TEMPLATE: #{barcodes.inspect}"
|
29
29
|
pivot.push print_template.translate(header: header, items: barcodes, temperature: printer.temperature)
|
30
30
|
# Rails.logger.info "BARCODES: #{barcodes.inspect}"
|
31
31
|
# Se il risultato è un errore, allora mi fermo completamente e loggo il numero di particolari stampati
|
32
32
|
# Rails.logger.info "RISULTATO: #{result}"
|
33
33
|
end
|
34
34
|
|
35
|
-
Rails.logger.info "PrintItJob: SENDING TO PRINTER, TEXT TO PRINT IS:\n #{pivot.inspect}"
|
35
|
+
# Rails.logger.info "PrintItJob: SENDING TO PRINTER, TEXT TO PRINT IS:\n #{pivot.inspect}"
|
36
36
|
result = pivot.empty? ? false : send_to_printer(printer.ip, pivot.join(""))
|
37
37
|
@pjob.update(printed: (result ? pivot.length : 0)) # Se risultato true, allora ha stampato tutto, altrimenti non ha stampato nulla
|
38
38
|
@pjob.update(total: pivot.length) # In realtà è inutile, ora manda tutto quello che può alla stampante, solo lei può andare storta
|
@@ -74,7 +74,7 @@ class PrintItJob < ApplicationJob
|
|
74
74
|
break if response.count == 3
|
75
75
|
end
|
76
76
|
s.close
|
77
|
-
Rails.logger.info response.inspect
|
77
|
+
Rails.logger.info "PrintIt: RESPONSE: #{response.inspect}"
|
78
78
|
first = response[0].split(",")
|
79
79
|
second = response[1].split(",")
|
80
80
|
return "HEAD UP" if second[2].to_i == 1
|
@@ -83,6 +83,7 @@ class PrintItJob < ApplicationJob
|
|
83
83
|
return "PAUSE" if first[2].to_i == 1
|
84
84
|
return "OK"
|
85
85
|
rescue
|
86
|
+
Rails.logger.info "PrintIt: STATUS: UNREACHABLE"
|
86
87
|
return "UNREACHABLE"
|
87
88
|
end
|
88
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_telnet_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore
|