require "feels/bad/man/version" module Feels module Bad module Man def self.good_cocktail(directory) raise ArgumentError, "directory plz" if File.file?(directory) Dir.glob("#{File.expand_path(ARGV.first)}/**/*.rb").each do |file| fucked_up = [] File.open(file).each_line.map do |line| fucked_up << line.sub(/\s*/) do |match| Array.new(5).map do case rand(2) when 0 "\t" * rand(2) when 1 " " * rand(3) end end.join end end File.open(file, "w").puts(fucked_up.join) end end end end end