thecore_print_commons 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/workers/print_worker.rb +2 -1
- data/lib/thecore_print_commons/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d76e9416ec4e1cbc10a87b927cb211fcd07f9b42
|
4
|
+
data.tar.gz: 91028fc14cd84f204ebae675aff061d31dab4409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb8574caf0b73b56e525b5f799c58b6ec3465b01cb212861bec63ed434e797a208b12f3f91ba955cc49448f19b69127417a3884acd3a7cf612d78f36be98f515
|
7
|
+
data.tar.gz: 0277de4dbac6f75f6dcadf9864c22bcdb27c90e7672054f67d119f538c4dba7a264f6c8afbabf07bec9ce90b820f7fcbdd5d5a0844bf0c0c0d38541410f5399f
|
data/app/workers/print_worker.rb
CHANGED
@@ -5,12 +5,13 @@ class PrintWorker
|
|
5
5
|
if Settings.ns(:printer_commons).cups_server.blank? || ['127.0.0.1', 'localhost'].contains(Settings.ns(:printer_commons).cups_server)
|
6
6
|
printer = CupsPrinter.new printer_cups_name
|
7
7
|
printer.print_data text, 'text/plain'
|
8
|
+
printer.close
|
8
9
|
else
|
9
10
|
print_file = "/tmp/print-#{printer_cups_name}-#{Time.now.strftime '%Y%m%d%H%M%S%L'}"
|
10
11
|
IO.write(print_file, text)
|
11
12
|
# CupsPrinter.new printer_cups_name, hostname: Settings.ns(:printer_commons).cups_server
|
12
13
|
# printer.print_data text, 'text/plain', hostname: Settings.ns(:printer_commons).cups_server
|
13
|
-
`lp -d "#{printer_cups_name}" -h #{Settings.ns(:printer_commons).cups_server} -o raw #{print_file}`
|
14
|
+
`lp -d "#{printer_cups_name}" -h "#{Settings.ns(:printer_commons).cups_server}" -o raw "#{print_file}"`
|
14
15
|
File.delete print_file
|
15
16
|
end
|
16
17
|
end
|