Fork me on GitHub
#clojure-europe
<
2024-08-02
>
ray07:08:29

Good morning

💚 4
ray07:08:34

Clojurians in the mist

Thomas Moerman08:08:54

In the misty morning, on the edge of time We've lost the rising sun, a final sign As the misty morning rolls away to die https://genius.com/11502328/Black-sabbath-children-of-the-sea/Reaching-for-the-stars-we-blind-the-sky

1
1
teodorlu07:08:37

Morning 🙂

schmalz07:08:34

Morning all.

reefersleep08:08:39

I wrote an oddly spelled commit message yesterday

reefersleep08:08:53

and today, I'm wondering if I spelt 'children' correctly

reefersleep08:08:02

maybe it's a good thing it's the last day before holidays

teodorlu09:08:58

cljdren?

😅 2
otfrom10:08:49

If I have a config file that points to a data file that has some data that I want to load. Most of the time it will be one of the standard files that I've helpfully packaged in a jar/repo and is on the classpath. Some times it will be an override file on the local filesystem. How would you go about loading the resource or local file transparently? (my io fu is failing me)

borkdude11:08:31

I think what you're looking for is a URI, whether it's a file or classpath thing, both can be described using a URI

borkdude11:08:11

$  bb -e '(.toUri (fs/path "."))'
#object[java.net.URI 0x6e353220 "file:///Users/borkdude/dev/clj-kondo/./"]

borkdude11:08:33

and slurp works on a URI

borkdude11:08:22

user=> (.toURI ( "clojure/core.clj"))
#object[java.net.URI 0x23c650a3 "jar:file:/Users/borkdude/.m2/repository/org/clojure/clojure/1.12.0-beta1/clojure-1.12.0-beta1.jar!/clojure/core.clj"]

borkdude11:08:32

slurp also works on that

👍 1
nice 1
Ludger Solbach12:08:31

You can always learn something here.

vemv12:08:12

If you use resources, note that they have priority, so if you observe that e.g. dev-rerouces is ahead of resources , you can have an identically-named file in dev-resources and it will take precedence. And you can gitignore it, often makes sense for overrides

nice 1