Skip to content

1. Usage

Sergey Sobko edited this page Feb 22, 2018 · 1 revision

This library supports multiple integrations with various systems related to development flow.

So the best way to showcase its potential is to demonstrate how it handles each of them by example. We will keep adding to the existing examples upon introducing new functionality.

However, there is a certain caveat you should be aware of before we go any further. Any function in the library may be considered pure only on the top level. Underlying code implicitly uses cache that may be explicitly cleared by a user after each query if so needed. To do it, the user needs to call (function-name-clear-cache!) where function-name is a function defined with the public-definition macro.

For the impatient

(require '[clojure.string])
(require '[flower.tracker.core :as tracker.core]
         '[flower.tracker.proto :as tracker.proto])

;; Print all opened tasks in our task tracker
(loop [[task & other-tasks] (-> "https://github.com/PositiveTechnologies/flower"
                                (tracker.core/get-tracker)
                                (tracker.proto/get-tasks))]
  (if task
    (let [task-parts (-> task
                         (select-keys [:task-type :task-id :task-title])
                         (vals))
          task-string (clojure.string/join " " task-parts)]
      (println task-string)
      (recur other-tasks))))
Clone this wiki locally