Skip to content

Commit

Permalink
Upgrade to tools.namespace 0.2.0 and clojure 1.3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemcc committed Oct 17, 2012
1 parent d9c341d commit 6884b4c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions project.clj
@@ -1,7 +1,7 @@
(defproject ns-tracker "0.2.0"
:description "Keep track of which namespaces have been modified"
:dependencies [[org.clojure/clojure "1.2.1"]
[org.clojure/tools.namespace "0.1.3"]
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/tools.namespace "0.2.0"]
[org.clojure/java.classpath "0.2.0"]]
:profiles
{:dev {:dependencies [[commons-io "1.4"]]}
Expand Down
19 changes: 10 additions & 9 deletions src/ns_tracker/core.clj
@@ -1,10 +1,11 @@
(ns ns-tracker.core
"Keeps track of which namespaces have changed and need to be reloaded."
(:use [ns-tracker.dependency :only (graph seq-union depend dependents remove-key)]
[ns-tracker.nsdeps :only (deps-from-ns-decl)]
[ns-tracker.nsdeps :only (deps-from-ns-decl)]
[clojure.java.io :only (file)]
[clojure.tools.namespace :only (find-clojure-sources-in-dir
read-file-ns-decl)]))
[clojure.tools.namespace
[file :only (read-file-ns-decl)]
[find :only (find-clojure-sources-in-dir)]]))

(defn- file? [f]
(instance? java.io.File f))
Expand Down Expand Up @@ -32,10 +33,10 @@

(defn- add-to-dep-graph [dep-graph namespace-decls]
(reduce (fn [g decl]
(let [nn (second decl)
deps (deps-from-ns-decl decl)]
(apply depend g nn deps)))
dep-graph namespace-decls))
(let [nn (second decl)
deps (deps-from-ns-decl decl)]
(apply depend g nn deps)))
dep-graph namespace-decls))

(defn- remove-from-dep-graph [dep-graph new-decls]
(apply remove-key dep-graph (map second new-decls)))
Expand All @@ -47,8 +48,8 @@

(defn- affected-namespaces [changed-namespaces old-dependency-graph]
(apply seq-union changed-namespaces
(map #(dependents old-dependency-graph %)
changed-namespaces)))
(map #(dependents old-dependency-graph %)
changed-namespaces)))

(defn- make-file [f]
{:pre [(or (string? f) (file? f))]}
Expand Down

0 comments on commit 6884b4c

Please sign in to comment.