This is mainly useful for when writing plugins. After making a change to a plugin, just click the update scripts button and it will automatically reload any scripts which have been modified since they were last reloaded. It should handle .rb and .rbs files, and will look for scripts in all the paths in the $: global variable.
The plugin will list the files which have been reloaded and the files for which reloading failed in the status bar.
Extract the attached file to your plugins folder to try it out.
[Plugin] Autoloader
13 posts
• Page 1 of 1
Re: [Plugin] AutoloaderCool! This is very handy when updating scripts and want to use the new version without restarting SketchUP!
Re: [Plugin] AutoloaderIf I have SU open and add a new plugin, will this tool now "see" the new plugin without re-starting SU?
I'm talking new plugin, not revising script on an already loaded plugin. i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60
Re: [Plugin] Autoloader
Now this is a timesaver ![]() i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60
Re: [Plugin] AutoloaderHi,
@AndriyG81: does it reload modified files that are in sub-folders of the Plugins folder ? It doesn't do that for me... ![]() Didier Bur
Ecole Nationale Supérieure d'Architecture de Nancy (F) http://rld.crai.archi.fr/rubylibrarydepot/ Re: [Plugin] Autoloader
But does it "see" new sub-folders? More precisely, if I've put a new plugin into the plugins folder while SU is open and that new plugin contains a folder, will Autoloader "see" the new sub-folder and allow the new plugin to work? i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60
Re: [Plugin] AutoloaderWhen you get a list of entries in a Directory it will include files and folders.
It loads scripts it finds by files by their extname [.rb etc], but you can also find directories by their filetype. So it's also possible to get a list of any subfolders and then reiterate through those to get their .rb files etc etc... TIG
Re: [Plugin] AutoloaderYes, of course. It doesn't affect the way the plugin is loaded, it just loads it.
Re: [Plugin] AutoloaderHi Diggsey,
Nice idea, thank you. However... Sketchup::load (if I remember) is an alias for Sketchup::require, and doesn't reload scripts that are already listed in the $LOADED_FEATURES array. In short, I don't think anything is actually getting reloaded. Also, it would be helpful to wrap the load in begin..rescue..end to catch LoadError's and SyntaxErrors and report them as coming from the file being loaded instead of from autoloader. Related Topic Hi
13 posts
• Page 1 of 1
|