Sha256: 143d0a29da0e3d02c868fd0de76305e94dac983724f0a0c76139228ce93e11b2
Contents?: true
Size: 384 Bytes
Versions: 4
Compression:
Stored size: 384 Bytes
Contents
class File # http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_276 SAFE_CHARS = /[^a-zA-Z0-9._\-]/ def self.safe_name(name) name.gsub('&', 'and'). # prittify & to and gsub(/\s/, '-'). # replace spaces with dashes gsub(SAFE_CHARS, '-'). # replace with portable characters gsub(/\-+/, '-') # limit - character to once end end
Version data entries
4 entries across 4 versions & 1 rubygems