Structuring extension folders for multiple source files and including some premade Components for my extension

Hello,

I don’t really know Ruby but I’m a veteran programmer. It’s easy to learn the flow control and looping syntax but it can get harder to learn very simple things like how to work with several files if you are a stranger to the ecosystem. I had some mild success doing so but eventually i resorted to a single file extension: https://github.com/engina/sketchup-xenakis-sync/blob/master/eaas_xenakis/main.rb

  1. How can I better restructure this code for, say, abstracting the exporting logic to a seperate file?
  2. Can I include pre-made components in my extension that user can insert into the scene with the click of a button?

See my “pinned” wiki list of Ruby Leaning Resources (here in this category) …

In the primer list is the following primer …

Basic extension setup for encapsulating into a RBZ zip archive …

And a must is following Thomas Thomassen’s Plugin (Extension) Checklist …

We have examples on our GitHub account on how extensions need to be structured:

Beyond the root .rb file pluss matching sub-folder there is no dictated standard on how to organize your extension files other than that they need to be within the sub-folder somewhere. People are organizing the subfolder as they see fit.

For instance, one of my own recent extensions looks like this:

2 Likes