Skip to content
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

Fixing load errors on systems where multi-byte characters are present… #154

Closed
duveen opened this issue Apr 2, 2015 · 19 comments · Fixed by #158
Closed

Fixing load errors on systems where multi-byte characters are present… #154

duveen opened this issue Apr 2, 2015 · 19 comments · Fixed by #158
Labels

Comments

@duveen
Copy link

duveen commented Apr 2, 2015

I am Korean and are not good at English. Please understand.
This error was fixed #134 from. But, Korean language in the same error occurs.

C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/importer.rb File road error
Error: #<ArgumentError: invalid byte sequence in CP949>
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `downcase'
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `file_loaded?'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/importer.rb:415:in `<top (required)>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:20:in `require'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:20:in `<module:STL>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:8:in `<module:CommunityExtensions>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:7:in `<top (required)>'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `require'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `load'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:58:in `register_extension'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:58:in `<module:STL>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:12:in `<module:CommunityExtensions>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:11:in `<top (required)>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb File road error
Error: #<ArgumentError: invalid byte sequence in CP949>
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `downcase'
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `file_loaded?'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:315:in `<module:Exporter>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:11:in `<module:STL>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:10:in `<module:CommunityExtensions>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:9:in `<top (required)>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:21:in `require'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:21:in `<module:STL>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:8:in `<module:CommunityExtensions>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:7:in `<top (required)>'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `require'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `load'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:58:in `register_extension'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:58:in `<module:STL>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:12:in `<module:CommunityExtensions>'
C:/Users/박민규/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:11:in `<top (required)>'

Up to date, and rb a result of the latest issue been applied to load the file. Fix please

@thomthom thomthom added the bug label Apr 5, 2015
@thomthom
Copy link
Member

thomthom commented Apr 5, 2015

This is with the latest version, 2.1.4?

@Sam-C
Copy link

Sam-C commented Oct 3, 2015

same error here. I am using Windows 10 (Chinese), latest SketchUp and latest sketchup-stl plugin. The installation was "successful", but when I restart sketchUp, this error message popped up. The export stl option never shows up in the drop-down menu.

(Although I know nothing about Ruby, I am wondering if sketchup is trying to downcase a non-English character. You can downcase "É" to "é" but one does not simply downcase "박민규" or "守建" :)

Error Loading File C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/importer.rb
Error: #<ArgumentError: invalid byte sequence in CP950>
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `downcase'
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `file_loaded?'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/importer.rb:418:in `<top (required)>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:25:in `require'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:25:in `<module:STL>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:13:in `<module:CommunityExtensions>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:12:in `<top (required)>'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `require'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `load'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:in `register_extension'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:in `<module:STL>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:14:in `<module:CommunityExtensions>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:13:in `<top (required)>'
Error Loading File C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb
Error: #<ArgumentError: invalid byte sequence in CP950>
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `downcase'
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `file_loaded?'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:334:in `<module:Exporter>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:14:in `<module:STL>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:13:in `<module:CommunityExtensions>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:12:in `<top (required)>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:26:in `require'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:26:in `<module:STL>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:13:in `<module:CommunityExtensions>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:12:in `<top (required)>'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `require'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `load'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:in `register_extension'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:in `<module:STL>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:14:in `<module:CommunityExtensions>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:13:in `<top (required)>'

for the moment, I will create a new user account to try this plugin out.

@jimfoltz
Copy link
Contributor

jimfoltz commented Oct 3, 2015

Edited - See next comment.

@jimfoltz
Copy link
Contributor

jimfoltz commented Oct 3, 2015

@Sam-C
Copy link

Sam-C commented Oct 4, 2015

Thank you for the lightning-fast reply.

I tried your plugin but it seems the problem persists. The error message is as follow:

Error Loading File C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/importer.rb
Error: #<ArgumentError: invalid byte sequence in CP950>
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `downcase'
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `file_loaded?'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/importer.rb:419:in `<top (required)>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:25:in `require'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:25:in `<module:STL>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:13:in `<module:CommunityExtensions>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:12:in `<top (required)>'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `require'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `load'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:in `register_extension'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:in `<module:STL>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:14:in `<module:CommunityExtensions>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:13:in `<top (required)>'
Error Loading File C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb
Error: #<ArgumentError: invalid byte sequence in CP950>
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `downcase'
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in `file_loaded?'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:334:in `<module:Exporter>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:14:in `<module:STL>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:13:in `<module:CommunityExtensions>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:12:in `<top (required)>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:26:in `require'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:26:in `<module:STL>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:13:in `<module:CommunityExtensions>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:12:in `<top (required)>'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `require'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in `load'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:in `register_extension'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:in `<module:STL>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:14:in `<module:CommunityExtensions>'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:13:in `<top (required)>'

(I deleted the old sketchup-stl.rb and the sketchup-stl folder before installing your version.)

@thomthom
Copy link
Member

thomthom commented Oct 4, 2015

Jim, the problem looks to be the string sent to file_loaded?

On Sun, Oct 4, 2015, 12:16 Sam-C notifications@github.com wrote:

Thank you for the lightning fast reply.

