Fork me on GitHub
#clojure2015-06-04
>
cmdrdats08:06:24

does anyone know of a clojure/java equivalent to this : https://github.com/jimbojsb/emogrify (inline css into html for emails)

robert-stuttaford08:06:12

@cmdrdats: i don’t, but tweet it and i’ll RT

stephen09:06:54

Is there a decent java/clojure way to get the directory from a file path?

stephen09:06:15

All the methods I can find seem to rely on the file already existing.

stephen09:06:45

I need to create the directory prior to creating the file..

robert-stuttaford09:06:24

have you checked the api ref for http://clojure.java.io, stephen?

stephen09:06:47

@robert-stuttaford: Yeah. I can't find much there..

robert-stuttaford09:06:13

i believe you use .exists on a File object to check for existence

robert-stuttaford09:06:33

also, there’s always regex simple_smile

stephen09:06:37

Well I know it doesn't exist..

stephen09:06:27

But there may be some other properties in java.io.file that could help

stephen10:06:50

Ah yes.. I've been here before. There is getPath but this returns the filename as well.

stephen10:06:37

I guess it's regex.

andrewmcveigh10:06:53

@stephen: You can’t tell which part is or isn’t a directory without asking the filesystem

stephen10:06:42

Well I can with some simple string manipulation.

stephen10:06:57

I was just wondering if there was a more idiomatic way.

andrewmcveigh10:06:03

Not really. What is the directory of “/tmp"

stephen10:06:16

I would have thought if that was passed to the File object it could assume tmp would be the filename - / would be the directory.

andrewmcveigh10:06:38

@stephen: But that’s not really true. / is the parent, sure but "tmp" is the filename and it is a directory (on my system). You can’t really be sure unless you ask the filesystem.

andrewmcveigh10:06:17

Which, if the parent is what you need, (.getParent file) will give it to you.

stephen10:06:44

Yes I can see it is complicated.

stephen10:06:13

Shouldn't it really fail if you pass a directory to a File object..

stephen10:06:08

Ah yes getParent does what I need!

andrewmcveigh10:06:18

A directory is a file on *nix

stephen10:06:53

I guess just about everything is a file at some level

andrewmcveigh10:06:31

Well, yeah, loosely speaking

robert-stuttaford11:06:45

any pedestal users around?

tcrayford11:06:59

@robert-stuttaford: I likely will be one in a month or two simple_smile

tcrayford11:06:07

(and I read their docs a bunch)

robert-stuttaford11:06:15

i’ve come right

robert-stuttaford11:06:26

their docs really need work 😐

slipset11:06:04

There was a discussion on the clojure mailinglist about the docs.

slipset11:06:37

I think the gist of it was that the samples were better than the docs

robert-stuttaford11:06:32

yeah. a sample got me out of the trouble i was in

robert-stuttaford11:06:55

i think if all they did was remove all the no-longer-relevant stuff, that’d be a big step forward

slipset11:06:30

is the reply from Paul deGrandis regarding the docs.

robert-stuttaford11:06:19

thanks for sharing that

escherize12:06:32

Do you guys ever use emmet to make hiccup with "|hic" https://news.ycombinator.com/item?id=9657879 [disclaimer: emacs only afaik]

akiva14:06:30

What’s the general consensus on .m2/repository maintenance? I’ve been burning it down every month or so just to, uh, decruftify it.

robert-stuttaford14:06:33

i’ve never touched it

akiva14:06:51

Yeah, it never gets excessive. I just like these sorts of acts of general maintenance.

micha15:06:26

sometimes you need to do things in ~/.m2

micha15:06:32

the _maven.repositories file sometimes causes really hard to debug dependency resolution errors

micha15:06:08

this only is a problem if you use different repos that might contain the same coordinates

noisesmith17:06:00

akiva: if you don't use lein install (and deploy to repos instead) burning down m2 isn't really called for

noisesmith17:06:41

stephan: for creating the directory a file needs, there's (.mkdirs f) which creates all directories a given file needs