(ns wort.handler
  (:require [compojure.core :refer :all]
            [compojure.route :as route]
            [ring.util.response :as resp]
            [wort.core :as core]
            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]))

(defroutes app-routes
  (GET "/" []
    (resp/content-type (resp/resource-response "index.html" {:root "public"}) "text/html"))
  (GET "/sound" []
    (resp/response "../resources/a-team_crazy_fool_x.wav"))
  (route/resources "/")
  (route/not-found "Not Found"))

(def app
  (wrap-defaults app-routes site-defaults))

(ns wort.handler
  (:require [compojure.core :refer :all]
            [compojure.route :as route]
            [ring.util.response :as resp]
            [wort.core :as core]
            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]))

(defroutes app-routes
  (GET "/" []
    (resp/content-type (resp/resource-response "index.html" {:root "public"}) "text/html"))
  (GET "/sound" []
    (resp/file-response "../resources/a-team_crazy_fool_x.wav"))
  (route/resources "/")
  (route/not-found "Not Found"))

(def app
  (wrap-defaults app-routes site-defaults))

Change func to return file response, instead of litteral path


(ns radicalzephyr.boot-junit
  {:boot/export-tasks true}
  (:require [boot.core :as core])
  (:import org.junit.runner.JUnitCore))

(defn failure->map [failure]
  {:description (.. failure (getDescription) (toString))
   :exception (.getException failure)
   :message (.getMessage failure)})

(defn result->map [result]
  {:successful? (.wasSuccessful result)
   :run-time (.getRunTime result)
   :run     (.getRunCount result)
   :ignored (.getIgnoredCount result)
   :failed  (.getFailureCount result)
   :failures (map failure->map (.getFailures result))})

