thecore_print_commons 0.1.12 → 0.1.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d76e9416ec4e1cbc10a87b927cb211fcd07f9b42
4
- data.tar.gz: 91028fc14cd84f204ebae675aff061d31dab4409
3
+ metadata.gz: 3a6222c67470fd3bec7f955d0bc7f58579a3ac70
4
+ data.tar.gz: be01aebb50eec29d7ca370140778f937226f3d9d
5
5
  SHA512:
6
- metadata.gz: fb8574caf0b73b56e525b5f799c58b6ec3465b01cb212861bec63ed434e797a208b12f3f91ba955cc49448f19b69127417a3884acd3a7cf612d78f36be98f515
7
- data.tar.gz: 0277de4dbac6f75f6dcadf9864c22bcdb27c90e7672054f67d119f538c4dba7a264f6c8afbabf07bec9ce90b820f7fcbdd5d5a0844bf0c0c0d38541410f5399f
6
+ metadata.gz: 83eeaf6bfd6f8fffb8a4dc0a461a21b267dbbd601c6dbfb438616ec3be804aa27949297fa223aaa3ca5330c283026f3fb29b252d114823f3b7f4ea8ac2c9de3f
7
+ data.tar.gz: 4d60f5533e6a590022ed5ee2e09392989867e6a216a1165958123f5b4cadd03ef0f2ae997eb72e59fc64752834a487759225bcf95393e9eb0d30b775652d04d7
@@ -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
- 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
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
@@ -1,3 +1,3 @@
1
1
  module ThecorePrintCommons
2
- VERSION = '0.1.12'.freeze
2
+ VERSION = '0.1.13'.freeze
3
3
  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.12
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-07 00:00:00.000000000 Z
11
+ date: 2018-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore