Sha256: a5790cc828927cd857306fa23ec89e02a0976f7cb042c238b481d445176ddd29
Contents?: true
Size: 1.18 KB
Versions: 22
Compression:
Stored size: 1.18 KB
Contents
class Knj::Cmd_gen def self.rsync(args) cmd = "" if args[:bin] cmd << args[:bin] else cmd << "rsync" end cmd << " -az" if args[:verbose] 1.upto(args[:verbose]) do cmd << "v" end end if args[:ssh] cmd << " -e ssh" if args[:port] cmd << " --rsh='ssh -p #{args[:port]}'" end end if args[:delete] cmd << " --delete" end if args[:exclude] args[:exclude].each do |dir| cmd << " --exclude \"#{dir}\"" end end cmd << " \"#{args[:user]}@#{args[:host]}:#{args[:dir_host]}\" \"#{args[:dir_local]}\"" return cmd end def self.tar(args) cmd = "" if args[:bin] cmd << args[:bin] else cmd << "tar" end cmd << " " cmd << "z"if args[:gzip] cmd << "x" if args[:extract] cmd << "f" if args[:file] cmd << "c" if args[:create] if args[:verbose] 1.upto(args[:verbose]) do cmd << "v" end end cmd << " \"#{args[:archive_path]}\"" args[:paths].each do |path| cmd << " \"#{path}\"" end return cmd end end
Version data entries
22 entries across 22 versions & 1 rubygems