Skip to content

Instantly share code, notes, and snippets.

@maxidr
Created November 12, 2012 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxidr/4061187 to your computer and use it in GitHub Desktop.
Save maxidr/4061187 to your computer and use it in GitHub Desktop.
ruby -x option
Dear Rubysts:
Did you know that Ruby can even read your emails?
#!/usr/bin/env ruby -w
puts "It's true."
__END__
I told you it could
# option -x:
# Tells Ruby that the script is embedded in a message. Leading garbage will be discarded until the first that starts
# with “#!” and contains the string, “ruby”. Any meaningful switches on that line will applied. The end of script
# must be specified with either EOF, ^D (control-D), ^Z (control-Z), or the reserved word __END__. If the directory
# name is specified, Ruby will switch to that directory before executing script.
ruby -x email.txt
# From: https://speakerdeck.com/jeg2/10-things-you-didnt-know-ruby-could-do
@maxidr
Copy link
Author

maxidr commented Jan 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment