require 'sys/proctable' require 'P4' module Commands def Commands.p4d_running? !ProcTable.ps().find_all { |p| p.comm =~ /p4d/ }.empty? end def Commands.p4d_available?(port=':1666') begin p4 = P4.new p4.port = port p4.connect p4.disconnect true rescue false end end def Commands.unicode_upgrade system("#{OsUtil.p4d_path} -r #{Conventions.p4droot_dir} "+ "-v server=1 -L #{Conventions.p4d_log_path} " + "-xi") end end