Created
December 10, 2009 02:36
-
-
Save tjennings/253068 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
(import '(java.io File)) | |
(defn file-list | |
"returns a lists of files in a directory" | |
([dir] (.listFiles (File. dir) ))) | |
(defn file-names [dir] | |
(map #(.getName %) (file-list dir))) | |
(defn ruby-files [dir] | |
(filter #(re-find #"\.rb" %) (file-names dir))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment