|
This channel is intended for users of App::Rak raku.land/zef:lizmat/App::Rak . This channel is being logged, see irclogs.raku.org/raku-rak/live.html Set by lizmat on 3 November 2023. |
|||
|
04:09
lizmat_ joined
04:13
lizmat left
05:25
tbrowder left
05:27
tbrowder joined
07:39
lizmat_ left,
lizmat joined
|
|||
| SmokeMachine | lizmat: is there a way to a query using :find to return the name of the file? it seems to be returning "<find>", and I don't know from where it's getting those line numbers... usercontent.irccloud-cdn.com/file/.../image.png | 11:41 | |
| (but I think it's .looking good... :) | 11:42 | ||
| lizmat | iirc :find should return the filenames as the result ? | 11:43 | |
| SmokeMachine | I mean as $key when calling result... | 11:46 | |
| shouldn't it? | |||
| lizmat | I think the Callable is wrong | 11:49 | |
| it should be something like: { try { $_ if .slurp.AST... } }, ... | |||
| SmokeMachine | a simpler example: usercontent.irccloud-cdn.com/file/.../image.png | 11:54 | |
| lizmat | the reason you get the contents, is because the callable returns the contents, instead of True or False | 11:56 | |
| SmokeMachine | so I should return the IO? | ||
| but is there a way to print the custom value and the filename? | 11:57 | ||
| lizmat | you determine that by what you return in the Callable | 12:00 | |
| could well be anything | |||
| SmokeMachine | I mean, on my case I'm searching for specific AST on many files of code, and I want to return the name of the files where that ast was found and the ast itself... | ||
| lizmat | so, why did you specify :find then ? | ||
| SmokeMachine | because otherwise my callable would receice each line, instead of the IO... | 12:01 | |
| lizmat | and why not use the "rak" CLI ? | ||
| aah... --per-file | |||
| not sure what that is in the rak module | |||
| the mapping of cli opts to args to the "rak" sub is not always 1 one 1 | 12:02 | ||
| fwiw, it feels that your use of "rak" is a bit of overkill | 12:06 | ||
| SmokeMachine | and I'm not using the rak cli because it seems to not be importing the exports of modules (or I am doing something wrong) (github.com/lizmat/rak/issues/5) usercontent.irccloud-cdn.com/file/.../image.png | ||
| lizmat | feels to me raku.land/zef:lizmat/paths should be enough to make a file selection | 12:07 | |
| and then .IO.slurp do you thing on what that produces | |||
| SmokeMachine | I'll give a try on `path`, thanks! | 12:08 | |
| what about the --module? | 12:09 | ||
| lizmat | there's an issue for it... didn't get around to looking at that yet | ||
| tbrowder | ah, paths my be what i need, too! | 12:10 | |
| *may be | |||
| SmokeMachine | lizmat: thanks! | ||
| lizmat: it seems `paths` is working well on my case, thanks! usercontent.irccloud-cdn.com/file/.../image.png | 12:18 | ||
| lizmat | paths(:file(*.ends-with(".rakumod")) would be faster :-) | 12:20 | |
| and then $file.IO.slurp | |||
| prevents a lot of IO::Path objects from being made | 12:21 | ||
| SmokeMachine | working well, thanks! Now, my next step is to fix the array inside array on named results on ASTQuery, (not related to rak nor paths), thanks! usercontent.irccloud-cdn.com/file/.../image.png | 12:23 | |
| lizmat | yw | 12:24 | |
| tbrowder | lizmat: paths IS what i need, sorry for the bother, but it might be worth mention ing module "paths" in the rak docs. | 12:26 | |
| thank you very much! | 12:27 | ||
| hm, how about pairing 'paths' with 'App::Rak' to get the equiv of Gnu find? | 17:43 | ||
| maybe allow something like : $rak = rak {paths(@dirs)} , :named1, :etc; | 17:46 | ||
| lizmat | $ rak --find | 17:51 | |
| should already be very close to GU find in functionaliy ? | |||
| $ rak foo --find | 17:52 | ||
| will find all files with "foo" in their name | |||
| tbrowder | yes, i think i see how to use it as a CLI cmd. i’ll have to experiment some more, though. | 23:24 | |
| i’m working on a PR for rak doc tweaks to help us weaker-minded users apply it as simply as possible 😁 | 23:26 | ||
| lizmat | nice | 23:29 | |
| meanwhile I'm going for some shuteye & | |||
| tbrowder | nitey nite | 23:58 | |