Last active
December 12, 2015 04:08
-
-
Save havenwood/4711907 to your computer and use it in GitHub Desktop.
Glob Alternative (irc)
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
class String | |
def dir | |
Dir[File.join(self, "*#{File::SEPARATOR}")] | |
end | |
end | |
mp3_dir = 'k:/musics' | |
mp3_dir.dir | |
#=> ["/radiohead/", "/rachmaninoff/"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment