lib/sapos/print/cli.rb in sapos-print-1.0.1 vs lib/sapos/print/cli.rb in sapos-print-1.0.3
- old
+ new
@@ -45,10 +45,36 @@
desc "print", "demo print"
def print
info
config = Sapos::Print.config
printer = Printer.new(config)
- printer.print("This is a test\nprint page\nwithno special commands")
+ printer.print(document: "This is a test\nprint page\nwithno special commands", document_number: "test", print_control: true)
+ end
+
+ def windows_test_print
+ info
+
+ filename = "test.print"
+
+ dir = File.join(Dir.home,".sapos-print")
+ FileUtils.mkdir_p dir unless File.exists?(dir)
+ dir
+
+ print_dir = File.join(dir, 'print')
+
+ FileUtils.mkdir_p print_dir unless File.exists?(print_dir)
+ filename = File.join(print_dir, filename)
+
+ puts "Test file Path: #{filename}"
+ File.open(filename, 'w'){|f| f.write("Test\nTest\nTest")}
+ puts "Execute COPY Command"
+ command = "COPY "+"'"+filename.gsub("/","\\")+"'"+'"\\\\%COMPUTERNAME%\\'+"TM"
+
+ if !system(command)
+ puts "ERROR"
+ else
+ puts "OK"
+ end
end
no_tasks do
def info
if @printed.nil?
\ No newline at end of file