Created
November 2, 2015 06:07
-
-
Save c-lliope/9915bfef56285ea518fb to your computer and use it in GitHub Desktop.
A ruby script that outputs its source code
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
single_quote = "'" | |
script = ' | |
first = "single_quote = \"#{single_quote}\"" | |
assignment = "script = " + single_quote | |
lines = [ | |
first, | |
assignment, | |
script.strip, | |
single_quote, | |
"eval script", | |
] | |
script = lines.join("\n") | |
puts script | |
' | |
eval script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment