This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: ruby obfuscate.rb /path/to/file line-offset | |
# Example: ruby obfuscate.rb ./test.md 3 | |
# The command above will obfuscate the text in the given file path from line 4 onwards. The obfuscated result will be stored in ./test-obfuscated.md | |
def obfuscate(text) | |
return text if text == '' | |
text.split(' ').map do |token| | |
token.chars.map do |char| | |
if char.ord.between?(65, 90) |