pathr
pathr copied to clipboard
Revival
I need some of these over and over again, so let's finish this package. Or least I'll add the things I need. FYI.
OK, cool. Want me to add you as a collaborator and/or move somewhere author neutral such as ropenscilabs?
I also have periodic need for this so am open to spending a bit of time on it (but possibly not much spare bandwidth over the next 2-3 weeks).
I don't mind, I am fine wil PRs as well for now. :)
But then you need to review them. :)
I'll review them quickly, don't worry.
Quick q. I need some regular expression matching for path_isabs on windows. Do you mind if I depend on this: https://github.com/MangoTheCat/rematch ? It is small, R-only and has no dependencies.
EDIT: and I just submitted it to CRAN....
Go for it! Looks like it might be useful in general though the package.
I didn't even know I was watching this repo until the sudden re-awakening, but I am so glad to learn of rematch! I just wrote this and will gladly rip it back out again :).
@jennybc Yeah, right? :) I wrote this about ~5 times at various places, and today I decided that it was enough. It is hard to get all the corner cases right, so it will be just perfect in its own package.
Btw. stringr::str_match is also pretty good, if you need sg comprehensive.
Can you name a non-capturing group? Yes I googled it and ... answer not clear, so am lazy-githubbing with you.
@jennybc I don't think you can in PCRE. It is not in the docs, and the obvious (?:<name>...) syntax does not work.
@gaborcsardi That was my conclusion. It seems unfortunate. I don't see any reason these two things have to be incompatible. Yet I believe they are.
I see I have high-jacked this issue before, but now I'm here to make an on-topic comment.
pathr would be really useful, so count me as another 👍!
I'm particularly interested in path_rel(). If user gives me "foo/bar/blah.R", I might have to normalize it into an absolute path and then form, say, a related path = a normalized version of "foo/bar/blah.md". But I'd like to message that in a way that matches the path style the user used, not the awful long normalized version. It feels like pathr would do the necessary file path arithmetic.
@jennybc I might misunderstand sg, but path_rel() already does what you want, no?
Yes! I just meant that path_rel() would be super useful and therefore nice to have on CRAN.
update: this is my current train project (as I need something small and self contained to work on at the moment) and so will see a series of updates over the next few days/weeks
\o/
🚆🎉