Sha256: d161386f10a2c1dbc0290ef7c221be6c9b6159a03fb2f419ae2cace85de5c576
Contents?: true
Size: 398 Bytes
Versions: 11
Compression:
Stored size: 398 Bytes
Contents
class Array # Join a sequence of arguments together to form a executable command. def to_cmd collect{|v| v.to_cmd}.join(' ') end end class Pathname def to_cmd to_s.to_cmd end end class Symbol def to_cmd to_s.to_cmd end end class String # Conditionally quote a string if it contains whitespace or quotes. def to_cmd if match(/\s|"|'/) self.dump else self end end end
Version data entries
11 entries across 11 versions & 1 rubygems