Created
February 27, 2010 02:53
-
-
Save statianzo/316430 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(ns com.jstaten.predicates) | |
(defn non-blank? [line] | |
(re-find #"\S" line)) | |
(defn non-svn? [file] | |
(not (.contains (.toString file) ".svn"))) | |
(defn clojure-source? [file] | |
(.endsWith (.toString file) ".clj")) | |
(use '[clojure.contrib.io :only (reader)]) | |
(defn clojure-loc [dir] | |
(reduce + | |
(for [file (file-seq dir) :when (and (non-svn? file) (clojure-source? file))] | |
(with-open [reader (reader file)] | |
(count (filter non-blank? (line-seq reader))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment