Created
December 6, 2011 09:38
-
-
Save Glutexo/1437563 to your computer and use it in GitHub Desktop.
ROT13 jako textová služba pro Automator
This file contains 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
on run {input, parameters} | |
(* A když se jako další akce přidá provedení tohoto AppleScriptu | |
vyskočí nám zROT13ovaný vstup jako upozornění. *) | |
display dialog input as text buttons {"OK"} | |
return input | |
end run |
This file contains 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
#!/usr/bin/ruby | |
=begin | |
Triviální kompilace příkladu z knihy o Ruby od Hala Fultona a výchozí šablony pro | |
shell-script v Ruby z Automatoru. V této podobě (bez řádku #!) ho lze v Automatoru | |
rovnou použít. | |
=end | |
class String | |
def rot13 | |
self.tr 'A-Ma-mN-Zn-z', 'N-Zn-zA-Ma-m' | |
end | |
end | |
ARGF.each do |f| | |
puts f.rot13 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment