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 35
35
true )
36
36
37
37
(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.
39
39
A EDN format file is expected to the `export-edn-url` argument.
40
40
41
41
If `export-edn-url` is omitted, `default-edn-file-url` is used.
60
60
(load-cache-file! cache-file)))))
61
61
62
62
(defn clean-cache!
63
- " Clean a cached file and documents "
63
+ " Clean the cached ClojureDocs export file and the in memory cache. "
64
64
{:added " 0.5.0" }
65
65
[]
66
66
(.delete (io/file cache-file-name))
77
77
(get @cache (keyword var-name))))
78
78
79
79
(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.
82
82
83
83
If `export-edn-url` is omitted, `default-edn-file-url` is used.
84
84
85
- Return nil if there is no matching document ."
85
+ Return nil if there is no matching documentation ."
86
86
{:added " 0.5.0" }
87
87
([ns sym]
88
88
(find-doc ns sym default-edn-file-url ))
Original file line number Diff line number Diff line change 44
44
(is (< old-timestamp (.lastModified cache-file)))
45
45
(is (not (contains? @docs/cache :dummy ))))
46
46
47
- (testing " Sufficiently new cache-file and no cached documents "
47
+ (testing " Sufficiently new cache-file and no cached documentation "
48
48
(create-dummy-cache-file new-timestamp)
49
49
(reset! docs/cache {})
50
50
54
54
(is (= new-timestamp (.lastModified cache-file)))
55
55
(is (not (empty? @docs/cache))))
56
56
57
- (testing " Sufficiently new cache file and already cached documents "
57
+ (testing " Sufficiently new cache file and already cached documentation "
58
58
(create-dummy-cache-file new-timestamp)
59
59
(reset! docs/cache {:dummy " not-empty-dummy-data" })
60
60
75
75
(is (empty? @docs/cache))))
76
76
77
77
(deftest find-doc-test
78
- (testing " find existing document "
78
+ (testing " find existing documentation "
79
79
(is (empty? @docs/cache))
80
80
(is (not (.exists (io/file docs/cache-file-name))))
81
81
(let [result (docs/find-doc " clojure.core" " first" test-edn-file)]
85
85
(is (.exists (io/file docs/cache-file-name)))
86
86
(is (not (empty? @docs/cache)))))
87
87
88
- (testing " find non-existing document "
88
+ (testing " find non-existing documentation "
89
89
(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