webjars / webjars-locator-core

Webjars-locator core functionality
MIT License
19 stars 32 forks source link

replacement for getFullPathIndex? #29

Open 123Haynes opened 5 years ago

123Haynes commented 5 years ago

Hi,

I saw that you removed the method getFullPathIndex from the WebJarAssetLocator in https://github.com/webjars/webjars-locator-core/commit/60f01fb609844cbe7d6d39055e756bd13e35a9fb#diff-91255789c37eabd7e53b4647bc611bd0L98

Is there a replacement for this method? I'm currently using this method in the libsass-maven-plugin. Before Release 0.39, I could pass in something like "susy/sass/susy/_math.scss"
and get back a path like META-INF/resources/webjars/susy/2.1.1/sass/susy/_math.scss

See https://gitlab.com/haynes/libsass-maven-plugin/blob/master/src/main/java/wrm/libsass/WebJarTranslator.java for how it's currently used in the plugin.

It would be awesome if you could add back support for a similar method. 😃

jamesward commented 5 years ago

Thanks for reaching out! Sorry about the hassle. In your case can you use:

locator.getFullPathExact("susy", "sass/susy/_math.scss");

For reference: https://javadoccentral.herokuapp.com/org.webjars/webjars-locator-core/0.39/org/webjars/WebJarAssetLocator.html

123Haynes commented 5 years ago

@jamesward Thanks for your reply 😄
I'll have to rewrite stuff a little bit and extract the name from the uri, but that works for me.

That being said, I think 0.39 removed a bit of flexibility because now you don't have a function anymore where you can pass a custom regex matcher anymore.
It might be worth adding that back.

jamesward commented 5 years ago

Yeah, I think we should be able to add more flexible filtering / params for ClassGraph (which now does the underlying classpath scanning).