thecore_print_commons 0.1.12 → 0.1.13
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 +12 -12
- data/lib/thecore_print_commons/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: 3a6222c67470fd3bec7f955d0bc7f58579a3ac70
|
4
|
+
data.tar.gz: be01aebb50eec29d7ca370140778f937226f3d9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83eeaf6bfd6f8fffb8a4dc0a461a21b267dbbd601c6dbfb438616ec3be804aa27949297fa223aaa3ca5330c283026f3fb29b252d114823f3b7f4ea8ac2c9de3f
|
7
|
+
data.tar.gz: 4d60f5533e6a590022ed5ee2e09392989867e6a216a1165958123f5b4cadd03ef0f2ae997eb72e59fc64752834a487759225bcf95393e9eb0d30b775652d04d7
|
data/app/workers/print_worker.rb
CHANGED
@@ -2,17 +2,17 @@ require 'ipaddr'
|
|
2
2
|
class PrintWorker
|
3
3
|
include Sidekiq::Worker
|
4
4
|
def perform printer_cups_name, text
|
5
|
-
if Settings.ns(:printer_commons).cups_server.blank? || ['127.0.0.1', 'localhost'].contains(Settings.ns(:printer_commons).cups_server)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
else
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
5
|
+
# if Settings.ns(:printer_commons).cups_server.blank? || ['127.0.0.1', 'localhost'].contains(Settings.ns(:printer_commons).cups_server)
|
6
|
+
# printer = CupsPrinter.new printer_cups_name
|
7
|
+
# printer.print_data text, 'text/plain'
|
8
|
+
# printer.close
|
9
|
+
# else
|
10
|
+
print_file = "/tmp/print-#{printer_cups_name}-#{Time.now.strftime '%Y%m%d%H%M%S%L'}"
|
11
|
+
IO.write(print_file, text)
|
12
|
+
# CupsPrinter.new printer_cups_name, hostname: Settings.ns(:printer_commons).cups_server
|
13
|
+
# printer.print_data text, 'text/plain', hostname: Settings.ns(:printer_commons).cups_server
|
14
|
+
`lp -d "#{printer_cups_name}" -h "#{Settings.ns(:printer_commons).cups_server}" -o raw "#{print_file}"`
|
15
|
+
File.delete print_file
|
16
|
+
# end
|
17
17
|
end
|
18
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_print_commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
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-
|
11
|
+
date: 2018-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore
|