File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 3535 true )
3636
3737(defn load-cache!
38- " Load exported documents file from ClojureDocs, and store it as a cache.
38+ " Load exported docs file from ClojureDocs, and store it as a cache.
3939 A EDN format file is expected to the `export-edn-url` argument.
4040
4141 If `export-edn-url` is omitted, `default-edn-file-url` is used.
6060 (load-cache-file! cache-file)))))
6161
6262(defn clean-cache!
63- " Clean a cached file and documents "
63+ " Clean the cached ClojureDocs export file and the in memory cache. "
6464 {:added " 0.5.0" }
6565 []
6666 (.delete (io/file cache-file-name))
7777 (get @cache (keyword var-name))))
7878
7979(defn find-doc
80- " Find a document matching `ns` and `sym` from cached documents .
81- Cache will be updated when there are no cached documents or cached documents are old.
80+ " Find documentation matching `ns` and `sym` from the cached documentation .
81+ Cache will be updated when there is no cached documentation or when the cached documentation is old.
8282
8383 If `export-edn-url` is omitted, `default-edn-file-url` is used.
8484
85- Return nil if there is no matching document ."
85+ Return nil if there is no matching documentation ."
8686 {:added " 0.5.0" }
8787 ([ns sym]
8888 (find-doc ns sym default-edn-file-url ))
Original file line number Diff line number Diff line change 4444 (is (< old-timestamp (.lastModified cache-file)))
4545 (is (not (contains? @docs/cache :dummy ))))
4646
47- (testing " Sufficiently new cache-file and no cached documents "
47+ (testing " Sufficiently new cache-file and no cached documentation "
4848 (create-dummy-cache-file new-timestamp)
4949 (reset! docs/cache {})
5050
5454 (is (= new-timestamp (.lastModified cache-file)))
5555 (is (not (empty? @docs/cache))))
5656
57- (testing " Sufficiently new cache file and already cached documents "
57+ (testing " Sufficiently new cache file and already cached documentation "
5858 (create-dummy-cache-file new-timestamp)
5959 (reset! docs/cache {:dummy " not-empty-dummy-data" })
6060
7575 (is (empty? @docs/cache))))
7676
7777(deftest find-doc-test
78- (testing " find existing document "
78+ (testing " find existing documentation "
7979 (is (empty? @docs/cache))
8080 (is (not (.exists (io/file docs/cache-file-name))))
8181 (let [result (docs/find-doc " clojure.core" " first" test-edn-file)]
8585 (is (.exists (io/file docs/cache-file-name)))
8686 (is (not (empty? @docs/cache)))))
8787
88- (testing " find non-existing document "
88+ (testing " find non-existing documentation "
8989 (is (nil? (docs/find-doc " non-existing-ns" " non-existing-var" test-edn-file)))))
You can’t perform that action at this time.
0 commit comments