Skip to content

Instantly share code, notes, and snippets.

@wkf
Last active August 29, 2015 14:16
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 wkf/48c587b5fefe0ce441cc to your computer and use it in GitHub Desktop.
Save wkf/48c587b5fefe0ce441cc to your computer and use it in GitHub Desktop.
(require '[clojure.tools.namespace.find :as find]
'[clojure.tools.namespace.file :as file])
(defn find-source-files
"Returns all source files declaring the given namespace."
([ns]
(find-source-files ns "."))
([ns dir]
(filter
#(= (-> % file/read-file-ns-decl second) ns)
(find/find-clojure-sources-in-dir (io/file dir)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment