sapos-print 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sapos/print/cli.rb +27 -1
- data/lib/sapos/print/printer.rb +2 -1
- data/lib/sapos/print/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee739da76a7820cdcb7364a57efab5b6bd2ddaf476737108eb987b8a34953422
|
4
|
+
data.tar.gz: bdbd316766cb5c6ddf67b0a97b476b0c76d157cfe7543fd65a110475d84d990c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c00fb31891bb8c696795a74917943bcba3688a446278587f1c539ceb8160276e64f6f3df6b45efc340d778e3edf2d57059487c00916e3069fd8b264ac676eb0
|
7
|
+
data.tar.gz: f2202006d8dfb082dbf653383df153dbdc18c2dea42177dbe604e7522b8ee22ebcf5342f9e8084afd552c02f0c2bd4de2caf4704e063022642deb40b677f38f9
|
data/lib/sapos/print/cli.rb
CHANGED
@@ -47,7 +47,33 @@ module Sapos
|
|
47
47
|
info
|
48
48
|
config = Sapos::Print.config
|
49
49
|
printer = Printer.new(config)
|
50
|
-
printer.print("This is a test\nprint page\nwithno special commands")
|
50
|
+
printer.print(document: "This is a test\nprint page\nwithno special commands", document_number: "test", print_control: true)
|
51
|
+
end
|
52
|
+
|
53
|
+
def windows_test_print
|
54
|
+
info
|
55
|
+
|
56
|
+
filename = "test.print"
|
57
|
+
|
58
|
+
dir = File.join(Dir.home,".sapos-print")
|
59
|
+
FileUtils.mkdir_p dir unless File.exists?(dir)
|
60
|
+
dir
|
61
|
+
|
62
|
+
print_dir = File.join(dir, 'print')
|
63
|
+
|
64
|
+
FileUtils.mkdir_p print_dir unless File.exists?(print_dir)
|
65
|
+
filename = File.join(print_dir, filename)
|
66
|
+
|
67
|
+
puts "Test file Path: #{filename}"
|
68
|
+
File.open(filename, 'w'){|f| f.write("Test\nTest\nTest")}
|
69
|
+
puts "Execute COPY Command"
|
70
|
+
command = "COPY "+"'"+filename.gsub("/","\\")+"'"+'"\\\\%COMPUTERNAME%\\'+"TM"
|
71
|
+
|
72
|
+
if !system(command)
|
73
|
+
puts "ERROR"
|
74
|
+
else
|
75
|
+
puts "OK"
|
76
|
+
end
|
51
77
|
end
|
52
78
|
|
53
79
|
no_tasks do
|
data/lib/sapos/print/printer.rb
CHANGED
@@ -89,7 +89,8 @@ module Sapos
|
|
89
89
|
return true
|
90
90
|
|
91
91
|
when 'windows'
|
92
|
-
command = "
|
92
|
+
command = "COPY "+'"'+filename.gsub("/","\\")+'"'+'"\\\\%COMPUTERNAME%\\'+@config.printer
|
93
|
+
#command = "copy #{opts[:file]} "+'"\\\\%COMPUTERNAME%\\'+@config.printer
|
93
94
|
if !system(command)
|
94
95
|
puts "Not executed"
|
95
96
|
return false
|
data/lib/sapos/print/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sapos-print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Sauter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|