I tried your plugin but it seems the problem persists. The error message
is as below:

Error Loading File C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/

sketchup-stl/importer.rb
Error: #<ArgumentError: invalid byte sequence in CP950>
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in downcase' C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:infile_loaded?'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/importer.rb:419:in <top (required)>' C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:25:inrequire'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:25:in <module:STL>' C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:13:inmodule:CommunityExtensions'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:12:in <top (required)>' C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:inrequire'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in load' C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:inregister_extension'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:in <module:STL>' C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:14:inmodule:CommunityExtensions'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:13:in <top (required)>' Error Loading File C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb Error: #<ArgumentError: invalid byte sequence in CP950> C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:indowncase'
C:/Program Files/SketchUp/SketchUp 2015/Tools/sketchup.rb:36:in file_loaded?' C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:334:inmodule:Exporter'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:14:in <module:STL>' C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:13:inmodule:CommunityExtensions'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/exporter.rb:12:in <top (required)>' C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:26:inrequire'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:26:in <module:STL>' C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:13:inmodule:CommunityExtensions'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl/loader.rb:12:in <top (required)>' C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:inrequire'
C:/Program Files/SketchUp/SketchUp 2015/Tools/extensions.rb:197:in load' C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:inregister_extension'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:60:in <module:STL>' C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:14:inmodule:CommunityExtensions'
C:/Users/守建/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/sketchup-stl.rb:13:in `<top (required)>'

(I deleted the old sketchup-stl.rb and the sketchup-stl folder before
installing your version.)


Reply to this email directly or view it on GitHub
#154 (comment)
.

@Sam-C
Copy link

Sam-C commented Oct 4, 2015

ohh, I forgot to mention that I created a new user account called "visitor" and installed the old plug-in there. The path was
C:\Users\visitor\AppData\Roaming\SketchUp\SketchUp 2015\SketchUp\Plugins\sketchup-stl
and it worked fine. So it seems the user name makes a difference.

@duveen
Copy link
Author

duveen commented Oct 4, 2015

In a language other than English, it will not be able to run the STL PLUGIN.

thomthom added a commit to thomthom/sketchup-stl that referenced this issue Oct 4, 2015
@thomthom
Copy link
Member

thomthom commented Oct 4, 2015

@duveen and @Sam-C - can you download the RBZ from this page (https://github.com/thomthom/sketchup-stl/releases/tag/fix-unicode-username) and test if that solves the load errors?

(If there are still errors - please post them back here.)

@jimfoltz
Copy link
Contributor

jimfoltz commented Oct 5, 2015

I am beginning to wonder if there is a purpose to using file_loaded?

@thomthom
Copy link
Member

thomthom commented Oct 5, 2015

There is a point to prevent UI and importers/exporters as well as Sketchup.register_extension from triggering more than once. But one doesn't have to use file_loaded - you can roll your own.

But the issue here is bugs in Ruby itself - where __FILE__ and ENV strings will have the wrong encoding label. I've reported to the Ruby core team, but they've been concerned about fixing it might break existing applications.

https://bugs.ruby-lang.org/issues/9713#change-46121

That being said - until the Ruby core fixes this you probably want to avoid __dir__() and require_relative because they use __FILE__ without taking into account the encoding bug.

@jimfoltz
Copy link
Contributor

jimfoltz commented Oct 5, 2015

Under what circumstances would register_extension be called more than once? And if it is being called more than once, would not that be a bug (or configuration issue) that should be exposed rather than suppressed?

@thomthom
Copy link
Member

thomthom commented Oct 5, 2015

While developing you often need to reload files. But also other than that you might risk your files being loaded more than once due to differences of how require, load, Sketchup.require and require_all works.
There's a number of subtle ways out of your control an RB file could be reloaded - such that a load guard is needed.

@Sam-C
Copy link

Sam-C commented Oct 6, 2015

I installed from https://github.com/thomthom/sketchup-stl/releases/tag/fix-unicode-username and it fixed the loading error. 😄 It now loads without any error code. The ".stl" option from "Import..." and the "Export STL..." option correctly appears.

@thomthom
Copy link
Member

thomthom commented Oct 6, 2015

Thanks for testing. I'll create a pull-request to have that fix included and make a new release.

@jimfoltz
Copy link
Contributor

jimfoltz commented Oct 7, 2015

Does SKUI core.rb have a similar issue using __FILE__?

@thomthom
Copy link
Member

thomthom commented Oct 7, 2015

Looking over the SKUI code it doesn't look to be the case. It fetches __FILE__ once, but then makes sure to correct the encoding before passing the string around the system.

@jimfoltz
Copy link
Contributor

jimfoltz commented Oct 7, 2015

To be honest, I am not certain using 'self.name' is the best way. For one, the name of the method is _file__loaded indicating it is expecting a file.

In some extensions I have been using 'if not defined?(ModuleName::PluginName)' at the top of the file to wrap menu creation inside.

@thomthom
Copy link
Member

thomthom commented Oct 7, 2015

It doesn't matter too much - as long as the string you pass is unique for the load guard you are creating. You could use a GUID if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants