2015-10-20 01:33:56 +00:00
|
|
|
(ns dev
|
2015-12-20 06:28:34 +00:00
|
|
|
(:require [clojure.pprint :refer [pprint]]
|
2015-10-21 11:32:51 +00:00
|
|
|
[clojure.tools.namespace.repl :as tn]
|
2016-01-17 06:39:38 +00:00
|
|
|
[mount.core :as mount :refer [defstate]]
|
2015-12-24 18:55:39 +00:00
|
|
|
[mount.tools.graph :refer [states-with-deps]]
|
2015-11-23 15:43:26 +00:00
|
|
|
[app.utils.logging :refer [with-logging-status]]
|
2015-12-16 23:16:17 +00:00
|
|
|
[app.www]
|
2016-01-14 05:24:09 +00:00
|
|
|
[app.db :refer [conn]]
|
2015-12-16 23:16:17 +00:00
|
|
|
[app.example]
|
2016-01-14 05:24:09 +00:00
|
|
|
[app.nyse :refer [find-orders add-order]])) ;; <<<< replace this your "app" namespace(s) you want to be available at REPL time
|
2015-10-20 01:33:56 +00:00
|
|
|
|
|
|
|
|
(defn start []
|
2015-11-23 18:28:17 +00:00
|
|
|
(with-logging-status)
|
2015-12-08 00:50:03 +00:00
|
|
|
(mount/start #'app.conf/config
|
2015-12-16 23:16:17 +00:00
|
|
|
#'app.db/conn
|
|
|
|
|
#'app.www/nyse-app
|
2015-12-08 00:50:03 +00:00
|
|
|
#'app.example/nrepl)) ;; example on how to start app with certain states
|
2015-10-20 01:33:56 +00:00
|
|
|
|
|
|
|
|
(defn stop []
|
2015-10-26 02:27:09 +00:00
|
|
|
(mount/stop))
|
2015-10-20 01:33:56 +00:00
|
|
|
|
2015-10-21 11:32:51 +00:00
|
|
|
(defn refresh []
|
|
|
|
|
(stop)
|
|
|
|
|
(tn/refresh))
|
|
|
|
|
|
|
|
|
|
(defn refresh-all []
|
|
|
|
|
(stop)
|
|
|
|
|
(tn/refresh-all))
|
|
|
|
|
|
2015-10-20 01:33:56 +00:00
|
|
|
(defn go
|
2015-10-25 18:41:24 +00:00
|
|
|
"starts all states defined by defstate"
|
2015-10-20 01:33:56 +00:00
|
|
|
[]
|
2015-10-20 14:26:35 +00:00
|
|
|
(start)
|
2015-10-20 01:33:56 +00:00
|
|
|
:ready)
|
|
|
|
|
|
|
|
|
|
(defn reset
|
2015-10-25 18:41:24 +00:00
|
|
|
"stops all states defined by defstate, reloads modified source files, and restarts the states"
|
2015-10-20 01:33:56 +00:00
|
|
|
[]
|
|
|
|
|
(stop)
|
2015-10-21 11:32:51 +00:00
|
|
|
(tn/refresh :after 'dev/go))
|
2015-12-09 03:40:23 +00:00
|
|
|
|
|
|
|
|
(mount/in-clj-mode)
|
2024-03-06 03:49:19 +00:00
|
|
|
|
|
|
|
|
(defn load-data-readers!
|
|
|
|
|
"Refresh *data-readers* with readers from newly acquired dependencies."
|
|
|
|
|
[]
|
|
|
|
|
(#'clojure.core/load-data-readers)
|
|
|
|
|
(set! *data-readers* (.getRawRoot #'*data-readers*)))
|
|
|
|
|
|
2015-12-21 19:41:06 +00:00
|
|
|
(load-data-readers!)
|