(core/deftask junit
  "Run the jUnit test runner."
  [p packages PACKAGE #{sym} "The set of Java packages to run tests in."]
  (core/with-pre-wrap fileset
    (let [result (JUnitCore/runClasses
                  (into-array Class
                              [#_ (magic goes here to find all test classes)]))]
      (when (> (.getFailureCount result) 0)
        (throw (ex-info "There were some test failures."
                        (result->map result)))))
    fileset))

(ns radicalzephyr.boot-junit
  {:boot/export-tasks true}
  (:require [boot.core :as core])
  (:import org.junit.runner.JUnitCore))

(defn failure->map [failure]
  {:description (.. failure (getDescription) (toString))
   :exception (.getException failure)
   :message (.getMessage failure)})

(defn result->map [result]
  {:successful? (.wasSuccessful result)
   :run-time (.getRunTime result)
   :run     (.getRunCount result)
   :ignored (.getIgnoredCount result)
   :failed  (.getFailureCount result)
   :failures (map failure->map (.getFailures result))})

(core/deftask junit
  "Run the jUnit test runner."
  [p packages PACKAGE #{sym} "The set of Java packages to run tests in."]
  (core/with-pre-wrap fileset
    (if (seq packages)
      (let [result (JUnitCore/runClasses
                    (into-array Class
                                [#_ (magic goes here to find all test classes)]))]
        (when (> (.getFailureCount result) 0)
          (throw (ex-info "There were some test failures."
                          (result->map result)))))
      (println "No packages were tested."))
    fileset))

Make the packages argument mandatory

Make the packages argument mandatory


(ns clojars.test.unit.certs
  (:require [clojure.test :refer :all]))

(def sixty-days (* 86400 1000 60))

(deftest fail-when-gpg-key-is-about-to-expire
  (let [expire-date #inst "2017-09-04T00:00:00.000-00:00"]
    (is (< (System/currentTimeMillis)
          (- (.getTime expire-date) sixty-days))
      (format "Security GPG key expires on %s" expire-date))))

(deftest fail-when-tls-cert-is-about-to-expire
  (let [expire-date #inst "2016-08-12T00:00:00.000-00:00"]
    (is (< (System/currentTimeMillis)
          (- (.getTime expire-date) sixty-days))
      (format "clojars.org TLS cert expires on %s" expire-date))))

(ns clojars.test.unit.certs
  (:require [clojure.test :refer :all]))

(def sixty-days (* 86400 1000 60))

(deftest fail-when-gpg-key-is-about-to-expire
  (let [expire-date #inst "2017-09-04T00:00:00.000-00:00"]
    (is (< (System/currentTimeMillis)
          (- (.getTime expire-date) sixty-days))
      (format "Security GPG key expires on %s" expire-date))))

(deftest fail-when-tls-cert-is-about-to-expire
  (let [expire-date #inst "2018-06-18T00:00:00.000-00:00"]
    (is (< (System/currentTimeMillis)
          (- (.getTime expire-date) sixty-days))
      (format "clojars.org TLS cert expires on %s" expire-date))))

Set cert test to check for new cert expire date


(ns buildviz.main
  (:require [buildviz.build-results :as results]
            [buildviz.handler :as handler]
            [buildviz.http :as http]
            [buildviz.storage :as storage]))

(def jobs-filename "buildviz_jobs")
(def tests-filename "buildviz_tests")

(defn- persist-jobs! [build-data]
  (storage/store! build-data jobs-filename))

(defn- persist-tests! [tests-data]
  (storage/store! tests-data tests-filename))

(def app
  (let [builds (storage/load-from-file jobs-filename)
        tests (storage/load-from-file tests-filename)]
    (-> (handler/create-app (results/build-results builds tests)
                            persist-jobs!
                            persist-tests!)
        http/wrap-log-request
        http/wrap-log-errors)))

(ns buildviz.main
  (:require [buildviz.build-results :as results]
            [buildviz.handler :as handler]
            [buildviz.http :as http]
            [buildviz.storage :as storage]
            [clojure.java.io :as io]
            [clojure.string :as str]))

(defn- path-for [file-name]
  (if-let [data-dir (System/getenv "BUILDVIZ_DATA_DIR")]
    (.getPath (io/file data-dir file-name))
    file-name))

(def jobs-filename (path-for "buildviz_jobs"))
(def tests-filename (path-for "buildviz_tests"))

(defn- persist-jobs! [build-data]
  (storage/store! build-data jobs-filename))

(defn- persist-tests! [tests-data]
  (storage/store! tests-data tests-filename))

(def app
  (let [builds (storage/load-from-file jobs-filename)
        tests (storage/load-from-file tests-filename)]
    (-> (handler/create-app (results/build-results builds tests)
                            persist-jobs!
                            persist-tests!)
        http/wrap-log-request
        http/wrap-log-errors)))

Allow to configure the data directory

Allow to configure the data directory


(ns hu.ssh.github-changelog
  (:require
    [environ.core :refer [env]]
    [tentacles.core :as core]
    [tentacles.repos :as repos]
    [tentacles.pulls :as pulls]
    [clj-semver.core :as semver]))

(defn repo
  "Gets the repository from its name"
  ([name] (repo "pro" name))
  ([org repo] [org repo]))

(defn parse-semver
  "Checks for semantic versions with or without v predicate"
  [tag]
  (let [version (:name tag)
        parse #(try (semver/parse %)
                    (catch java.lang.AssertionError _e nil))]
    (if (= \v (first version))
      (parse (apply str (rest version)))
      (parse version))))

(defn changelog
  "Fetches the changelog"
  [user repo]
  (let [tags (delay (map #(assoc % :version (parse-semver %)) (repos/tags user repo)))
        pulls (delay (pulls/pulls user repo {:state "closed"}))
        commits (delay (repos/commits user repo))]
    (println (first @tags))))

(core/with-defaults {:oauth-token (env :github-token) :all_pages true}
                    (changelog "raszi" "node-tmp"))

(ns hu.ssh.github-changelog
  (:require
    [environ.core :refer [env]]
    [tentacles.core :as core]
    [tentacles.repos :as repos]
    [tentacles.pulls :as pulls]
    [clj-semver.core :as semver]))

(defn repo
  "Gets the repository from its name"
  ([name] (repo "pro" name))
  ([org repo] [org repo]))

(defn parse-semver
  "Checks for semantic versions with or without v predicate"
  [tag]
  (let [version (:name tag)
        parse #(try (semver/parse %)
                    (catch java.lang.AssertionError _e nil))]
    (parse
      (if (= \v (first version))
        (subs version 1)
        version))))

(defn changelog
  "Fetches the changelog"
  [user repo]
  (let [tags (delay (map #(assoc % :version (parse-semver %)) (repos/tags user repo)))
        pulls (delay (pulls/pulls user repo {:state "closed"}))
        commits (delay (repos/commits user repo))]
    (println (first @tags))))

(core/with-defaults {:oauth-token (env :github-token) :all_pages true}
                    (changelog "raszi" "node-tmp"))

Use subs(tring) instead of seq operations and inline if


(ns comic-reader.scrape
  (:require [clojure.string :as s]
            [net.cgrand.enlive-html :as html])
  (:import java.net.URL))

(defn fetch-url [url]
  (html/html-resource (URL. url)))

(defn extract-list [html selector normalize]
  (map normalize (html/select html selector)))

(defn fetch-list [{:keys [url selector normalize]}]
  (when (every? (complement nil?) [url selector normalize])
    (extract-list (fetch-url url) selector normalize)))

(defn enlive->hiccup [{:keys [tag attrs content]}]
  (if (nil? content)
    [tag attrs]
    [tag attrs content]))

(defn clean-image-tag [[tag attrs & content]]
  [tag (select-keys attrs [:alt :src])])

(defn extract-image-tag [html selector]
  (some-> html
          (html/select selector)
          seq
          first
          enlive->hiccup
          clean-image-tag))

(defn fetch-image-tag [{:keys [url selector]}]
  (when (every? (complement nil?) [url selector])
    (-> (fetch-url url)
        (extract-image-tag selector))))

(ns comic-reader.scrape
  (:require [clojure.string :as s]
            [clojure.java.io :as io]
            [net.cgrand.enlive-html :as html])
  (:import java.net.URL))

(defn fetch-url [url]
  (html/html-resource (io/as-url url)))

(defn extract-list [html selector normalize]
  (map normalize (html/select html selector)))

(defn fetch-list [{:keys [url selector normalize]}]
  (when (every? (complement nil?) [url selector normalize])
    (extract-list (fetch-url url) selector normalize)))

(defn enlive->hiccup [{:keys [tag attrs content]}]
  (if (nil? content)
    [tag attrs]
    [tag attrs content]))

(defn clean-image-tag [[tag attrs & content]]
  [tag (select-keys attrs [:alt :src])])

(defn extract-image-tag [html selector]
  (some-> html
          (html/select selector)
          seq
          first
          enlive->hiccup
          clean-image-tag))

(defn fetch-image-tag [{:keys [url selector]}]
  (when (every? (complement nil?) [url selector])
    (-> (fetch-url url)
        (extract-image-tag selector))))

Use io/as-url instead of the URL constructor


(ns user
  (:refer-clojure :exclude [dec < range <= min long int > - time / >= inc + max complement atom])
  (:require
   [tick.alpha.api :refer :all]
   ;;[tick.deprecated.cal :refer [holidays-in-england-and-wales weekend?]]
   [tick.viz :refer [show-canvas view label]]
   ;;[tick.deprecated.schedule :as sch :refer [schedule]]
   [clojure.spec.alpha :as s]
   clojure.test)
  (:import [java.time DayOfWeek]))

(defn test-all []
  (require 'tick.alpha.api-test 'tick.core-test 'tick.interval-test)
  (clojure.test/run-all-tests #"(tick).*test$"))

(ns user
  (:require
   [tick.alpha.api :as t]
   ;;[tick.deprecated.cal :refer [holidays-in-england-and-wales weekend?]]
   [tick.viz :refer [show-canvas view label]]
   ;;[tick.deprecated.schedule :as sch :refer [schedule]]
   [clojure.spec.alpha :as s]
   clojure.test)
  (:import [java.time DayOfWeek]))

(defn test-all []
  (require 'tick.alpha.api-test 'tick.core-test 'tick.interval-test)
  (clojure.test/run-all-tests #"(tick).*test$"))

Fix to warnings on repl

Fix to warnings on repl


(ns devcards.discuss.utils
  (:require [discuss.communication.auth :as auth]
            [sablono.core :as html :refer-macros [html]]))

(def shortcuts
  (html [:div.btn.btn-primary {:onClick #(auth/login "Christian" "iamgroot")} "Login"]))

(ns devcards.discuss.utils
  (:require [discuss.communication.auth :as auth]
            [sablono.core :as html :refer-macros [html]]
            [discuss.utils.common :as lib]))

(def shortcuts
  (html [:div
         [:div.btn.btn-primary {:onClick #(auth/login "Christian" "iamgroot")} "Login"]
         [:div.btn.btn-primary {:onClick #(lib/last-api! "/town-has-to-cut-spending/justify/37/agree?history=/attitude/37")} "Set :api/last-url"]]))

Add more buttons to devcard-shortcuts

Add more buttons to devcard-shortcuts


(defproject spec-examples "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.9.0-alpha20"]]
  :source-paths ["src/clj"]
  :test-paths ["test/clj"]
  :java-source-paths ["src/java"]
  :profiles
  {:dev {:dependencies [[org.clojure/test.check "0.9.0"]
                        [pjstadig/humane-test-output "0.8.3"]]
         :injections [(require 'pjstadig.humane-test-output)
                      (pjstadig.humane-test-output/activate!)]}})

(defproject spec-examples "0.1.0-SNAPSHOT"
  :description "clojure.spec examples"
  :url "https://github.com/lagenorhynque/spec-examples"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.9.0-beta1"]]
  :source-paths ["src/clj"]
  :test-paths ["test/clj"]
  :java-source-paths ["src/java"]
  :profiles
  {:dev {:dependencies [[org.clojure/test.check "0.9.0"]
                        [pjstadig/humane-test-output "0.8.3"]]
         :injections [(require 'pjstadig.humane-test-output)
                      (pjstadig.humane-test-output/activate!)]}})

Bump up clojure version to 1.9.0-beta1

Bump up clojure version to 1.9.0-beta1


(defproject onyx-app/lein-template "0.12.0.0-beta1"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

(defproject onyx-app/lein-template "0.12.0.0-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

Prepare for next release cycle.

Prepare for next release cycle.


(defproject io.nervous/hildebrand "0.2.1"
  :description "High-level, asynchronous AWS client library"
  :url "https://github.com/nervous-systems/hildebrand"
  :License {:name "Unlicense" :url "http://unlicense.org/UNLICENSE"}
  :scm {:name "git" :url "https://github.com/nervous-systems/hildebrand"}
  :deploy-repositories [["clojars" {:creds :gpg}]]
  :signing {:gpg-key "moe@nervous.io"}
  :global-vars {*warn-on-reflection* true}
  :source-paths ["src" "test"]
  :plugins [[codox "0.8.11"]]
  :codox {:include [hildebrand]
          :defaults {:doc/format :markdown}}
  :dependencies
  [[org.clojure/clojure    "1.6.0"]
   [org.clojure/core.async "0.1.346.0-17112a-alpha"]
   [io.nervous/eulalie     "0.1.1-SNAPSHOT"]
   [io.nervous/glossop     "0.1.0-SNAPSHOT"]
   [prismatic/plumbing     "0.4.1"]]
  :exclusions [[org.clojure/clojure]])

(defproject io.nervous/hildebrand "0.2.1"
  :description "High-level, asynchronous AWS client library"
  :url "https://github.com/nervous-systems/hildebrand"
  :license {:name "Unlicense" :url "http://unlicense.org/UNLICENSE"}
  :scm {:name "git" :url "https://github.com/nervous-systems/hildebrand"}
  :deploy-repositories [["clojars" {:creds :gpg}]]
  :signing {:gpg-key "moe@nervous.io"}
  :global-vars {*warn-on-reflection* true}
  :source-paths ["src" "test"]
  :plugins [[codox "0.8.11"]]
  :codox {:include [hildebrand]
          :defaults {:doc/format :markdown}}
  :dependencies
  [[org.clojure/clojure    "1.6.0"]
   [org.clojure/core.async "0.1.346.0-17112a-alpha"]
   [io.nervous/eulalie     "0.1.1"]
   [io.nervous/glossop     "0.1.0"]
   [prismatic/plumbing     "0.4.1"]]
  :exclusions [[org.clojure/clojure]])

Remove snapshots from dependencies, fix :license key


(def scenes [{:subject  "Frankie"
              :action   "say"
              :object   "relax"}

             {:subject  "Lucy"
              :action   "❤s"
              :object   "Clojure"}

             {:subject  "Rich"
              :action   "tries"
              :object   "a new conditioner"}])

(println "People:" (->> scenes
                        (map :subject)
                        (interpose ", ")
                        (reduce str)))

;;=> People: Frankie, Lucy, Rich

;; Let's define some data using list / map
;; literals:

(def scenes [{:subject  "Frankie"
              :action   "say"
              :object   "relax"}

             {:subject  "Lucy"
              :action   "❤s"
              :object   "Clojure"}

             {:subject  "Rich"
              :action   "tries"
              :object   "a new conditioner"}])

;; Who's in our scenes?

(println "People:" (->> scenes
                        (map :subject)
                        (interpose ", ")
                        (reduce str)))

;;=> People: Frankie, Lucy, Rich

Update intro page clojure example

Update intro page clojure example


(ns clj-git.test.core-test
  (:require [clojure.java.io :as io]
            [clojure.test :refer :all])
  (:require [clj-git.core :as git] :reload-all))

(def es-src-dir (-> "clj_git"
                    io/resource
                    io/file
                    .getParent
                    (io/file "elasticsearch-src")
                    .getCanonicalPath))

(defn maybe-prep-repo [dir]
  (if (.exists (io/file dir ".git"))
    (do
      (print "Elasticsearch source already cloned.  Pulling...")
      (flush)
      (git/git-pull (git/load-repo dir)))
    (do
      (print "Elasticsearch source missing.  Cloning...")
      (flush)
      (git/git-clone
       dir
       "https://github.com/elastic/elasticsearch.git")))
  (println "  Done."))

(deftest parse-commit
  (maybe-prep-repo es-src-dir)
  (time
   (testing "the first thousand commits can parse"
     (is (= 1000 (->> es-src-dir
                      git/load-repo
                      git/git-log
                      (take 1000)
                      count))))))

(ns clj-git.test.core-test
  (:require [clojure.java.io :as io]
            [clojure.test :refer :all]
            [environ.core :as environ])
  (:require [clj-git.core :as git] :reload-all))

(defn abspath [path]
  (-> path
      io/file
      .getCanonicalPath))

(def es-src-dir
  (abspath
   (or (environ/env :elasticsearch-src)
       (-> "clj_git"
           io/resource
           io/file
           .getParent
           (io/file "elasticsearch-src")))))

(defn maybe-prep-repo [dir]
  (if (.exists (io/file dir ".git"))
    (do
      (printf "Elasticsearch source already cloned in %s.  Pulling..." dir)
      (flush)
      (git/git-pull (git/load-repo dir)))
    (do
      (printf "Elasticsearch source missing in %s.  Cloning..." dir)
      (flush)
      (git/git-clone
       dir
       "https://github.com/elastic/elasticsearch.git")))
  (println "  Done."))

(deftest parse-commit
  (maybe-prep-repo es-src-dir)
  (time
   (testing "the first thousand commits can parse"
     (is (= 1000 (->> es-src-dir
                      git/load-repo
                      git/git-log
                      (take 1000)
                      count))))))

Make ES src dir configurable

Make ES src dir configurable


(defproject {{app-name}} "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[aero "0.1.3"]
                 [cheshire "5.5.0"]
                 [mysql/mysql-connector-java "5.1.18"]
                 [org.clojure/clojure "1.7.0"]
                 [org.clojure/tools.cli "0.3.3"]
                 [org.onyxplatform/onyx "{{onyx-version}}"]
                 [org.onyxplatform/onyx-kafka "{{onyx-version}}.{{onyx-kafka-minor}}"]
                 [org.onyxplatform/onyx-seq "{{onyx-version}}.{{onyx-seq-minor}}"]
                 [org.onyxplatform/onyx-sql "{{onyx-version}}.{{onyx-sql-minor}}"]
                 {{#metrics?}}[org.onyxplatform/onyx-metrics "{{onyx-version}}.{{onyx-metrics-minor}}"]{{/metrics?}}]

  :profiles {:uberjar {:aot [{{app-name}}.launcher.aeron-media-driver
                             {{app-name}}.launcher.launch-prod-peers]}
             :dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]]
                   :source-paths ["src"]}})

(defproject {{app-name}} "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[aero "0.1.5" :exclusions [prismatic/schema]]
                 [cheshire "5.5.0"]
                 [mysql/mysql-connector-java "5.1.18"]
                 [org.clojure/clojure "1.7.0"]
                 [org.clojure/tools.cli "0.3.3"]
                 [org.onyxplatform/onyx "{{onyx-version}}"]
                 [org.onyxplatform/onyx-kafka "{{onyx-version}}.{{onyx-kafka-minor}}"]
                 [org.onyxplatform/onyx-seq "{{onyx-version}}.{{onyx-seq-minor}}"]
                 [org.onyxplatform/onyx-sql "{{onyx-version}}.{{onyx-sql-minor}}"]
                 {{#metrics?}}[org.onyxplatform/onyx-metrics "{{onyx-version}}.{{onyx-metrics-minor}}"]{{/metrics?}}]

  :profiles {:uberjar {:aot [{{app-name}}.launcher.aeron-media-driver
                             {{app-name}}.launcher.launch-prod-peers]}
             :dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]]
                   :source-paths ["src"]}})

Bump aero, use Onyx's prismatic schema

Bump aero, use Onyx's prismatic schema


(defproject debugging "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://github.com/funcool/catacumba"
  :license {:name "BSD (2-Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies [[org.clojure/clojure "1.7.0-RC1"]
                 [funcool/catacumba "0.1.0-alpha2"]
                 [prone "0.8.1"]]
  :main ^:skip-aot debugging.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

(defproject debugging "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://github.com/funcool/catacumba"
  :license {:name "BSD (2-Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies [[org.clojure/clojure "1.7.0-RC1"]
                 [funcool/catacumba "0.2.0"]
                 [prone "0.8.1"]]
  :main ^:skip-aot debugging.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

Update catacumba version on debugging example.


(ns hyphen-keeper.db
  "Persistence for the hyphenation dictionary"
  (:require [yesql.core :refer [defqueries]]))

(def ^:private db "jdbc:mysql://localhost:3306/hyphenation?user=hyphenation&serverTimezone=UTC")

(defqueries "hyphen_keeper/queries.sql" {:connection db})

(defn read-words
  "Return a coll of words for given `spelling`"
  [spelling]
  (-> {:spelling spelling} words))

(defn read-words-paginated
  "Return a coll of words for given `spelling` using `max-rows` and `offset` for pagination"
  [spelling offset max-rows]
  (-> {:spelling spelling :max_rows max-rows :offset offset}
      words-paginated))

(defn search-words
  "Return a coll of words for given `spelling` and given `search` term"
  [spelling search]
  (-> {:spelling spelling :search search}
      words-search))

(defn save-word!
  "Persist `word` with given `hyphenation` and `spelling`"
  [word hyphenation spelling]
  (-> {:word word :hyphenation hyphenation :spelling spelling}
      save-word-internal!))

(defn remove-word! [word spelling]
  (-> {:word word :spelling spelling}
      remove-word-internal!))

(ns hyphen-keeper.db
  "Persistence for the hyphenation dictionary"
  (:require [yesql.core :refer [defqueries]]))

(def ^:private db {:name "java:jboss/datasources/old-productions"})

(defqueries "hyphen_keeper/queries.sql" {:connection db})

(defn read-words
  "Return a coll of words for given `spelling`"
  [spelling]
  (-> {:spelling spelling} words))

(defn read-words-paginated
  "Return a coll of words for given `spelling` using `max-rows` and `offset` for pagination"
  [spelling offset max-rows]
  (-> {:spelling spelling :max_rows max-rows :offset offset}
      words-paginated))

(defn search-words
  "Return a coll of words for given `spelling` and given `search` term"
  [spelling search]
  (-> {:spelling spelling :search search}
      words-search))

(defn save-word!
  "Persist `word` with given `hyphenation` and `spelling`"
  [word hyphenation spelling]
  (-> {:word word :hyphenation hyphenation :spelling spelling}
      save-word-internal!))

(defn remove-word! [word spelling]
  (-> {:word word :spelling spelling}
      remove-word-internal!))

Use JNDI to find the data source

Use JNDI to find the data source


(ns madouc.db
  (:require [mount.core :refer [defstate]]
            [conman.core :as conman]
            [madouc.config :refer [env]]))

(defn- make-pool-spec
  [host db user pass]
  {:jdbc-url (format "jdbc:postgresql://%s/%s" host db)
   :username user
   :password pass})

(defstate con
  :start (conman/connect! (make-pool-spec
                           (env :db-host)
                           (env :db-name)
                           (env :db-user)
                           (env :db-password)))
  :stop (conman/disconnect! con))

(conman/bind-connection con "sql/queries.sql")

Add queries to database layer

Add queries to database layer


(defproject gridref-web "0.1.0"
  :description "Web service to convert an alpha numeric Ordnance Survey grid reference to easting / northing or easting / northing to a grid reference."
  :url "http://github.com/walkermatt/gridref-web"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [compojure "1.1.6"]
                 [ring/ring-jetty-adapter "1.2.1"]
                 [ring/ring-devel "1.2.1"]
                 [ring-middleware-format "0.3.1"]
                 [org.clojure/data.json "0.2.3"]
                 [environ "0.4.0"]
                 [gridref "0.1.1"]
                 [ring-mock "0.1.5"]]
  :min-lein-version "2.0.0"
  :plugins [[environ/environ.lein "0.3.1"]
            [lein-ring "0.8.8"]]
  :ring {:handler gridref-web.web/handler}
  :hooks [environ.leiningen.hooks]
  :main gridref-web.web
  :profiles {:production {:env {:production false}}})

(defproject gridref-web "0.1.0"
  :description "Web service to convert an alpha numeric Ordnance Survey grid reference to easting / northing or easting / northing to a grid reference."
  :url "http://github.com/walkermatt/gridref-web"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [compojure "1.1.6"]
                 [ring/ring-jetty-adapter "1.2.1"]
                 [ring/ring-devel "1.2.1"]
                 [ring-middleware-format "0.3.1"]
                 [org.clojure/data.json "0.2.3"]
                 [environ "0.4.0"]
                 [gridref "0.1.2"]
                 [ring-mock "0.1.5"]]
  :min-lein-version "2.0.0"
  :plugins [[environ/environ.lein "0.3.1"]
            [lein-ring "0.8.8"]]
  :ring {:handler gridref-web.web/handler}
  :hooks [environ.leiningen.hooks]
  :main gridref-web.web
  :profiles {:production {:env {:production false}}})

Bump version number of gridref

Bump version number of gridref


(ns themis.extended-protos
  (:require [themis.protocols :as protocols]))

(extend-protocol protocols/Navigable

  clojure.lang.PersistentVector
  (-navigate [t coordinate-vec]
    (get-in t coordinate-vec))

 clojure.lang.IPersistentMap
 (-navigate [t coordinate-vec]
   (get-in t coordinate-vec)))

(ns themis.extended-protos
  (:require [themis.protocols :as protocols]))

(extend-protocol protocols/Navigable

  clojure.lang.PersistentVector
  (-navigate [t coordinate-vec]
    (get-in t coordinate-vec))

 clojure.lang.IPersistentMap
 (-navigate [t coordinate-vec]
   (get-in t coordinate-vec))

  java.lang.String
  (-navigate [t coordinate-vec]
    (get-in t coordinate-vec)))

Allow navigating strings as a base data structure


(defproject metrics-clojure "1.0.0"
  :description "A Clojure façade for Coda Hale's metrics library."
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [com.yammer.metrics/metrics-core "2.2.0"]]
  :repositories {"repo.codahale.com" "http://repo.codahale.com"
                 ;; to get Clojure snapshots
                 "sonatype" {:url "http://oss.sonatype.org/content/repositories/releases"
                             :snapshots false
                             :releases {:checksum :fail :update :always}}
                 "sonatype-snapshots" {:url "http://oss.sonatype.org/content/repositories/snapshots"
                                       :snapshots true
                                       :releases {:checksum :fail :update :always}}}
    :profiles {:1.3    {:dependencies [[org.clojure/clojure "1.3.0"]]}
               :1.4    {:dependencies [[org.clojure/clojure "1.4.0"]]}
               :1.6    {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}
               :master {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}}
  :aliases  {"all" ["with-profile" "dev:dev,1.3:dev,1.4:dev,1.6:dev,master"]}
  :warn-on-reflection true)

(defproject metrics-clojure "1.0.0"
  :description "A Clojure façade for Coda Hale's metrics library."
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [com.yammer.metrics/metrics-core "2.2.0"]]
  :repositories {"repo.codahale.com" "http://repo.codahale.com"
                 ;; to get Clojure snapshots
                 "sonatype" {:url "http://oss.sonatype.org/content/repositories/releases"
                             :snapshots false
                             :releases {:checksum :fail :update :always}}
                 "sonatype-snapshots" {:url "http://oss.sonatype.org/content/repositories/snapshots"
                                       :snapshots true
                                       :releases {:checksum :fail :update :always}}}
    :profiles {:1.3    {:dependencies [[org.clojure/clojure "1.3.0"]]}
               :1.4    {:dependencies [[org.clojure/clojure "1.4.0"]]}
               :1.6    {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}
               :master {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}}
  :aliases  {"all" ["with-profile" "+dev:+1.3:+1.4:+1.6:+master"]}
  :warn-on-reflection true)

Work around Leiningen issue 1099

Work around Leiningen issue 1099


(ns ^{:doc "Functions dealing with making various forms of
            Midje output be ergonomically colorful."}
  midje.emission.colorize
  (:require [colorize.core :as color]
            [clojure.string :as str]
            [midje.config :as config])
  (:use [midje.util.ecosystem :only [getenv on-windows?]]))

(defn colorize-setting []
  (config/choice :colorize))

(defn- colorize-config-as-str []
  (let [setting-as-str (str (colorize-setting))]
    (when-not (str/blank? setting-as-str) setting-as-str)))

(defn- colorize-choice []
  (str/upper-case (or (getenv "MIDJE_COLORIZE")
                      (colorize-config-as-str)
                      (str (not (on-windows?))))))

(defn init! []
  (case (colorize-choice)
    "TRUE" (do
             (def fail color/red)
             (def pass color/green)
             (def note color/cyan))

    ("REVERSE" ":REVERSE") (do
                (def fail color/red-bg)
                (def pass color/green-bg)
                (def note color/cyan-bg))

    (do
      (def fail str)
      (def pass str)
      (def note str))))

(ns ^{:doc "Functions dealing with making various forms of
            Midje output be ergonomically colorful."}
  midje.emission.colorize
  (:require [colorize.core :as color]
            [clojure.string :as str]
            [midje.config :as config])
  (:use [midje.util.ecosystem :only [getenv on-windows?]]))

(defn colorize-setting []
  (config/choice :colorize))

(defn- colorize-config-as-str []
  (let [setting (colorize-setting)
        setting (if (keyword? setting) (name setting) setting)
        setting-as-str (str setting)]
    (when-not (str/blank? setting-as-str) setting-as-str)))

(defn- colorize-choice []
  (str/upper-case (or (getenv "MIDJE_COLORIZE")
                      (colorize-config-as-str)
                      (str (not (on-windows?))))))

(defn init! []
  (case (colorize-choice)
    "TRUE" (do
             (def fail color/red)
             (def pass color/green)
             (def note color/cyan))

    "REVERSE" (do
                (def fail color/red-bg)
                (def pass color/green-bg)
                (def note color/cyan-bg))

    (do
      (def fail str)
      (def pass str)
      (def note str))))

Convert keyword to a string name

Refactor: Convert keyword to a string name


(ns devsetup
  (:require [demo :as site]
            [runtests]
            [reagent.core :as r]
            [figwheel.client :as fw]))

(defn test-results []
  [runtests/test-output-mini])

(defn start! []
  (demo/start! {:test-results test-results})
  (runtests/run-tests))

(when r/is-client
  (fw/start
   {:websocket-url "ws://localhost:3449/figwheel-ws"
    :jsload-callback #(start!)
    :heads-up-display true
    :load-warninged-code false}))

(start!)

(ns ^:figwheel-always devsetup
    (:require [demo :as site]
              [runtests]
              [reagent.core :as r]
              [figwheel.client :as fw]))

(when r/is-client
  (fw/start
   {:websocket-url "ws://localhost:3449/figwheel-ws"}))

(defn test-results []
  [runtests/test-output-mini])

(defn start! []
  (demo/start! {:test-results test-results})
  (runtests/run-tests))

(start!)

Make tests only run once when figwheel reloads


;; https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md
{:provided
 {:dependencies
  [[djblue/portal "0.21.2"]]}
 :user
 {:plugins
  [[cider/cider-nrepl "0.27.4"]
   [lein-ancient "1.0.0-RC3"]
   [lein-check-namespace-decls "1.0.4"]
   [lein-cljfmt "0.8.0"]
   [lein-nsorg "0.3.0"]
   [nrepl "0.9.0"]
   [refactor-nrepl "3.1.0"]]}
  :dependencies
   [#_[alembic "0.3.2"]
    [antq "RELEASE"]
    [clj-kondo "RELEASE"]]
  :aliases {"clj-kondo" ["run" "-m" "clj-kondo.main"]
            "outdated"  ["run" "-m" "antq.core"]}}

;; https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md
{:provided
 {:dependencies
  [[djblue/portal "0.21.2"]
   [fipp "0.6.24"]]}
 :user
 {:plugins
  [[cider/cider-nrepl "0.27.4"]
   [lein-ancient "1.0.0-RC3"]
   [lein-check-namespace-decls "1.0.4"]
   [lein-cljfmt "0.8.0"]
   [lein-nsorg "0.3.0"]
   [nrepl "0.9.0"]
   [refactor-nrepl "3.1.0"]]}
  :dependencies
   [#_[alembic "0.3.2"]
    [antq "RELEASE"]
    [clj-kondo "RELEASE"]]
  :aliases {"clj-kondo" ["run" "-m" "clj-kondo.main"]
            "outdated"  ["run" "-m" "antq.core"]}}

Move portal to :provided section

Move portal to :provided section


(ns quil.helpers.applet-listener
  (:gen-class
    :name quil.helpers.AppletListener
    :main false
    :init init
    :state listeners
    :constructors {[java.util.Map] []}
    :methods [["dispose" [] java.lang.Void]]))

(defn safe-call [fn]
  (when fn (fn)))

(defn -init [listeners]
  [[] listeners])

(defn -dispose [this]
  (safe-call (:on-dispose (.listeners this))))

(ns quil.helpers.applet-listener
  (:gen-class
    :name quil.helpers.AppletListener
    :main false
    :init init
    :state listeners
    :constructors {[java.util.Map] []}
    :methods [["dispose" [] java.lang.Object]]))

(defn safe-call [fn]
  (when fn (fn)))

(defn -init [listeners]
  [[] listeners])

(defn -dispose [this]
  (safe-call (:on-dispose (.listeners this))))

Fix on-close handler so it can return any type, not only nil.


; vi: ft=clojure

(set-env!
  :resource-paths #{"src"}
  :dependencies '[[org.clojure/clojure "1.8.0"]
                  [incanter "1.9.0"]])

(task-options!
    aot {:all true}
    pom {:project 'analyze-data
         :version "0.0.0"}
    jar {:main 'analyze-data.core})

(deftask build []
  (comp (aot) (pom) (uber) (jar) (target)))

; vi: ft=clojure

(set-env!
  :resource-paths #{"src", "test"}
  :dependencies '[[org.clojure/clojure "1.8.0"]
                  [org.clojure/data.csv "0.1.3"]
                  [incanter "1.9.0"]
                  [adzerk/boot-test "1.2.0" :scope "test"]])

(require '[adzerk.boot-test :refer [test]])

(task-options!
    aot {:all true}
    pom {:project 'analyze-data
         :version "0.0.0"}
    jar {:main 'analyze-data.core})

(deftask build []
  (comp (aot) (pom) (uber) (jar) (target)))

Add data.csv, boot-test, and set up for testing.


(ns clj-chess.ecn
  "Functions for reading chess games in ECN (extensible chess notation)
  format."
  (:require [clojure.edn :as edn]
            [clojure.java.io :as io])
  (:import (java.io PushbackReader)))

(defn reader
  "Convenience function for creating a java PushbackReader for the given
  file name. Why isn't this included in Clojure?"
  [filename]
  (PushbackReader. (io/reader filename)))

(defn edn-seq
  "A lazy sequence of EDN objects in from the provided reader."
  [rdr]
  (when-let [game (edn/read rdr)]
    (cons game (lazy-seq (edn-seq rdr)))))

(defn game-headers
  "Returns a lazy sequence of the game headers of an ECN file."
  [rdr]
  (map (comp rest second) (edn-seq rdr)))

(defn games-in-file [ecn-file]
  (edn-seq (reader ecn-file)))

(ns clj-chess.ecn
  "Functions for reading chess games in ECN (extensible chess notation)
  format."
  (:require [clojure.edn :as edn]
            [clojure.java.io :as io])
  (:import (java.io PushbackReader)))

(defn reader
  "Convenience function for creating a java PushbackReader for the given
  file name. Why isn't this included in Clojure?"
  [filename]
  (PushbackReader. (io/reader filename)))

(defn edn-seq
  "A lazy sequence of EDN objects in from the provided reader."
  [rdr]
  (when-let [game (edn/read {:eof nil} rdr)]
    (cons game (lazy-seq (edn-seq rdr)))))

(defn game-headers
  "Returns a lazy sequence of the game headers of an ECN file."
  [rdr]
  (map (comp rest second) (edn-seq rdr)))

(defn games-in-file [ecn-file]
  (edn-seq (reader ecn-file)))

Fix EOF bug when reading ECN files.

Fix EOF bug when reading ECN files.


(ns selmer.node
  " Node protocol for the objects that get accum'd in the post-parse vector.
  Same vector that will be processed by the runtime context-aware renderer.
  Currently only TextNodes and FunctionNodes. Anything that requires action
  upon context map data at runtime is handled by a generated anonymous function. "
  (:gen-class))

;; Generic INode protocol

(defprotocol INode
  (render-node [this context-map] "Renders the context"))

;; Implements fn handler for the context map. fn handlers can
;; access any data in the context map.

(deftype FunctionNode [handler]
  INode
  (render-node [this context-map]
    (handler context-map)))

;; Implements dumb text content injection at runtime.

(deftype TextNode [text]
  INode
  (render-node [this context-map]
    text))

(ns selmer.node
  " Node protocol for the objects that get accum'd in the post-parse vector.
  Same vector that will be processed by the runtime context-aware renderer.
  Currently only TextNodes and FunctionNodes. Anything that requires action
  upon context map data at runtime is handled by a generated anonymous function. "
  (:gen-class))

;; Generic INode protocol

(defprotocol INode
  (render-node [this context-map] "Renders the context"))

;; Implements fn handler for the context map. fn handlers can
;; access any data in the context map.

(deftype FunctionNode [handler]
  INode
  (render-node [this context-map]
    (handler context-map)))

;; Implements dumb text content injection at runtime.

(deftype TextNode [text]
  INode
  (render-node [this context-map]
    text)
  (toString [_]
    text))

Add toString implementation to TextNode

Add toString implementation to TextNode

For ease of debugging, REPL interaction etc, add toString
implementation for TextNode which simply returns the node text.


;;;
;;;   Copyright 2015 Ruediger Gad
;;;
;;;   This software is released under the terms of the Eclipse Public License
;;;   (EPL) 1.0. You can find a copy of the EPL at:
;;;   http://opensource.org/licenses/eclipse-1.0.php
;;;

(ns
  ^{:author "Ruediger Gad",
    :doc "Helper that are primarily used during experiments"}
  dsbdp.experiment-helper
  (:require
    [clojure.walk :refer :all]
    [dsbdp.byte-array-conversion :refer :all]))

(defmacro create-proc-fns
  [fn-1 fn-n n]
  (loop [fns (prewalk-replace {:idx 0} [fn-1])]
    (if (< (count fns) n)
      (recur (conj fns (prewalk-replace {:idx (count fns)} fn-n)))
      (do
        (println "proc-fns-full:" fns)
        fns))))

(defmacro create-no-op-proc-fns
  [n]
  `(create-proc-fns (fn [~'_ ~'_]) (fn [~'_ ~'_]) ~n))

(defmacro create-inc-proc-fns
  [n]
  `(create-proc-fns (fn [~'i ~'_] (inc ~'i)) (fn [~'_ ~'o] (inc ~'o)) ~n))

;;;
;;;   Copyright 2015 Ruediger Gad
;;;
;;;   This software is released under the terms of the Eclipse Public License
;;;   (EPL) 1.0. You can find a copy of the EPL at:
;;;   http://opensource.org/licenses/eclipse-1.0.php
;;;

(ns
  ^{:author "Ruediger Gad",
    :doc "Helper that are primarily used during experiments"}
  dsbdp.experiment-helper
  (:require
    [clojure.walk :refer :all]
    [dsbdp.byte-array-conversion :refer :all]))

(defmacro create-proc-fns
  [fn-1 fn-n n]
  (loop [fns (prewalk-replace {:idx 0} [fn-1])]
    (if (< (count fns) n)
      (recur (conj fns (prewalk-replace {:idx (count fns)} fn-n)))
      (do
        (println "proc-fns-full:" fns)
        (println "proc-fns-short:" (.replaceAll (str fns) "(?<=\\()([a-zA-Z\\.\\-]++/)" ""))
        fns))))

(defmacro create-no-op-proc-fns
  [n]
  `(create-proc-fns (fn [~'_ ~'_]) (fn [~'_ ~'_]) ~n))

(defmacro create-inc-proc-fns
  [n]
  `(create-proc-fns (fn [~'i ~'_] (inc ~'i)) (fn [~'_ ~'o] (inc ~'o)) ~n))

Use string replacement to display short version of proc-fns.


(ns clj-ravendb.client-deleting-indexes-test
  (:require [clojure.test :refer :all]
            [clj-ravendb.client :refer :all]
            [clj-ravendb.requests :as req]
            [clj-ravendb.responses :as res]
            [clj-ravendb.config :refer :all]))

(let [caching-client (client ravendb-url ravendb-database {:caching :aggressive :ssl-insecure? true :oauth-url oauth-url :api-key api-key})
      client (client ravendb-url ravendb-database {:ssl-insecure? true :oauth-url oauth-url :api-key api-key})]
  (doseq [i ["test-index" "test-index2"]]
    (put-index! client {:index i
                        :where [[:== :name "TestDocument"]]
                        :select [:name]}))
  (deftest test-delete-index-returns-correct-status-code
    (testing "deleting an index returns the correct status code"
      (let [actual (delete-index! client "test-index")
            expected 204]
        (is (= expected (actual :status))))))

  (deftest test-delete-index-returns-correct-status-code-when-using-caching-client
    (testing "deleting an index returns the correct status code"
      (let [actual (delete-index! caching-client "test-index2")
            expected 204]
        (is (= expected (actual :status)))))))

(ns clj-ravendb.client-deleting-indexes-test
  (:require [clojure.test :refer :all]
            [clj-ravendb.client :refer :all]
            [clj-ravendb.requests :as req]
            [clj-ravendb.responses :as res]
            [clj-ravendb.config :refer :all]))

(let [caching-client (client ravendb-url ravendb-database {:caching :aggressive :ssl-insecure? true :oauth-url oauth-url :api-key api-key})
      client (client ravendb-url ravendb-database {:ssl-insecure? true :oauth-url oauth-url :api-key api-key})
      indexes [(str "test-index" (System/currentTimeMillis)) (str "test-index" (System/currentTimeMillis))]]
  (doseq [i indexes]
    (put-index! client {:index i
                        :where [[:== :name "TestDocument"]]
                        :select [:name]}))
  (deftest test-delete-index-returns-correct-status-code
    (testing "deleting an index returns the correct status code"
      (let [actual (delete-index! client (first indexes))
            expected 204]
        (is (= expected (actual :status))))))

  (deftest test-delete-index-returns-correct-status-code-when-using-caching-client
    (testing "deleting an index returns the correct status code"
      (let [actual (delete-index! caching-client (second indexes))
            expected 204]
        (is (= expected (actual :status)))))))

Create indexes with more unique names because of concurrent testing in travis.


(ns tixi.mutators.delete
  (:require [tixi.data :as d]
            [tixi.mutators.shared :as msh]
            [tixi.mutators.locks :as ml]
            [tixi.mutators.undo :as mu]
            [tixi.items :as i]))

(defn delete-items! [ids]
  (when (not-empty ids)
    (mu/snapshot!)
    (doseq [id ids]
      (ml/delete-from-locks! id (d/completed-item id))
      (msh/update-state! update-in [:completed] dissoc id))))

(ns tixi.mutators.delete
  (:require [tixi.data :as d]
            [tixi.mutators.shared :as msh]
            [tixi.mutators.locks :as ml]
            [tixi.mutators.undo :as mu]
            [tixi.items :as i]))

(defn delete-items! [ids]
  (when (not-empty ids)
    (mu/snapshot!)
    (doseq [id ids]
      (swap! d/data update-in [:cache] dissoc id)
      (ml/delete-from-locks! id (d/completed-item id))
      (msh/update-state! update-in [:completed] dissoc id))))

Remove cache when deleting an item

Remove cache when deleting an item


(ns etcd-clojure.core-test
  (:require [clojure.test :refer :all]
            [etcd-clojure.core :as etcd]))

(defn setup-test []
  (etcd/connect! "http://127.0.0.1:4001"))
(defn teardown-test []
  (println "teardown"))

(defn once-fixtures [f]
  (setup-test)
  (try
    (f)
    (finally (teardown-test))))

(use-fixtures :once once-fixtures)

(deftest test-set
  (testing "should set a value"
    (is (= "bar" (get (etcd/set "foo" "bar") "value")))))

(deftest test-create
  (testing "should set a value"
    (is (= "bar" (get (etcd/create "foo" "bar") "value")))))

(deftest test-delete
  (testing "should delete a value"
    (etcd/set "foo" "bar")
    (is (= "DELETE" (get (etcd/delete "foo") "action")))))

(deftest test-get
  (testing "should get a value"
    (etcd/set "foo" "bar")
    (is (= "bar" (etcd/get "foo")))))

(ns etcd-clojure.core-test
  (:require [clojure.test :refer :all]
            [etcd-clojure.core :as etcd]))

(defn setup-test []
  (etcd/connect! "http://127.0.0.1:4001"))
(defn teardown-test []
  (println "teardown"))

(defn once-fixtures [f]
  (setup-test)
  (try
    (f)
    (finally (teardown-test))))

(use-fixtures :once once-fixtures)

(deftest test-set
  (testing "should set a value"
    (is (= "bar" (get (etcd/set "foo" "bar") "value")))))

(deftest test-create
  (testing "should set a value"
    (is (= "bar" (get (etcd/create "foo" "bar") "value")))))

(deftest test-delete
  (testing "should delete a value"
    (etcd/set "foo" "bar")
    (is (= "delete" (get (etcd/delete "foo") "action")))))

(deftest test-get
  (testing "should get a value"
    (etcd/set "foo" "bar")
    (is (= "bar" (etcd/get "foo")))))

Delete to lower case to allow tests to pass


(ns dna)

(defn- strand-convert [ch]
    (cond
        (= \T ch) \U
        :else ch
        )
)

(defn to-rna [dna]
    (apply str (map strand-convert dna))
)

(ns dna)

(defn- strand-convert [ch]
    (if (= \T ch) \U ch)
)

(defn to-rna [dna]
    (apply str (map strand-convert dna))
)

Use if instead of cond

Use if instead of cond


(ns matross.test.helper
  "Helper functions for writing and running tests"
  (:require [me.raynes.conch :refer [with-programs]]
            [matross.connections.ssh :refer [translate-ssh-config ssh-connection]]
            [matross.connections.core :refer [connect disconnect]]))

(defn get-available-vms []
  (with-programs [vagrant grep cut]
    (cut "-f1" "-d "
         (vagrant "status" {:seq true})
         {:seq true})))

(def vagrant-test-connection
  (memoize (fn [] (translate-ssh-config (slurp (System/getenv "TEST_SSH_CONF"))))))

(defmacro task-tests
  "Evaluate the body against the test vm connection, exposed as conn"
  [conn & body]

  `(let [~conn (ssh-connection (vagrant-test-connection))]
     (connect ~conn)
     ~@body
     (disconnect ~conn)))

(ns matross.test.helper
  "Helper functions for writing and running tests"
  (:require [me.raynes.conch :refer [with-programs]]
            [matross.connections.ssh :refer [translate-ssh-config ssh-connection]]
            [matross.connections.debug :refer [debug-connection]]
            [matross.connections.core :refer [connect disconnect]]))

(defn get-available-vms []
  (with-programs [vagrant grep cut]
    (cut "-f1" "-d "
         (vagrant "status" {:seq true})
         {:seq true})))

(def vagrant-test-connection
  (memoize (fn [] (translate-ssh-config (slurp (System/getenv "TEST_SSH_CONF"))))))

(defn test-connection []
  (let [conn (ssh-connection (vagrant-test-connection))]
    (if-let [debug (System/getenv "TEST_DEBUG")]
      (debug-connection conn)
      conn)))

(defmacro task-tests
  "Evaluate the body against the test vm connection, exposed as conn"
  [conn & body]

  `(let [~conn (test-connection)]
     (connect ~conn)
     ~@body
     (disconnect ~conn)))

Allow debug output during tests.

Allow debug output during tests.

if the env var TEST_DEBUG is set, debug output will be enabled during
the test runs.


(ns ^:figwheel-always re-view.core
  (:require [clojure.string :as string]))

(defn parse-name [n]
  (str (name (ns-name *ns*)) "/" n))

(defmacro defview
  ([view-name methods]
   `(def ~view-name
      (~'re-view.core/view ~(assoc methods
                              :display-name (str (last (string/split (name (ns-name *ns*)) #"\.")) "/" view-name)))))
  ([view-name a1 a2 & body]
   (let [[methods args body] (if (map? a1)
                               [a1 a2 body]
                               [{} a1 (cons a2 body)])]
     `(~'re-view.core/defview ~view-name
        ~(assoc methods :render `(~'fn ~args (~'re-view.hiccup/element (do ~@body))))))))

(ns ^:figwheel-always re-view.core
  (:require [clojure.string :as string]))

(defn parse-name [n]
  (str (name (ns-name *ns*)) "/" n))

(defmacro defview
  ([view-name methods]
   `(def ~view-name
      (~'re-view.core/view (assoc ~methods
                             :display-name ~(str (last (string/split (name (ns-name *ns*)) #"\.")) "/" view-name)))))
  ([view-name a1 a2 & body]
   (let [[methods args body] (if (vector? a1)
                               [{} a1 (cons a2 body)]
                               [a1 a2 body])]
     `(~'re-view.core/defview ~view-name
        (~'assoc ~methods :render (~'fn ~args (~'re-view.hiccup/element (do ~@body))))))))

Remove requirement that lifecycle functions must be passed as literal map


(ns dragon.data.sources.core
  (:require [clojure.java.shell :as shell]
            [dragon.config :as config]
            [taoensso.timbre :as log]))

(defn execute-db-command!
  [component]
  (let [start-cfg (config/db-start-config component)
        home (:home start-cfg)
        args (:args start-cfg)]
    (shell/with-sh-dir home
      (log/debugf "Running command in %s ..." home)
      (log/debug "Using shell/sh args:" args)
      (apply shell/sh args))))

(defn remove-connection
  [component]
  (assoc component :conn nil))

(ns dragon.data.sources.core
  (:require [clojure.java.shell :as shell]
            [dragon.config :as config]
            [dragon.util :as util]
            [taoensso.timbre :as log]))

(defn execute-db-command!
  [component]
  (let [start-cfg (config/db-start-config component)
        home (:home start-cfg)
        args (:args start-cfg)]
    (shell/with-sh-dir home
      (log/debugf "Running command in %s ..." home)
      (log/debug "Using shell/sh args:" args)
      (apply util/shell! args))))

(defn remove-connection
  [component]
  (assoc component :conn nil))

Use new logging shell command.

Use new logging shell command.


(ns bytebuf.buffer
  "Buffer abstractions."
  (:import java.nio.ByteBuffer
           io.netty.buffer.ByteBuf
           io.netty.buffer.ByteBufAllocator))

(defprotocol IBuffer
  (read-integer* [_] "Read an integer (32 bits) from buffer.")
  (read-long* [_] "Read an long (64 bits) from buffer.")
  (tell* [_] "Get the current position index of buffer.")
  (seek* [_ val] "Set the current position index on buffer."))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; NIO ByteBuffer implementation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(extend-type ByteBuffer
  IBuffer
  (read-integer* [buff]
    (.getInt buff))
  (read-long* [buff]
    (.getLong buff))
  (tell* [buff]
    (.position buff))
  (seek* [buff val]
    (.position buff val)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Public Api
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(def ^{:private true}
  allocator (ByteBufAllocator/DEFAULT))

(defn allocate
  ([size] (allocate size {}))
  ([size {:keys [type impl] :or {type :heap impl :nio}}]
   (case impl
     :nio (case type
            :heap (ByteBuffer/allocate size)
            :direct (ByteBuffer/allocateDirect size))
     :netty (case type
              :heap (.heapBuffer allocator size)
              :direct (.directBuffer allocator size)))))

(defn seek!
  "Set the position index on the buffer."
  [buff ^long pos]
  (seek! buff pos))

(ns bytebuf.buffer
  "Buffer abstractions."
  (:import java.nio.ByteBuffer
           io.netty.buffer.ByteBuf
           io.netty.buffer.ByteBufAllocator))

(defprotocol IBuffer
  (read-int [_ pos] "Read an integer (32 bits) from buffer.")
  (write-int [_ pos value] "Write an integer to the buffer.")
  (read-long [_ pos] "Read an long (64 bits) from buffer.")
  (write-long [_ pos value] "Write an long to the buffer."))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; NIO ByteBuffer implementation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(extend-type ByteBuffer
  IBuffer
  (read-integer* [buff]
    (.getInt buff))
  (read-long* [buff]
    (.getLong buff))
  (tell* [buff]
    (.position buff))
  (seek* [buff val]
    (.position buff val)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Public Api
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(def ^{:private true}
  allocator (ByteBufAllocator/DEFAULT))

(defn allocate
  ([size] (allocate size {}))
  ([size {:keys [type impl] :or {type :heap impl :nio}}]
   (case impl
     :nio (case type
            :heap (ByteBuffer/allocate size)
            :direct (ByteBuffer/allocateDirect size))
     :netty (case type
              :heap (.heapBuffer allocator size)
              :direct (.directBuffer allocator size)))))

(defn seek!
  "Set the position index on the buffer."
  [buff ^long pos]
  (seek! buff pos))

Change signature of IBuffer related functions.


(ns incise.parsers.html-spec
  (:require [incise.parsers.html :refer :all]
            [incise.parsers.core :refer [map->Parse]]
            [clojure.java.io :refer [file resource]]
            [speclj.core :refer :all]))

(describe "File->Parse"
  (with short-md-file (file (resource "spec/short-sample.md")))
  (it "reads some stuff out of a file, yo"
    (should= (map->Parse {:title "My Short Page"
                          :layout :page
                          :date "2013-08-12"
                          :path "2013/8/12/my-short-page/index.html"
                          :tags [:cool]
                          :category :blarg
                          :content "\n\nHey there!\n"
                          :extension "/index.html"})
             (File->Parse identity @short-md-file))))

(run-specs)

(ns incise.parsers.html-spec
  (:require [incise.parsers.html :refer :all]
            [incise.parsers.core :refer [map->Parse]]
            [clj-time.coerce :refer [to-date]]
            [clojure.java.io :refer [file resource]]
            [speclj.core :refer :all]))

(describe "File->Parse"
  (with short-md-file (file (resource "spec/short-sample.md")))
  (it "reads some stuff out of a file, yo"
    (should= (map->Parse {:title "My Short Page"
                          :layout :page
                          :date (to-date "2013-08-12")
                          :path "2013/8/12/my-short-page/index.html"
                          :tags [:cool]
                          :category :blarg
                          :content "\n\nHey there!\n"
                          :extension "/index.html"})
             (File->Parse identity @short-md-file))))

(run-specs)

Fix html spec to work with coerced dates.


{
 :name "split-filter-fastqs",
 :path "",
 :func (fn [eid & data]
         (if (pg/eoi? eid)
           (pg/done)
           (let [exp (cmn/get-exp-info eid :exp)]
             (infof "Splitting and filtering fastqs by replicates for %s" eid)
             ;; This case dispatching is lame! Need to fix with mmethod
             (case exp
               :tnseq (htts/split-filter-fastqs eid)
               :rnaseq (htrs/split-filter-fastqs eid)
               :wgseq (htws/split-filter-fastqs eid))
             eid)))

 :description "Uses experiment id EID to obtain set of initial fastqs for experiment and then splits them by experiment sample barcodes and filters these for quality, then writes new fastqs for all replicates.",
}

{
 :name "split-filter-fastqs",
 :path "",
 :func (fn [eid & data]
         (if (pg/eoi? eid)
           (pg/done)
           (let [exp (cmn/get-exp-info eid :exp)]
             (infof "Splitting and filtering fastqs by replicates for %s" eid)
             ;; This case dispatching is lame! Need to fix with mmethod
             (case exp
               :tnseq (htts/split-filter-fastqs eid)
               :rnaseq (htrs/split-filter-fastqs eid)
               :termseq (httm/split-filter-fastqs eid)
               :wgseq (htws/split-filter-fastqs eid))
             eid)))

 :description "Uses experiment id EID to obtain set of initial fastqs for experiment and then splits them by experiment sample barcodes and filters these for quality, then writes new fastqs for all replicates.",
}

Support Term-Seq. Shows even more why should be refactored to multimethods!


(ns org.scode.sob
  (:gen-class)
  (:require [org.scode.sob.markdown :as markdown]
            [clojure.contrib.command-line :as cmdline]
            [clojure.contrib.logging :as logging]
            [ring.adapter.jetty])
  (:use [org.scode.sob.repos :as repos]))

(defn die [msg]
  (logging/fatal msg)
  (System/exit 1))

(defn make-blog-app
  [port base path]
  (let [repos (repos/new path)]
    (fn [req]
      {:status 200
       :headers {"Content-Type" "text/html"}
       :body (str req)})))

(defn serve-blog
  "Start serving a blog at http://*:port/base."
  [port base path]
  (logging/info (str "starting sob on *:" port base ", serving " path))
  (ring.adapter.jetty/run-jetty (make-blog-app port base path) {:port port}))

(defn -main [& args]
  (cmdline/with-command-line args
    "sob - scode's own blog"
    [[port     "Select listen port" 8081]
     [base     "Select base URI path" "/"]
     paths]
    (if (> 1 (count paths))
      (die "only one file system path currently supported"))
    (if (empty? paths)
      (die "must specify the path to a blog"))
    (serve-blog port base (first paths))))

(ns org.scode.sob
  (:gen-class)
  (:require [org.scode.sob.markdown :as markdown]
            [clojure.contrib.command-line :as cmdline]
            [clojure.contrib.logging :as logging]
            [ring.adapter.jetty])
  (:use [org.scode.sob.repos :as repos]))

(defn die [msg]
  (logging/fatal msg)
  (System/exit 1))

(defn make-blog-app
  [base path]
  (let [repos (repos/new path)]
    (fn [req]
      {:status 200
       :headers {"Content-Type" "text/html"}
       :body (str req)})))

(defn serve-blog
  [port app]
  (ring.adapter.jetty/run-jetty app {:port port}))

(defn -main [& args]
  (cmdline/with-command-line args
    "sob - scode's own blog"
    [[port     "Select listen port" 8081]
     [base     "Select base URI path" "/"]
     paths]
    (if (> 1 (count paths))
      (die "only one file system path currently supported"))
    (if (empty? paths)
      (die "must specify the path to a blog"))
    (logging/info (str "starting sob on *:" port base))
    (serve-blog port (make-blog-app base (first paths)))))

Move functionality out of serve-blog.

Move functionality out of serve-blog.


(ns audio-utils.recorder
  (:require [om.next :as om :refer-macros [defui]]
            [om.dom :as dom]
            [audio-utils.util :refer [audio-context get-user-media]]
            [audio-utils.gate :as g]))

(defui Recorder
  Object
  (start [this]
    (let [audio-ctx (audio-context)
          gate      (g/gate {:audio-ctx audio-ctx})]
      (om/update-state! this assoc
                        :audio-ctx audio-ctx
                        :gate gate)
      (get-user-media {:audio true}
                      #(.connect-audio-nodes this %)
                      js/console.warn)))

  (connect-audio-nodes [this stream]
    (let [{:keys [audio-ctx gate]} (om/get-state this)
          source                   (.createMediaStreamSource audio-ctx
                                                             stream)]
      (.connect source (.-destination audio-ctx))))

  (stop [this]
    (let [audio-ctx (:audio-ctx (om/get-state this))]
      (.close audio-ctx)
      (om/update-state! this dissoc :audio-ctx)))

  (componentWillReceiveProps [this new-props]
    (when (not= (:record? (om/props this))
                (:record? new-props))
      (if (:record? new-props)
        (.start this)
        (.stop this))))

  (render [this]
    (dom/div nil)))

(def recorder (om/factory Recorder))

(ns audio-utils.recorder
  (:require [om.next :as om :refer-macros [defui]]
            [om.dom :as dom]
            [audio-utils.util :refer [audio-context get-user-media]]
            [audio-utils.gate :as g]))

(defui Recorder
  Object
  (start [this]
    (let [audio-ctx (audio-context)
          gate      (g/gate {:audio-ctx audio-ctx})]
      (om/update-state! this assoc
                        :audio-ctx audio-ctx
                        :gate gate)
      (get-user-media {:audio true}
                      #(.connect-audio-nodes this %)
                      js/console.warn)))

  (connect-audio-nodes [this stream]
    (let [{:keys [audio-ctx gate]} (om/get-state this)
          source                   (.createMediaStreamSource audio-ctx
                                                             stream)]
      (.connect source gate)
      (.connect gate (.-destination audio-ctx))))

  (stop [this]
    (let [audio-ctx (:audio-ctx (om/get-state this))]
      (.close audio-ctx)
      (om/update-state! this dissoc :audio-ctx)))

  (componentWillReceiveProps [this new-props]
    (when (not= (:record? (om/props this))
                (:record? new-props))
      (if (:record? new-props)
        (.start this)
        (.stop this))))

  (render [this]
    (dom/div nil)))

(def recorder (om/factory Recorder))

Insert the gate into the mix

Insert the gate into the mix


(defproject thinktopic/cortex "0.1.0-SNAPSHOT"
  :description "A neural network toolkit for Clojure."
  :dependencies [[org.clojure/clojure "1.8.0-RC4"]
                 [com.taoensso/timbre "4.2.0"]
                 [net.mikera/vectorz-clj "0.40.0"]
                 [org.clojure/test.check "0.9.0"]]

  :jvm-opts  ["-Xmx8g"
              "-XX:+UseConcMarkSweepGC"
              "-XX:-OmitStackTraceInFastThrow"])

(defproject thinktopic/cortex "0.1.0-SNAPSHOT"
  :description "A neural network toolkit for Clojure."
  :dependencies [[org.clojure/clojure "1.8.0-RC5"]
                 [com.taoensso/timbre "4.2.0"]
                 [net.mikera/vectorz-clj "0.40.0"]
                 [org.clojure/test.check "0.9.0"]]

  :jvm-opts  ["-Xmx8g"
              "-XX:+UseConcMarkSweepGC"
              "-XX:-OmitStackTraceInFastThrow"])

Update to latest Clojure RC5

Update to latest Clojure RC5


(defproject com.stuartsierra/component "0.2.2"
  :description "Managed lifecycle of stateful objects"
  :url "https://github.com/stuartsierra/component"
  :license {:name "The MIT License"
            :url "http://opensource.org/licenses/MIT"}
  :min-lein-version "2.1.3"  ; added :global-vars
  :dependencies [[com.stuartsierra/dependency "0.1.1"]]
  :global-vars {*warn-on-reflection* true}
  :aliases {"test-all"
            ["with-profile" "clj1.4:clj1.5:clj1.6:clj1.7" "test"]}
  :profiles {:dev {:dependencies [[org.clojure/clojure "1.6.0"]
                                  [org.clojure/tools.namespace "0.2.4"]]
                   :source-paths ["dev"]}
             :clj1.7 {:dependencies [[org.clojure/clojure "1.7.0-master-SNAPSHOT"]]
                      :repositories {"sonatype-oss-public"
                                     "https://oss.sonatype.org/content/groups/public"}}
             :clj1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
             :clj1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
             :clj1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}})

(defproject com.stuartsierra/component "0.2.3-SNAPSHOT"
  :description "Managed lifecycle of stateful objects"
  :url "https://github.com/stuartsierra/component"
  :license {:name "The MIT License"
            :url "http://opensource.org/licenses/MIT"}
  :min-lein-version "2.1.3"  ; added :global-vars
  :dependencies [[com.stuartsierra/dependency "0.1.1"]]
  :global-vars {*warn-on-reflection* true}
  :aliases {"test-all"
            ["with-profile" "clj1.4:clj1.5:clj1.6:clj1.7" "test"]}
  :profiles {:dev {:dependencies [[org.clojure/clojure "1.6.0"]
                                  [org.clojure/tools.namespace "0.2.4"]]
                   :source-paths ["dev"]}
             :clj1.7 {:dependencies [[org.clojure/clojure "1.7.0-master-SNAPSHOT"]]
                      :repositories {"sonatype-oss-public"
                                     "https://oss.sonatype.org/content/groups/public"}}
             :clj1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
             :clj1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
             :clj1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}})

Prepare for develoment version 0.2.3-SNAPSHOT


(defproject me.manuelp/confunion "0.1.1-SNAPSHOT"
  :description "Library for managing configuration based on EDN files."
  :url "http://github.com/manuelp/confunion"
  :license {:name "Eclipse Public License"
            :url  "http://www.eclipse.org/legal/epl-v10.html"}
  :min-lein-version "2.0.0"
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/tools.logging "0.2.6"]]
  :plugins [[lein-marginalia "0.7.1"]]

  :source-paths ["src/clojure"]
  :test-paths ["test/clojure"]
  :java-source-paths ["src/java"]
  :javac-options ["-target" "1.7"
                  "-source" "1.7"])

(defproject me.manuelp/confunion "0.1.1"
  :description "Library for managing configuration based on EDN files."
  :url "http://github.com/manuelp/confunion"
  :license {:name "Eclipse Public License"
            :url  "http://www.eclipse.org/legal/epl-v10.html"}
  :min-lein-version "2.0.0"
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/tools.logging "0.2.6"]]
  :plugins [[lein-marginalia "0.7.1"]]

  :source-paths ["src/clojure"]
  :test-paths ["test/clojure"]
  :java-source-paths ["src/java"]
  :javac-options ["-target" "1.6"
                  "-source" "1.6"])

Set source and target javac to 1.6

Set source and target javac to 1.6


;(defproject cli4clj "1.2.5"
(defproject cli4clj "1.2.6-SNAPSHOT"
  :description "Create simple interactive CLIs for Clojure applications."
  :url "https://github.com/ruedigergad/cli4clj"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [clj-assorted-utils "1.15.0"]
                 [jline/jline "2.14.2"]]
  :global-vars {*warn-on-reflection* true}
  :html5-docs-docs-dir "ghpages/doc"
  :html5-docs-ns-includes #"^cli4clj.*"
  :html5-docs-repository-url "https://github.com/ruedigergad/cli4clj/blob/master"
  :test2junit-output-dir "ghpages/test-results"
  :test2junit-run-ant true
  :main cli4clj.example
  :plugins [[lein-cloverage "1.0.2"] [test2junit "1.2.5"] [lein-html5-docs "3.0.3"]]
  :profiles  {:repl  {:dependencies  [[jonase/eastwood "0.2.3" :exclusions  [org.clojure/clojure]]]}}
)

(defproject cli4clj "1.2.6"
;(defproject cli4clj "1.2.6-SNAPSHOT"
  :description "Create simple interactive CLIs for Clojure applications."
  :url "https://github.com/ruedigergad/cli4clj"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [clj-assorted-utils "1.17.1"]
                 [jline/jline "2.14.2"]]
  :global-vars {*warn-on-reflection* true}
  :html5-docs-docs-dir "ghpages/doc"
  :html5-docs-ns-includes #"^cli4clj.*"
  :html5-docs-repository-url "https://github.com/ruedigergad/cli4clj/blob/master"
  :test2junit-output-dir "ghpages/test-results"
  :test2junit-run-ant true
  :main cli4clj.example
  :plugins [[lein-cloverage "1.0.2"] [test2junit "1.2.5"] [lein-html5-docs "3.0.3"]]
  :profiles  {:repl  {:dependencies  [[jonase/eastwood "0.2.3" :exclusions  [org.clojure/clojure]]]}}
)

Update dependencies and version info and deploy to clojars.


(defproject kiries "0.1.0-SNAPSHOT"
  :description "A bundled deployment of Kibana, Riemann, and ElasticSearch"
  :license "Eclipse Public License v1.0"
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.cli "0.2.1"]
                 [clj-logging-config "1.9.6"]

                 [riemann "0.2.2"]
                 [clj-time "0.6.0"]
                 [clojurewerkz/elastisch "1.2.0"]
                 [org.elasticsearch/elasticsearch "0.90.3"]

                 [compojure "1.1.5"]
                 [hiccup "1.0.4"]
                 [org.markdownj/markdownj "0.3.0-1.0.2b4"]
                 [ring/ring-core "1.2.0"]
                 [ring/ring-jetty-adapter "1.2.0"]

                 [clojure-csv/clojure-csv "1.3.2"]
                 ]
  :resource-paths ["." "resources"]
  :jar-exclusions [#"^htdocs"]
  :main kiries.core
  :aliases {"server" ["trampoline" "run" "-m" "kiries.core"]})

(defproject kiries "0.1.0-SNAPSHOT"
  :description "A bundled deployment of Kibana, Riemann, and ElasticSearch"
  :license "Eclipse Public License v1.0"
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.cli "0.2.1"]
                 [clj-logging-config "1.9.6"]

                 [riemann "0.2.2"]
                 [clj-time "0.6.0"]
                 [clojurewerkz/elastisch "1.2.0"]
                 [org.elasticsearch/elasticsearch "0.90.3"]

                 [compojure "1.1.5"]
                 [hiccup "1.0.4"]
                 [org.markdownj/markdownj "0.3.0-1.0.2b4"]
                 [ring/ring-core "1.2.0"]
                 [ring/ring-devel "1.2.0"]
                 [ring/ring-jetty-adapter "1.2.0"]

                 [clojure-csv/clojure-csv "1.3.2"]
                 ]
  :resource-paths ["." "resources"]
  :jar-exclusions [#"^htdocs"]
  :main kiries.core
  :aliases {"server" ["trampoline" "run" "-m" "kiries.core"]})

Add ring-devel for reload win.

Add ring-devel for reload win.


(defproject cli4clj "1.5.2"
;(defproject cli4clj "1.5.3-SNAPSHOT"
  :description "Create simple interactive CLIs for Clojure applications."
  :url "https://github.com/ruedigergad/cli4clj"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.9.0"]
                 [clj-assorted-utils "1.18.2"]
                 [org.clojure/core.async "0.4.474"]
                 [jline/jline "2.14.6"]]
  :global-vars {*warn-on-reflection* true}
  :html5-docs-docs-dir "ghpages/doc"
  :html5-docs-ns-includes #"^cli4clj.*"
  :html5-docs-repository-url "https://github.com/ruedigergad/cli4clj/blob/master"
  :test2junit-output-dir "ghpages/test-results"
  :test2junit-run-ant true
  :main cli4clj.example
  :plugins [[lein-cloverage "1.0.2"] [test2junit "1.3.3"] [lein-html5-docs "3.0.3"]]
  :profiles  {:repl  {:dependencies  [[jonase/eastwood "0.2.6" :exclusions  [org.clojure/clojure]]]}}
)

;(defproject cli4clj "1.5.2"
(defproject cli4clj "1.5.3-SNAPSHOT"
  :description "Create simple interactive CLIs for Clojure applications."
  :url "https://github.com/ruedigergad/cli4clj"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.9.0"]
                 [clj-assorted-utils "1.18.2"]
                 [org.clojure/core.async "0.4.474"]
                 [jline/jline "2.14.6"]]
  :global-vars {*warn-on-reflection* true}
  :html5-docs-docs-dir "ghpages/doc"
  :html5-docs-ns-includes #"^cli4clj.*"
  :html5-docs-repository-url "https://github.com/ruedigergad/cli4clj/blob/master"
  :test2junit-output-dir "ghpages/test-results"
  :test2junit-run-ant true
  :main cli4clj.example
  :plugins [[lein-cloverage "1.0.2"] [test2junit "1.3.3"] [lein-html5-docs "3.0.3"]]
  :profiles  {:repl  {:dependencies  [[jonase/eastwood "0.2.6" :exclusions  [org.clojure/clojure]]]}}
)

Revert back to snapshot version.

Revert back to snapshot version.


(defproject onyx-app/lein-template "0.10.0.0-alpha6"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

(defproject onyx-app/lein-template "0.10.0.0-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

Prepare for next release cycle.

Prepare for next release cycle.


(ns time-tracker.fixtures
  (:require [clojure.java.jdbc :as jdbc]
            [time-tracker.migration :refer [migrate-db]]
            [time-tracker.db :as db]
            [time-tracker.core :refer [app]]
            [time-tracker.auth.core :as auth]
            [time-tracker.auth.test-helpers :refer [fake-token->credentials]]
            [environ.core :as environ]
            [time-tracker.config :as config])
  (:use org.httpkit.server))

(defn init! [f]
  (time-tracker.core/init!)
  (f))

(defn destroy-db []
  (jdbc/execute! config/db-spec [(str "DROP OWNED BY " (environ/env :test-db-username))]))

(defn migrate-test-db [f]
  (migrate-db)
  (f)
  (destroy-db))

(defn serve-app [f]
  (with-redefs [auth/token->credentials
                fake-token->credentials]
    (let [stop-fn (run-server app {:port 8000})]
      (f)
      (stop-fn :timeout 100))))

(defn isolate-db [f]
  (jdbc/with-db-transaction [conn (db/connection)]
    (jdbc/db-set-rollback-only! conn)
    (with-redefs [db/connection (fn [] conn)]
      (f))))

(ns time-tracker.fixtures
  (:require [clojure.java.jdbc :as jdbc]
            [time-tracker.migration :refer [migrate-db]]
            [time-tracker.db :as db]
            [time-tracker.core :refer [app]]
            [time-tracker.auth.core :as auth]
            [time-tracker.auth.test-helpers :refer [fake-token->credentials]]
            [environ.core :as environ]
            [time-tracker.config :as config])
  (:use org.httpkit.server))

(defn init! [f]
  (time-tracker.core/init!)
  (f))

(defn destroy-db []
  (jdbc/with-db-transaction [conn (db/connection)]
    (jdbc/execute! conn "DROP SCHEMA IF EXISTS public CASCADE;")
    (jdbc/execute! conn "CREATE SCHEMA IF NOT EXISTS public;")))

(defn migrate-test-db [f]
  (migrate-db)
  (f)
  (destroy-db))

(defn serve-app [f]
  (with-redefs [auth/token->credentials
                fake-token->credentials]
    (let [stop-fn (run-server app {:port 8000})]
      (f)
      (stop-fn :timeout 100))))

(defn isolate-db [f]
  (jdbc/with-db-transaction [conn (db/connection)]
    (jdbc/db-set-rollback-only! conn)
    (with-redefs [db/connection (fn [] conn)]
      (f))))

Drop all tables only within the test database.

- Do NOT drop by owner, since that might affect tables outside of the
  test database.


(ns incise.layouts.core
  (:refer-clojure :exclude [get]))

(def layouts (atom {}))

(defn exists?
  "Check for the existance of a layout with the given name."
  [layout-with-name]
  (contains? @layouts layout-with-name))

(defn get [& args]
  (apply clojure.core/get @layouts args))

(defn register
  "Register a layout function to a shortname"
  [short-name layout-fn]
  (swap! layouts
         assoc (str short-name) layout-fn))

(ns incise.layouts.core
  (:refer-clojure :exclude [get]))

(def layouts (atom {}))

(defn exists?
  "Check for the existance of a layout with the given name."
  [layout-with-name]
  (contains? @layouts (name layout-with-name)))

(defn get [layout-name]
  (@layouts (name layout-name)))

(defn register
  "Register a layout function to a shortname"
  [short-name layout-fn]
  (swap! layouts
         assoc (name short-name) layout-fn))

Make layouts use strings by calling name.


(ns kiries.layout
  (:use hiccup.core)
  (:use hiccup.page))

(defn full-layout [title & content]
  (html5
   [:head
    (include-css "/kibana/common/css/bootstrap.dark.min.css")
    (include-css "/kibana/common/css/bootstrap-responsive.min.css")
    (include-css "/kibana/common/css/font-awesome.min.css")
    [:title title]]
   [:body
    [:div.container-fluid.main
     [:div.row-fluid
      content]]]))

(ns kiries.layout
  (:use hiccup.core)
  (:use hiccup.page))

(defn full-layout [title & content]
  (html5
   [:head
    (include-css "/kibana/common/css/bootstrap.light.min.css")
    (include-css "/kibana/common/css/bootstrap-responsive.min.css")
    (include-css "/kibana/common/css/font-awesome.min.css")
    [:title title]]
   [:body
    [:div.container-fluid.main
     [:div.row-fluid
      content]]]))

Use ligher theme from Kibana for docs.

Use ligher theme from Kibana for docs.


(defproject onyx-app/lein-template "0.12.0.0-rc2"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

(defproject onyx-app/lein-template "0.12.0.0-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

Prepare for next release cycle.

Prepare for next release cycle.


(ns zetawar.util
  (:require
    [fipp.edn]))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Accessors

(defn solo
  "Like first, but throws if more than one item."
  [coll]
  (assert (not (next coll)))
  (first coll))

(defn only
  "Like first, but throws unless exactly one item."
  [coll]
  (assert (not (next coll)))
  (if-let [result (first coll)]
    result
    (assert false)))

(defn ssolo
  "Same as (solo (solo coll))"
  [coll]
  (solo (solo coll)))

(defn oonly
  "Same as (only (only coll))"
  [coll]
  (only (only coll)))

;; TODO: check performance
(defn select-values [m ks]
  (reduce #(if-let [v (m %2)] (conj %1 v) %1) [] ks))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Debugging

;; TODO: refer to https://github.com/shaunlebron/How-To-Debug-CLJS/blob/master/src/example/macros.clj

(defn spy [x]
  (js/console.debug
    (with-out-str
      (fipp.edn/pprint x)))
  x)

(ns zetawar.util
  (:require
   [fipp.edn]))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Accessors

(defn solo
  "Like first, but throws if more than one item."
  [coll]
  (assert (not (next coll)))
  (first coll))

(defn only
  "Like first, but throws unless exactly one item."
  [coll]
  (assert (not (next coll)))
  (if-let [result (first coll)]
    result
    (assert false)))

(defn ssolo
  "Same as (solo (solo coll))"
  [coll]
  (solo (solo coll)))

(defn oonly
  "Same as (only (only coll))"
  [coll]
  (only (only coll)))

(defn select-values
  "Returns a vector containing only those values who's key is in ks."
  [m ks]
  (reduce #(if-let [v (m %2)] (conj %1 v) %1) [] ks))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Debugging

;; TODO: refer to https://github.com/shaunlebron/How-To-Debug-CLJS/blob/master/src/example/macros.clj

(defn spy [x]
  (js/console.debug
   (with-out-str
     (fipp.edn/pprint x)))
  x)

Remove old TODO + add docstring for select-values


(ns haystack.search-test
  (:require [haystack.search :as sut :refer [search]]
            ;; [clojure.test :as t :refer :all]

            [haystack.helpers :refer :all]
            ))

(test-search
 matnrs-check
 {:search "2843977 2542450"}
 (max-docs 50)
 (in-top 2843977 2)
 (in-top 2542450 2)
 )

(test-search
 upcs-check
 {:search "078477045442 980100350109"}
 (max-docs 500)
 (in-top 199152 2)
 (in-top 2542450 2)
 )

(test-search
 copper-clip-check
 {:search "copper clip" :num-per-page 100}
 (max-docs 100)
 (in-top 20127 100)   ;; "copper" and "clip" not in the same field
 (in-top 3336524 100) ;; "clip" is in the part number
 )

Add copper clip search test.

Add copper clip search test.


(ns com.draines.postal.core
  (:use [com.draines.postal.sendmail :only [sendmail-send]]
        [com.draines.postal.smtp :only [smtp-send]]))

(defn send-message [msg]
  (when-not (and (:from msg)
                 (:to msg)
                 (:subject msg)
                 (:body msg))
    (throw (Exception. "message needs at least :from, :to, :subject, and :body")))
  (if (:host msg)
    (smtp-send msg)
    (sendmail-send msg)))

(ns com.draines.postal.core
  (:use [com.draines.postal.sendmail :only [sendmail-send]]
        [com.draines.postal.smtp :only [smtp-send]]))

(defn send-message [msg]
  (when-not (and (:from msg)
                 (:to msg)
                 (:subject msg)
                 (:body msg))
    (throw (Exception. "message needs at least :from, :to, :subject, and :body")))
  (if (:host ^msg)
    (smtp-send msg)
    (sendmail-send msg)))

Check msg meta to determine sendmail or SMTP.


(ns braid.search.ui.search-bar
  (:require
   [reagent.core :as r]
   [re-frame.core :refer [subscribe dispatch]]
   [braid.core.client.routes :as routes]
   [braid.lib.color :as color]))

(defn search-bar-view
  []
  (r/with-let [search-query (r/atom @(subscribe [:braid.search/query]))
               prev-page (r/atom (:type @(subscribe [:page])))]
    (let [current-page (:type @(subscribe [:page]))]
      (when (not= @prev-page current-page)
        (when (= @prev-page :search)
          (reset! search-query ""))
        (reset! prev-page current-page)))
    [:div.search-bar
     [:input {:type "text"
              :placeholder "Search..."
              :value @search-query
              :on-change
              (fn [e]
                (reset! search-query (.. e -target -value))
                (dispatch [:braid.search/update-query! (.. e -target -value)]))}]
     (if (and @search-query (not= "" @search-query))
       [:a.action.clear
        {:on-click (fn [] (reset! search-query ""))
         :href (routes/group-page-path {:group-id @(subscribe [:open-group-id])
                                        :page-id "inbox"})
         :style {:color (color/->color @(subscribe [:open-group-id]))}}]
       [:div.action.search])]))

(ns braid.search.ui.search-bar
  (:require
   [reagent.core :as r]
   [re-frame.core :refer [subscribe dispatch]]
   [braid.core.client.routes :as routes]
   [braid.lib.color :as color]))

(defn search-bar-view
  []
  (r/with-let [search-query (r/atom @(subscribe [:braid.search/query]))
               prev-page (r/atom (:type @(subscribe [:page])))]
    (let [current-page (:type @(subscribe [:page]))]
      (when (not= @prev-page current-page)
        (if (= @prev-page :search)
          (reset! search-query "")
          (reset! search-query @(subscribe [:braid.search/query])))
        (reset! prev-page current-page)))
    [:div.search-bar
     [:input {:type "text"
              :placeholder "Search..."
              :value @search-query
              :on-change
              (fn [e]
                (reset! search-query (.. e -target -value))
                (dispatch [:braid.search/update-query! (.. e -target -value)]))}]
     (if (and @search-query (not= "" @search-query))
       [:a.action.clear
        {:on-click (fn [] (reset! search-query ""))
         :href (routes/group-page-path {:group-id @(subscribe [:open-group-id])
                                        :page-id "inbox"})
         :style {:color (color/->color @(subscribe [:open-group-id]))}}]
       [:div.action.search])]))

[search] Fix coming to search page via link not setting bar text


(defproject onyx-app/lein-template "0.9.9.0"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

(defproject onyx-app/lein-template "0.9.9.1-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

Prepare for next release cycle.

Prepare for next release cycle.


(defproject ktra-indexer "0.1.0-SNAPSHOT"
  :description "A simple application for indexing and searching KTRA track
  listings"
  :url "https://github.com/terop/ktra-indexer"
  :min-lein-version "2.0.0"
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [compojure "1.5.1"]
                 [ring/ring-defaults "0.2.1"]
                 [ring/ring-devel "1.5.0"]
                 [org.immutant/web "2.1.5"]
                 [selmer "1.0.7"]
                 [cheshire "5.6.3"]
                 [org.postgresql/postgresql "9.4.1207"]
                 [org.clojure/java.jdbc "0.6.1"]
                 [honeysql "0.7.0"]
                 [clj-time "0.12.0"]
                 [buddy/buddy-auth "1.1.0"]
                 [com.yubico/yubico-validation-client2 "3.0.1"]
                 [org.apache.commons/commons-lang3 "3.4"]]
  :main ktra-indexer.handler
  :aot [ktra-indexer.handler]
  :plugins [[lein-environ "1.0.3"]]
  :profiles
  {:dev {:dependencies [[ring/ring-mock "0.3.0"]]
         :resource-paths ["resources"]
         :env {:squiggly {:checkers [:eastwood :kibit :typed]}}}})

(defproject ktra-indexer "0.1.0-SNAPSHOT"
  :description "A simple application for indexing and searching KTRA track
  listings"
  :url "https://github.com/terop/ktra-indexer"
  :min-lein-version "2.0.0"
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [compojure "1.5.1"]
                 [ring/ring-defaults "0.2.1"]
                 [ring/ring-devel "1.5.0"]
                 [org.immutant/web "2.1.5"]
                 [selmer "1.0.7"]
                 [cheshire "5.6.3"]
                 [org.postgresql/postgresql "9.4.1209"]
                 [org.clojure/java.jdbc "0.6.1"]
                 [honeysql "0.7.0"]
                 [clj-time "0.12.0"]
                 [buddy/buddy-auth "1.1.0"]
                 [com.yubico/yubico-validation-client2 "3.0.1"]
                 [org.apache.commons/commons-lang3 "3.4"]]
  :main ktra-indexer.handler
  :aot [ktra-indexer.handler]
  :plugins [[lein-environ "1.0.3"]]
  :profiles
  {:dev {:dependencies [[ring/ring-mock "0.3.0"]]
         :resource-paths ["resources"]
         :env {:squiggly {:checkers [:eastwood :kibit :typed]}}}})

Update PostgreSQL JDBC library dependency

The version now used requires JDK 8 to work. Instructions for older
versions can be found at https://github.com/pgjdbc/pgjdbc.


(defproject stencil "0.3.0-SNAPSHOT"
  :description "Mustache in Clojure"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [scout "0.1.0"]
                 [slingshot "0.8.0"]
                 [org.clojure/core.cache "0.5.0"]]
  :profiles {:dev {:dependencies [[org.clojure/data.json "0.1.2"]]}
             :clj1.2 {:dependencies [[org.clojure/clojure "1.2.1"]]}
             :clj1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}
             :clj1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}}
  :extra-files-to-clean ["test/spec"])

(defproject stencil "0.3.0-SNAPSHOT"
  :description "Mustache in Clojure"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [scout "0.1.0"]
                 [slingshot "0.8.0"]
                 [org.clojure/core.cache "0.6.1"]]
  :profiles {:dev {:dependencies [[org.clojure/data.json "0.1.2"]]}
             :clj1.2 {:dependencies [[org.clojure/clojure "1.2.1"]]}
             :clj1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}
             :clj1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}}
  :extra-files-to-clean ["test/spec"])

Change core.cache version to 0.6.1.

Change core.cache version to 0.6.1.


(defproject io.aviso/rook "0.1.4"
  :description "Ruby on Rails-style resource mapping for Clojure/Compojure web apps"
  :url "https://github.com/AvisoNovate/rook"
  :license {:name "Apache Sofware Licencse 2.0"
            :url  "http://www.apache.org/licenses/LICENSE-2.0.html"}
  ;; Normally we don't AOT compile; only when tracking down reflection warnings.
  :profiles {:reflection-warnings {:aot         :all
                                   :global-vars {*warn-on-reflection* true}}
             :dev {:dependencies [[ring-mock "0.1.5"]]}}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.logging "0.2.6"]
                 [compojure "1.1.6"]]
  :plugins [[test2junit "1.0.1"]])

(defproject io.aviso/rook "0.1.5-SNAPSHOT"
  :description "Ruby on Rails-style resource mapping for Clojure/Compojure web apps"
  :url "https://github.com/AvisoNovate/rook"
  :license {:name "Apache Sofware Licencse 2.0"
            :url  "http://www.apache.org/licenses/LICENSE-2.0.html"}
  ;; Normally we don't AOT compile; only when tracking down reflection warnings.
  :profiles {:reflection-warnings {:aot         :all
                                   :global-vars {*warn-on-reflection* true}}
             :dev {:dependencies [[ring-mock "0.1.5"]]}}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.logging "0.2.6"]
                 [compojure "1.1.6"]]
  :plugins [[test2junit "1.0.1"]])

Set development version to 0.1.5-SNAPSHOT


(defproject cljam "0.1.2"
  :description "A DNA Sequence Alignment/Map (SAM) library for Clojure"
  :url "https://chrovis.github.io/cljam"
  :license {:name "Apache License, Version 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/tools.logging "0.2.6"]
                 [org.clojure/tools.cli "0.3.1"]
                 [me.raynes/fs "1.4.5"]
                 [pandect "0.3.2"]
                 [clj-sub-command "0.2.0"]
                 [bgzf4j "0.1.0"]]
  :plugins [[lein-midje "3.1.3"]
            [lein-bin "0.3.4"]
            [lein-marginalia "0.7.1"]]
  :profiles {:dev {:dependencies [[midje "1.6.3"]
                                  [criterium "0.4.3"]
                                  [cavia "0.1.2"]
                                  [primitive-math "0.1.3"]]
                   :global-vars {*warn-on-reflection* true}}}
  :main cljam.main
  :aot [cljam.main]
  :bin {:name "cljam"}
  :repl-options {:init-ns user})

(defproject cljam "0.1.3-SNAPSHOT"
  :description "A DNA Sequence Alignment/Map (SAM) library for Clojure"
  :url "https://chrovis.github.io/cljam"
  :license {:name "Apache License, Version 2.0"
            :url "http://www.apache.org/licenses/LICENSE-2.0.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/tools.logging "0.2.6"]
                 [org.clojure/tools.cli "0.3.1"]
                 [me.raynes/fs "1.4.5"]
                 [pandect "0.3.2"]
                 [clj-sub-command "0.2.0"]
                 [bgzf4j "0.1.0"]]
  :plugins [[lein-midje "3.1.3"]
            [lein-bin "0.3.4"]
            [lein-marginalia "0.7.1"]]
  :profiles {:dev {:dependencies [[midje "1.6.3"]
                                  [criterium "0.4.3"]
                                  [cavia "0.1.2"]
                                  [primitive-math "0.1.3"]]
                   :global-vars {*warn-on-reflection* true}}}
  :main cljam.main
  :aot [cljam.main]
  :bin {:name "cljam"}
  :repl-options {:init-ns user})

Prepare for next development iteration (0.1.3-SNAPSHOT)


(ns circle.backend.test-build
  (:use midje.sweet)
  (:use [circle.backend.build.test-utils :only (minimal-build)])
  (:use circle.model.build))

(fact "checkout-dir handles spaces"
  (let [b (minimal-build :build_num 42)]
    (checkout-dir b) => "Dummy-Project-42"))

(fact "ensure-project-id works"
  (let [b (minimal-build)]
    @b => (contains {:_project_id truthy})))

(ns circle.backend.test-build
  (:use midje.sweet)
  (:use [circle.backend.build.test-utils :only (minimal-build)])
  (:use circle.model.build))

(fact "checkout-dir handles spaces"
  (let [b (minimal-build)]
    (checkout-dir b) => #"Dummy-Project-\d+"))

(fact "ensure-project-id works"
  (let [b (minimal-build)]
    @b => (contains {:_project_id truthy})))

Fix "checkout-dir handles spaces" test by checking what is being tested better.


(println "Map Function Tests")

(is (= (map inc [1 2 3]) [2 3 4]))

(println "Map Function Tests")

(is (= (map inc [1 2 3]) '(2 3 4)))

Fix result in is test

Fix result in is test