thecore_print_commons 0.1.6 → 0.1.7
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42f426c2cd6981fa5951db86546e0424c138871f
|
4
|
+
data.tar.gz: 204f3ecbe1f081d61fa7d738f782042ee263ae17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5be928b5d4d53d5407de3068d7056cb4cfeef0e5cae14cf2196843bf15035b93ba2ddde84f61b6d869b9998d2a81703e5e47c09ea840668171a2cd0243e3af11
|
7
|
+
data.tar.gz: 73765e891970d72d3257157314ea3b4dce667ec3b0cb3d506b21c957effb409952d21f998505d9e92da3d7b48c3c9582fcc7e38ab7f4b1044bcaceef10235a91
|
data/app/models/printer.rb
CHANGED
@@ -36,7 +36,13 @@ class Printer < ApplicationRecord
|
|
36
36
|
|
37
37
|
def ip_enum
|
38
38
|
# Getting from CUPS the list of configured printers
|
39
|
-
|
39
|
+
if Settings.ns(:printer_commons).cups_server.blank? || ['127.0.0.1', 'localhost'].contains(Settings.ns(:printer_commons).cups_server)
|
40
|
+
# Local Cups server
|
41
|
+
CupsPrinter.get_all_printer_names
|
42
|
+
else
|
43
|
+
# Remote Cups server
|
44
|
+
CupsPrinter.get_all_printer_names hostname: Settings.ns(:printer_commons).cups_server
|
45
|
+
end
|
40
46
|
end
|
41
47
|
|
42
48
|
RailsAdmin.config do |config|
|
data/app/workers/print_worker.rb
CHANGED
@@ -3,7 +3,11 @@ class PrintWorker
|
|
3
3
|
include Sidekiq::Worker
|
4
4
|
def perform printer_cups_name, text
|
5
5
|
begin
|
6
|
-
printer =
|
6
|
+
printer = if Settings.ns(:printer_commons).cups_server.blank? || ['127.0.0.1', 'localhost'].contains(Settings.ns(:printer_commons).cups_server)
|
7
|
+
CupsPrinter.new printer_cups_name
|
8
|
+
else
|
9
|
+
CupsPrinter.new printer_cups_name, hostname: Settings.ns(:printer_commons).cups_server
|
10
|
+
end
|
7
11
|
printer.print_data text, 'text/plain'
|
8
12
|
rescue
|
9
13
|
Rails.logger.debug("PRINTER #{printer_cups_name} ERROR: TIMEOUT")
|
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.7
|
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-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- db/migrate/20160323152041_create_printers.rb
|
76
76
|
- db/migrate/20160413115407_add_temperature_to_printer.rb
|
77
77
|
- db/migrate/20160629140729_add_default_to_printer.rb
|
78
|
+
- db/migrate/20181106141858_add_remote_server_setting.rb
|
78
79
|
- lib/tasks/thecore_print_commons_tasks.rake
|
79
80
|
- lib/thecore_print_commons.rb
|
80
81
|
- lib/thecore_print_commons/engine.rb
|