Detect Linux from the RUBY or Sketchup API
-
Any way to detect the home system on the computer is on Linux, either from the RUBY API or from the Sketchup API?
The issue I have found is that the ordering of files (so impacting the order of rb files loaded by Sketchup) is different on Linux versus Windows and Mac.
At least the ! sign is not considered coming earlier than the alpha numeric characters.
This is a big issue because I assumed that it would be the case. For instance Fredo6_!LibFredo6.rb should load BEFORE any other Fredo6_xxxx rb files.
Thanks
Fredo
-
The
ENVreturns some OS specific entries...MAC it's
TMPDIR
WIN it'sTEMP&&USERPROFILE
LINUX it'sUSERPROFILESo if the user has
ENV['USERPROFILE']BUT NOTTEMPthen it's LINUX ? -
TIG,
Thanks very much.
By the way don't you have the ! problem on Linux with the PluuginStore (!Sketchucation_loader.rb)?
Fredo
-
The initial ! has never been reported as an issue.
All it would do is load SketchUcation menu later on in the Plugins menu ?
It's just used to load them first, so they are not lost in a long list...
I use # for several of my own plugins as that puts them near the top - not sure how that sorts in Linux either !! -
The old standby RUBY_PLATFORM won't work?
-
@slbaumgartner said:
The old standby RUBY_PLATFORM won't work?
It's likely to mimic Windows setup - I found the ENV way the best trap... -
TextureResizer.rb by Andreas Eisenbarth uses...
@platform = RUBY_PLATFORM.include?('darwin')? "mac" ; (RUBY_PLATFORM.include?('mswin')? (!ENV["WINEPREFIX"].nil?? "wine" ; "mswin") ; "other")john
-
I would place my bets with Andreas - as he use Linux and probably have figured this out. Looking for a Wine related environment variable makes sense since Wine would make SketchUp think it's running Windows - RUBY_PLATFORM wouldn't say linux.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement