-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lots of fixes, module additions + package feature
- Loading branch information
Showing
12 changed files
with
111 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
;; CHP Admin module | ||
;; {:module-type [:module :module :module etc..]} | ||
|
||
{:schema [:user] ;; resources/modules/schema/user.clj | ||
:migrations [:01-add-admin] ;; resources/modules/migrations/01-add-admin.clj | ||
:bindings [:user] ;; resources/modules/bindings/user.clj | ||
:middleware [] ;; resources/modules/middleware/ -- nothing | ||
:cljs []} ;; resources/modules/cljs/ -- nothing |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
(ns chp.package | ||
;; for schema load | ||
(:refer-clojure :exclude [bigint | ||
boolean | ||
char | ||
double | ||
float | ||
time]) | ||
(:use [chp.schema | ||
:only [load-schemas]] | ||
[chp.migration | ||
:only [chp-migrate]] | ||
[chp.module | ||
:only [mod-enable]])) | ||
|
||
(def package-dir "resources/packages/") | ||
|
||
(defn force-string [-name] | ||
(if (keyword? -name) | ||
(name -name) | ||
(str -name))) | ||
|
||
(defn name->clj [-name] | ||
(let [-name (force-string -name) | ||
-file (str -name ".clj")] | ||
(->> -file | ||
(str package-dir) | ||
slurp | ||
read-string))) | ||
|
||
|
||
(defn load-package [-name] | ||
(doseq [_ (name->clj -name) | ||
:let [[-type mods] _]] | ||
(println "\n Loading for" -type) | ||
(doseq [_ mods] | ||
(mod-enable -type _) | ||
(case -type | ||
:schema (load-schemas) | ||
:migrations (chp-migrate) | ||
:bindings true | ||
:middleware true | ||
:cljs true | ||
:unknown-type)))) | ||
|
||
(defn load-packages [& -name] | ||
(doseq [_ -name] (load-package _))) |
This file contains 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
This file contains 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