Created
December 3, 2009 00:58
-
-
Save bradgessler/247795 to your computer and use it in GitHub Desktop.
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
# 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