lib/sapos/print/cli.rb in sapos-print-1.0.9 vs lib/sapos/print/cli.rb in sapos-print-1.0.10
- old
+ new
@@ -33,10 +33,11 @@
config[:key] = data["key"]
config[:printer] = ask("Printer Name: ")
config[:adapter] = ask("Printer Adapter: ", limited_to: ["console", "cups", "windows"])
config[:interface] = ask("Interface", limited_to: ["text", "escp"])
config[:user_id] = user_id
+ config[:duplicate_control] = ask("¿Control Duplicados por MSGID?", limited_to: ["si", "no"])
if yes?("Are you sure that you want to write the configuration file?")
Sapos::Print::Configuration.write(config)
ap config
say "Configuration Saved! Cheers"
@@ -46,10 +47,10 @@
desc "start", "run service"
option :verbose, type: :boolean
def start
info
config = Sapos::Print.config
- puts ["Q=#{config.q.to_s}", "Printer=#{config.printer.to_s}", "Adapter=#{config.adapter.to_s}", "Interface=#{config.interface}"].join(";")
+ puts ["Q=#{config.q.to_s}", "Printer=#{config.printer.to_s}", "Adapter=#{config.adapter.to_s}", "Interface=#{config.interface}", "DC=#{config.duplicate_control?}"].join(";")
print_dir = File.join(Sapos::Print.app_directory, 'print')
if File.exists?(print_dir)
Dir.glob("#{print_dir}/*.print").each do |x|
FileUtils.rm_rf(x) if File.ctime(x) < Time.now - 3600
\ No newline at end of file