Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# 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
You can’t perform that action at this time.