 (ns ring.middleware.incise
   (:require [clojure.java.io :refer [file]]
+            [clojure.set :refer [difference]]
             [ns-tracker.core :refer [ns-tracker]]
             (incise [utils :refer [delete-recursively directory?]]
                     [load :refer [load-parsers-and-layouts]]
                     [config :as conf])
-            [incise.parsers.core :refer [parse]])
+            [incise.parsers.core :refer [parse dissoc-parses]])
   (:import [java.io File]))
 
 (defonce ^:private file-modification-times (atom {}))

    (swap! file-modification-times assoc a-file (.lastModified a-file))
    (or (nil? previous-modification-time)
        (< previous-modification-time last-modification-time))))

(defn wrap-incise-parse
  "Call parse on each modified file in the given dir with each request."

        (->> (conf/get :in-dir)
             (file)
             (file-seq)
             (remove directory?)
             (reference-files)
             (filter modified?)
             (map parse)
             (dorun)))
      (handler request))))
