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

Version Path
ix-cli-0.0.27 bin/ix-crap
ix-cli-0.0.26 bin/ix-crap
ix-cli-0.0.25 bin/ix-crap
ix-cli-0.0.24 bin/ix-crap
ix-cli-0.0.23 bin/ix-crap
ix-cli-0.0.22 bin/ix-crap
ix-cli-0.0.21 bin/ix-crap
ix-cli-0.0.20 bin/ix-crap
ix-cli-0.0.19 bin/ix-crap
ix-cli-0.0.18 bin/ix-crap
ix-cli-0.0.17 bin/ix-crap
ix-cli-0.0.16 bin/ix-crap
ix-cli-0.0.15 bin/ix-crap
ix-cli-0.0.14 bin/ix-crap
ix-cli-0.0.13 bin/ix-crap
ix-cli-0.0.12 bin/ix-crap
ix-cli-0.0.11 bin/ix-crap
ix-cli-0.0.10 bin/ix-crap
ix-cli-0.0.9 bin/ix-crap
ix-cli-0.0.7 bin/ix-crap