-
Notifications
You must be signed in to change notification settings - Fork 51
New plugins symlinks #1510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New plugins symlinks #1510
Conversation
The structure of the "installed_plugins" folder was changed slightly to flatten the subfolder for userfiles. Previously, we had something like: installed-plugins/userfiles/text_file/text_files.rb -> (plugin_loc) and now we have: installed-plugins/userfiles/text_file.rb -> (plugin_loc) This means the boot code for the Rails app no longer globs into a large set of folders to find its Ruby code files, speeding it up. But it also means I had to create a new "views" section to hold the symlinks to the userfiles's "views" subfolders. The rake task to installed and cleanup the links has been adjusted, you WILL need to run 'rake cbrain:plugins:install:all' to adjust all the symlinks. (And even maybe :clean:all first). The helper method that builds the userfile view paths has also been updated.
It might increase risk of file name intersection among different types? |
Not really. Since the file names (e.g. xyz.rb) are for Ruby classes, and there can only be one Ruby class of name "Xyz", there can't be two "xyz.rb" files anyway anywhere within the system. |
I found a few problems with this as I am testing some more. Hang on. |
So this has been tested on a production server (!) that was idle, and it seems to be right. One happy consequence of the change is that in development mode, the Rails app won't load any of the model file until it's actually needed by a Ruby statement. You can test it in a console (in dev mode) with a statement like this: in_memory = Userfile.descendants.map(&:to_s) This will show the models currenly loaded; those were loaded most likely because a database table refer to them. Pick a Userfile subclass that is not listed but you know exist (e.g. XMLFile) and just type the class name in the console:
Then if you run the "in_memory" statement again, you should see the class has been added to the list. |
This is a significant improvement in the way plugins are integrated.
Fixes #816