Permalink
Browse files

privacy; trace; tweaks

  • Loading branch information...
1 parent 20ed9cc commit 70ffaabb47fda09160cca3c6c428dde49920bca9 Alex Baranosky committed Dec 23, 2012
Showing with 8 additions and 4 deletions.
  1. +2 −1 project.clj
  2. +6 −3 src/slam/hound/regrow.clj
View
3 project.clj
@@ -2,6 +2,7 @@
:description "Rips your ns form apart and reconstructs it. We have the technology."
:plugins [[lein-swank "1.4.4"]]
:dependencies [[org.clojure/clojure "1.4.0"]]
- :test-selectors {:default :unit
+ :dev-dependencies [[org.clojure/tools.trace "0.7.3"]]
+ :test-selectors {:default (constantly true)
:unit :unit})
View
9 src/slam/hound/regrow.clj
@@ -70,7 +70,7 @@
(fn [candidate]
(re-find (butlast-regex candidate) (str original))))
-(def disambiguator-blacklist
+(def ^:private disambiguator-blacklist
(if-let [v (resolve 'user/slamhound-disambiguator-blacklist)]
@v
#"swank|lancet"))
@@ -90,11 +90,14 @@
(update-in ns-map [type] conj addition)
ns-map))
-(defn regrow [[ns-map body]]
+(defn- pre-load-namespaces []
(doseq [namespace (search/namespaces)
:when (not (re-find #"example|lancet$" (name namespace)))]
(try (with-out-str (require namespace))
- (catch Throwable _)))
+ (catch Throwable _))))
+
+(defn regrow [[ns-map body]]
+ (pre-load-namespaces)
(if (:slamhound-skip (:meta ns-map))
ns-map
(loop [ns-map ns-map

0 comments on commit 70ffaab

Please sign in to comment.