Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Ruby Programming Language

For general discussion related FlowStone

Ruby Programming Language

Postby Eugene529 » Fri Oct 19, 2012 12:52 am

Is it possible to add libraries to the Ruby programming extension?
Eugene529
 
Posts: 4
Joined: Wed Oct 17, 2012 10:15 pm

Re: Ruby Programming Language

Postby trogluddite » Fri Oct 19, 2012 7:31 am

Hi Eugene,
Firstly, let me say that I'm quite new to Ruby myself, so I won't guarnatee that what I say is true in ALL circumstances.

But, yes, as far as I can see FS Ruby fully supports the Ruby "require" method that allows the import of external libraries either as Ruby scripts (.rb) or compiled code (.so files). You just have to be sure that Ruby can find them - either by placing them in the "libraries" folder of the FS installation, or by adding the filepath to Ruby's standard search paths using the command...
$: << "filepath"
If you export as .exe, you will also need to make sure that you copy your library files to the directory where the .exe lives when using them on another machine - they are not automatically embedded into the export.
Alternatively, you can embed Ruby libraries inside the schematic by making use of Ruby's shared namespace. If you put a module inside your schematic that contains a Ruby full of class and module definitions, you can access them from any other Ruby primitive inside the schematic - without even having to join them together or anything!

It also supports the "Win32API" module - so you can also have Rubies that access external .dll libraries - though again, you will have to be careful that the .dll's are available on any machines that you export .exe's to.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK


Return to General

Who is online

Users browsing this forum: No registered users and 54 guests