[jenkinscat-docs] master: Support for reading .edn files stored in book repository. (3833e21)

immanetize at fedoraproject.org immanetize at fedoraproject.org
Fri Feb 6 07:41:11 UTC 2015


Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git

On branch  : master

>---------------------------------------------------------------

commit 3833e2153f8bf1c333aa8db6e46544498a734ce7
Author: Pavel Tisnovsky <ptisnovs at redhat.com>
Date:   Thu Jan 22 10:19:30 2015 +0100

    Support for reading .edn files stored in book repository.


>---------------------------------------------------------------

 ChangeLog                 |    5 +++++
 src/jenkinscat/server.clj |   16 ++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ec6bd7b..bff10c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-22  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/jenkinscat/server.clj:
+	Support for reading .edn files stored in book repository.
+
 2015-01-21  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* tools/create_books_clj_file.lua:
diff --git a/src/jenkinscat/server.clj b/src/jenkinscat/server.clj
index cba6a10..49641ef 100644
--- a/src/jenkinscat/server.clj
+++ b/src/jenkinscat/server.clj
@@ -765,6 +765,22 @@
             (= dcvs "svn") (clone-svn-repo full-url temp-dir-name)
             :else nil)))
 
+(defn perform-reading-from-cheshirecat-edn
+    "Read and evaluate all informations stored in a given .edn file."
+    [cheshirecat-filename]
+    (if (file-exists? cheshirecat-filename)
+        (eval (read-string (fileutils/slurp- cheshirecat-filename)))
+        nil))
+
+(defn read-cheshirecat-edn
+    [temp-dir-name]
+    "Try to read and evaluate all informations stored in a given .edn file."
+    (let [cheshirecat-filename (str temp-dir-name "/.cheshirecat/artifact.edn")]
+        (println "Trying to read info from the file " cheshirecat-filename)
+        (let [result (perform-reading-from-cheshirecat-edn cheshirecat-filename)]
+            (println "Result: " result)
+            result)))
+
 (defn count-books
     [books]
     (let [out-data (new java.util.TreeSet)]



More information about the docs-commits mailing list