Skip to content

Instantly share code, notes, and snippets.

@bradgessler
Created December 3, 2009 00:58
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 bradgessler/247795 to your computer and use it in GitHub Desktop.
Save bradgessler/247795 to your computer and use it in GitHub Desktop.
# Creates an array out of the words in a string
>> %w[one two three]
=> ["one", "two", "three"]
# Executes a system command and captures the output as a string
>> %x[ls]
=> "Applications\nDesktop\nDocuments\nDownloads\nDropbox\nLibrary\nMovies\nMusic\nPictures\nProjects\nPublic\nSites\nVirtual Machines\npe\n"
# Creates a regexp object
>> %r{(\w+)\.html}
=> /(\w+)\.html/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment