I am creating a framework that loads a user-provided ruby code. This is basically a plugin mechanism. I want the user to provide a ruby code to be able to claim their own gems. I intend to have a “plugin” package that includes a vendor catalog with precious stones.
How can I download the gems that the plugin needs without conflict with my frames? For example, if my framework uses treetop version 1.3.0, and the plugin uses treetop 1.4.2, I want everyone to work with their specified version.
Also, is there a way to prevent plugin conflicts with each other?
I looked at gem_plugin, _why sandbox and some other tools. But I do not see a library that specifically handles this case - I assume that it was done before.
I also looked at the insides of the Bundler to see how it manages gem versions. If necessary, I am ready to do some pretty complicated things. But I'm still not sure how to do this.
I also have a lot of freedom in how I implement this. Therefore, if you think that I bark on the wrong tree, say so.
Thanks for any advice.
SIDE NOTE: When writing this, it occurred to me that I needed something similar to Classloaders in a Java servlet container. The WAR file may include jar files, and the web application class loader prefers those above banks that are in the global class path. Is there a way in ruby to segment the ruby “classpath” (ie Load_path, require, etc.)?
ruby plugins version rubygems
codefinger
source share