Issues regarding extension publishing

Hi all,

I’m not sure who to reach out to but I submitted my my first extension for review on March 22nd and it is still in review. How long does this process usually take?

Thanks.

Bump?

I will try to get one of the EW team to come and answer your question.

Hello!
Taking advantage of your post, I would like to report my problem also related to extensions.
I’m having trouble signing and encrypting my extension at this link: Sign Extension | SketchUp Extension Warehouse
It’s just a first test, then I’ll deliver my real extension. I believe I’m following the recommended standards and still can’t encrypt.
I already sent an email asking for support more than three days ago and they haven’t returned me.
It’s frustrating, it seems that Timble doesn’t want new plugin developers anymore.

The requirements to sign/encrypt your RBZ are relatively simple.

Make a new ZIP file containing your xxx.RB file which sets up the details of your extension and indicates the main code-file to use - e.g. ‘xxx_my_code’…
This ZIP must also contain a folder named ‘xxx’ matching the RB file.
It should not contain anything else.
The ‘xxx.RB’ file should refer explicitly to the sub-folder’s main code-file by name, but it should not use the .RB suffix you will have been using during testing. So use ‘xxx/xxx_my_code’ NOT ‘xxx/xxx_my_code.RB’
SketchUp loads the named file by assuming an RBE suffix [added after encryption] or if not found an RB suffix [before any encryption] - whichever it finds in the subfolder…

Before submitting the file for signing/encryption you must rename the xxx.ZIP as xxx.RBZ

Ensure you keep copies of any RB files you hope to encrypt, because after the encryption they will be changed irretrievably…

Yes, I believe I did just that.
I really don’t know what’s wrong.
It’s my first extension.
See the attachment…
mobnamico.rbz (714 Bytes)

There’s something weirdly wrong with your RBZ - it thinks it’s ‘read-only’ and I can’t get it to change no matter what I try and what it says it’s set to.
BUT if I make an RBZ from scratch using your RB & subfolder it encrypts and signs OK [NB: with tweaks***]…

***A couple of points to fix in your code…
You shouldn’t include the extension’s set up code in a separate class, just leave it in the main module…
And of course it does nothing as it stands as inside the encrypted RBE there’s also has a class that’s never runs…
Use modules rather than classes and explicitly tell things to do things rather than leaving a method call ‘loose’ within a class etc…

1 Like

Humm… Upon mentioning that something would be wrong with my rbz, I decided to investigate and really… I was creating a .rar instead of a .zip. :sweat_smile:
Okay, now it’s encrypting as expected, but displays an error when loading.

