File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 2222#_(resource-path *ns* " foo" )
2323#_(resource-path *ns* " ./foo" )
2424
25- (defn inline-resource*
26- ([namespace-obj resource-name]
27- (inline-resource* namespace-obj resource-name identity))
28- ([namespace-obj resource-name f & args]
29- (let [resource-name (eval resource-name)
30- path (resource-path namespace-obj resource-name)
31- resource (io/resource path)
32- _ (assert (some? resource)
33- (str " Resource at path \" " path " \" not found." ))
34- resource-content (slurp resource)]
35- (apply f resource-content args))))
25+ #?(:clj
26+ (defn inline-resource*
27+ ([namespace-obj resource-name]
28+ (inline-resource* namespace-obj resource-name identity))
29+ ([namespace-obj resource-name f & args]
30+ (let [resource-name (eval resource-name)
31+ path (resource-path namespace-obj resource-name)
32+ resource (io/resource path)
33+ _ (assert (some? resource)
34+ (str " Resource at path \" " path " \" not found." ))
35+ resource-content (slurp resource)]
36+ (apply f resource-content args)))))
3637
3738#_(inline-resource* *ns* " ./test-resource.txt" )
3839#_(inline-resource* *ns* " ./test-resource.txt" str/upper-case)
You can’t perform that action at this time.
0 commit comments