On Mon, Jun 22, 2009 at 11:26 AM, Lagutko Nikolay
<Nikolay.Lagutko@...> wrote:
Hi,
I have a problem with working with JRuby in Eclipse.
If required scripts stored not in classpath directories but in other plugins
JRuby cannot find them. As I see the problem in Equinox environment. When JRuby
calculates path to required script it uses Equinox BundleClassLoader to load
this script and it will return path to file in bundle-dependent format, for
example
bundleresource://9/./some_script.rb
And in further calculations JRuby cannot correctly
interpret this path. For example function File.expand_path will return “/./some_script”
instead of full path “D:/path_to_plugin/some_script”.
I find out how to resolve this problem with using
FileLocator class from org.eclipse.core.runtime plugin but I don’t want
to have dependencies to other plugins in my org.jruby plugin.
Are there other ways to resolve this problem?
We'd rather not take on additional dependencies to custom classloader resource URLs and schemes either. Is there any standard JDK API that gives you what you want? By chance does the Eclipse API implement getSchemeSpecificPart or getFile in a sane way on the URL returned by ClassLoader.getResource?
/Nick