Error: #<LoadError: cannot load such file -- c:/users/robson/appdata/roaming/sketchup/sketchup 2020/sketchup/plugins/mobnamico/lista_pecas.rb>
c:/users/robson/appdata/roaming/sketchup/sketchup 2020/sketchup/plugins/mobnamico/mobnamico_load.rbe:3:in `require_relative'
c:/users/robson/appdata/roaming/sketchup/sketchup 2020/sketchup/plugins/mobnamico/mobnamico_load.rbe:3:in `<main>'
C:/Program Files/SketchUp/SketchUp 2020/Tools/extensions.rb:197:in `eval'
C:/Program Files/SketchUp/SketchUp 2020/Tools/extensions.rb:197:in `require'
C:/Program Files/SketchUp/SketchUp 2020/Tools/extensions.rb:197:in `load'
C:/Users/Robson/AppData/Roaming/SketchUp/SketchUp 2020/SketchUp/Plugins/mobnamico.rb:19:in `register_extension'
C:/Users/Robson/AppData/Roaming/SketchUp/SketchUp 2020/SketchUp/Plugins/mobnamico.rb:19:in `<module:MobNamicoHome>'
C:/Users/Robson/AppData/Roaming/SketchUp/SketchUp 2020/SketchUp/Plugins/mobnamico.rb:7:in `<module:MobNamico>'
C:/Users/Robson/AppData/Roaming/SketchUp/SketchUp 2020/SketchUp/Plugins/mobnamico.rb:6:in `<module:Plugins>'
C:/Users/Robson/AppData/Roaming/SketchUp/SketchUp 2020/SketchUp/Plugins/mobnamico.rb:5:in `<module:JRobson>'
C:/Users/Robson/AppData/Roaming/SketchUp/SketchUp 2020/SketchUp/Plugins/mobnamico.rb:4:in `<top (required)>'

I have already removed the .rb extensions in require, because I know that later it will be .rbe, I also changed from require_relative to require and nothing works, but without encryption it works. Why?

If you’re going to end up with an RBE file you need to use an alternative way of ‘requiring’ a file…
The native ‘require’ methods expect an RB file etc - so once encrypted to RBE it’ll fail…
This alternative way will load either the original RB and any subsequent RBE you make from it…

In the loader file’s code set up a path variable to the loader’s subfolder […/mobnamico] and reuse that…

SUB = FILE.dirname(__FILE__)

then

Sketchup::require(FILE.join(SUB, "lista_pecas"))

Note the missing RB suffix to allow it to work with RB or RBE…
See this…
https://ruby.sketchup.com/Sketchup.html#require-class_method

Ok, I tried to do it that way and until I got success except when I try to load files inside other subfolders.
I decided to undo all the changes and go back to the version that worked before.
But not even this one works anymore.
It looks like it created some blockage to just work the new way.

load "C:/Users/Robson/Documents/workspace-vscode/sketchup-ruby/mobnamico-sketchup/src/mobnamico/lista_pecas.rb"
load "C:/Users/Robson/Documents/workspace-vscode/sketchup-ruby/mobnamico-sketchup/src/mobnamico/troca_componente.rb"
load "C:/Users/Robson/Documents/workspace-vscode/sketchup-ruby/mobnamico-sketchup/src/mobnamico/troca_material.rb"
load "C:/Users/Robson/Documents/workspace-vscode/sketchup-ruby/mobnamico-sketchup/src/mobnamico/mobnamico_load.rb"
load "C:/Users/Robson/Documents/workspace-vscode/sketchup-ruby/mobnamico-sketchup/src/mobnamico.rb"
File load error (mobnamico/mobnamico_load): Could not find included file 'mobnamico/mobnamico_load'
true

This seems to happen with other extensions as well.

load "C:/Users/Robson/Documents/workspace-vscode/sketchup-ruby/vscode-template-sketchup-projects/src/ex_hello_cube.rb"
load "C:/Users/Robson/Documents/workspace-vscode/sketchup-ruby/vscode-template-sketchup-projects/src/ex_hello_cube/main.rb"
File load error (ex_hello_cube/main): Could not find included file 'ex_hello_cube/main'
true

Extensions load only this error appears, I don’t know if this is a serious problem.

You are muddling up the requires / load native methods which need a .rb suffix, compared to the Sketchup::require() methods which need a path to a file, but the suffix can be omitted…

Without seeing your whole code getting you into this mess who can tell /
But if you get a ‘load_error’ telling you that it can’t find

mobnamico/mobnamico_load

There’s a good chance it’s the missing suffix that’s tripped you up !

The second error is less obvious since you don’t give enough info…
Although it seems that the

'ex_hello_cube/main'

wasn’t found, so it couldn’t be loaded ! [no .rb ??]

Please try going in ‘baby-steps’ - currently your ‘scatter-gun’ approach is very difficult to understand and debug…

Yes, I still haven’t been able to use your approach with the Sketchup::require(File.join(SUB, “part_list”)) method)
But what I mean has nothing to do with this approach, but with the fact that before, extensions normally loaded with the load method “C:/…/…/test.rb”, now they have the mentioned error above.
If I download this project: https://github.com/SketchUp/sketchup-extension-vscode-project.git

and loading your code into the console it gives the error.
They keep working, only this strange error appears. Anyway…
I’m going to study more and try to make Sketchup load my extension no matter if it’s encrypted or not.
Thanks again for the tips. :grinning:

Just one more thing.
How should I add one module to another using this approach.

Sketchup::require(File.join(‘mobnamico’, ‘constants’))

I’m trying to ‘include MobnamicoConstants’ but to no avail.

I don’t think you understand it.
The Sketchup::require(…)
expects a path to a single file.
Your code…

File.join('mobnamico', 'constants')

does nothing… because Sketchup is probably not expecting its path to start from there, AND your ‘constants’ is unlikely to be a file either ??
BUT you say you are trying to ‘include’ include MobnamicoConstants

You haven’t explained what that is or how it is structured… e.g.
If it’s a Constant [it starts with a capital-letter] ?
Or an additional module - in which case you could simply add a line at the start of the other module

include MobnamicoConstants

Or define your nested modules with an overarching module, so they are all auto-included…

Your partial code snippets are not helpful to those trying to help you - you also need to provide a full explanation of what it is you’re trying to do…
So far some educated guesses have helped move this thread forward… but you can help yourself a lot by communicating more clearly.
I appreciate that English might not be your first language - but GoogleTranslate [and some forethought] can be a big help when you are formulating your questions…

Actually his main issue is that he is loading from a coding repository and has not pushed his repository path into the $LOAD_PATH array …

The following script can be named: "_load_from_vscode.rb"

# Put this rb file into SketchUp's "Plugins" folder.

# define a path to your vscode projects:
vscode = "C:/Users/Robson/Documents/workspace-vscode"

# Now push any code repo path you are working on into $LOAD_PATH:
repo = "sketchup-ruby/mobnamico-sketchup/src/"
$LOAD_PATH << File.join(vscode,repo)
Sketchup.require("mobnamico")

Sorry, I will try to be more clear.
This is my constants module:

module JRobson
  module Plugins
    module MobNamico
      module MobnamicoConstants
        DYDICT ||= 'dynamic_attributes'.freeze
        #...
        #...
      end
    end
  end
end

This is where I try to include a constant.

# require_relative 'component_utils.rb'
# require_relative 'constants/constants.rb'
Sketchup::require(File.join('mobnamico', 'component_utils'))
Sketchup::require(File.join('mobnamico', 'constants', 'constants'))

module JRobson
  module Plugins
    module MobNamico
      module TrocaMaterial
        include MobnamicoConstants

        puts DYDICT
        
      end
    end
  end
end

When I used require_relative ‘constants/constants.rb’ it worked fine, now not anymore.

Forget what I said, the fact is that before the constants file were loaded automatically without calling load in the console. Now I’ve seen that if I call load “C:/…/…/constants.rb” it works.
Forgiveness… :no_mouth:
Thank you all.