Sha256: 96e1d664f0eabfac7bd1e26ee4069c49092d9a068b8d53c7a442f750ed14b4e5
Contents?: true
Size: 390 Bytes
Versions: 26
Compression:
Stored size: 390 Bytes
Contents
#!/usr/bin/env ruby regex = /[a-z0-9A-Z]+/ replace = ARGV[0] || 'crap' needle = 0 upper_case_chars = ('A'..'Z').to_a STDIN.each_char do |char| if char =~ regex if upper_case_chars.include?(char) print replace[needle].upcase else print replace[needle] end needle += 1 if needle == replace.size needle = 0 end else print char end end
Version data entries
26 entries across 26 versions & 1 rubygems