Compare commits

..

No commits in common. "eb709b9555f3e42bf2d0a7778d0cbc79f65299c5" and "137705e81c02600a390c35f885c143a5476ea073" have entirely different histories.

5 changed files with 11 additions and 31 deletions

View file

@ -13,7 +13,7 @@
Additional Features:
* Navmap feature for nested navigation (see: https://github.com/cryogen-project/cryogen-core/pull/81)
* Spring like Overlay-Filesystem: Theme can be published bundled in a jar but you can easily place your overwrites in filesystem.
* Theme default can be read from classpath, filesystem overwrites.
## License

View file

@ -1,11 +1,11 @@
(defproject dda/cryogen-core "0.2.4-SNAPSHOT"
(defproject dda/cryogen-core "0.2.1-SNAPSHOT"
:description "Cryogen's compiler"
:url "https://github.com/cryogen-project/cryogen-core"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1"]
[camel-snake-kebab "0.4.1"]
[cheshire "5.10.0"]
[cheshire "5.9.0"]
[clj-rss "0.2.5"]
[clj-text-decoration "0.0.3"]
[enlive "1.1.6"]
@ -29,13 +29,4 @@
:exclusions [commons-logging]}}
:test {:source-paths ["test"]
:resource-paths ["test-resources"]
:dependencies [[dda/dummy "0.1.0-SNAPSHOT"]]}}
:release-tasks [["vcs" "assert-committed"]
["change" "version" "leiningen.release/bump-version" "release"]
["vcs" "commit"]
["vcs" "tag"]
["deploy"]
["uberjar"]
["change" "version" "leiningen.release/bump-version"]
["vcs" "commit"]
["vcs" "push"]])
:dependencies [[dda/dummy "0.1.0-SNAPSHOT"]]}})

View file

@ -34,19 +34,10 @@
[ignore-patterns source-list]
(filter #(not (re-matches (re-pattern ignore-patterns) %)) source-list))
(defn filter-one-pattern
[ignore-patterns resources]
(if (not (empty? (:virtual-path (first resources))))
(filter #(not (re-matches ignore-patterns (:virtual-path %))) resources)
resources))
(defn filter-resources-for-ignore-patterns
[ignore-patterns resources]
(let [ignore-patterns (into [] ignore-patterns)
pattern (peek ignore-patterns)]
(if pattern
(filter-resources-for-ignore-patterns (pop ignore-patterns) (filter-one-pattern pattern resources))
resources)))
(filter #(not (re-matches (re-pattern ignore-patterns) (:virtual-path %)))
resources))
(defn resource-from-cp-or-fs ;:- Resource
[fs-prefix ;:- Prefix

View file

@ -41,9 +41,8 @@
(let [base-path "templates/md"
resources (cp-io/get-resources
fs-prefix base-path [pages posts])
filtered-resources (cp-io/filter-resources-for-ignore-patterns ignore-patterns
(->> (filter #(= (:resource-type %) :dir) resources)
(cp-io/distinct-resources-by-path)))]
filtered-resources (->> (filter #(= (:resource-type %) :dir) resources)
(cp-io/distinct-resources-by-path))]
filtered-resources))
(defn create-dirs-from-markup-folders!
@ -76,7 +75,6 @@ if no, return empty vector."
(->> assets
filter-file
filter-ext
(cp-io/filter-resources-for-ignore-patterns ignored-files)
(map get-java-file))))
;

View file

@ -28,7 +28,7 @@
(sut/get-distinct-markup-dirs
"./not-existing-get-from-cp"
"test_posts" "test_pages"
[#""]))))))
""))))))
(deftest test-create-dirs-from-markup-folders!
(is
@ -38,7 +38,7 @@
"./not-existing-get-from-cp"
"test_posts"
"test_pages"
target-tmp [#""])
target-tmp "")
(and (ftt/verify-dir-exists
(str target-tmp "/test_pages"))
(ftt/verify-dir-exists
@ -50,7 +50,7 @@
(is
(let [target-tmp "target/tmp-test-copy-resources-from-theme"]
(sut/delete-resources! target-tmp)
(sut/copy-resources-from-theme! "./" theme target-tmp [#""])
(sut/copy-resources-from-theme! "./" theme target-tmp "")
(and (ftt/verify-dir-exists
(str target-tmp "/js"))
(ftt/verify-file-exists