Page 1 of 2

Ruby API Reference

Posted: Wed Jun 25, 2014 1:31 pm
by trogluddite
Hi All,
Here's a little something for all of the Rubyists here who just need a quick way to look up the Class and Method definitions for FlowStone's custom Ruby objects. I'll keep it here in the top post where it's easy to find, and let you know each time I tweak anything
FS_API_docs 1_0_0.zip
v1.0.0 28-June-2014
(184.06 KiB) Downloaded 30579 times

To install, just unzip the file anywhere that you like (making sure to keep all the folders in the same structure). Navigate to the main folder, where you'll find a load of .html docs. Just double click the one called 'index.html', and it will open in your default browser.

Classes and methods are all linked within the doc's - just click on one to navigate to the page you're looking for, and you'll see a definition of the method signatures, a bit of text about what each one does, and code examples for the ones that need a bit more explaining.

There's also a 'fake' class called "API_Notes" - click on that one to get a page that describes how to make sense of the info and defines a few common terms and conventions.

The pages have all been generated using the 'rdoc' document generator from a "standard" Ruby install, so the format is exactly the same as you'll see for the API documentation for standard Ruby classes and methods - and it makes it nice and simple to maintain, so not half as much work as it might seem!

Hope you find it useful,
Trog.

Re: Ruby API Reference

Posted: Wed Jun 25, 2014 2:50 pm
by JB_AU
Thanks

Re: Ruby API Reference

Posted: Wed Jun 25, 2014 8:46 pm
by Drnkhobo
Awesomeness!

Thanks Trog!

:D :D :D

Re: Ruby API Reference

Posted: Wed Jun 25, 2014 11:21 pm
by trogluddite
You're welcome! :)

Next version now uploaded in the top posts. Just Views, GraphicsPaths, and various flavours of Gradient/Texture brushes left to go!
Not as much detail on the newer stuff (especially, no code examples yet) - but I decided to just get an outline of as much as possible hammered out quickly. I can then add the detail as it becomes clear over time what people most need to know.

Oh, and I forgot to mention - if anyone notices any mistakes, or anything that doesn't work as described, just post it up, and I'll tweak the docs to keep everything as accurate as possible.

Re: Ruby API Reference

Posted: Thu Jun 26, 2014 5:28 am
by RJHollins
ok ... finally got to view some of this via my web browser.

This looks to be an excellent compliment to the FS manuals.

Thanks TROG !
8-)

Re: Ruby API Reference

Posted: Thu Jun 26, 2014 7:46 am
by Exo
Great idea Trog thanks, just learning Ruby so this will come in handy :).

Re: Ruby API Reference

Posted: Fri Jun 27, 2014 6:05 am
by billv
trogluddite wrote:It is WAY off being finished, as I just spend a few minutes here and there tinkering with it whenever the fancy takes me, so it may be a while before it's complete. I'll keep it here in the top post where it's easy to find, and let you know each time I add a new bit...


:lol: :lol: I knew sooner or later we'd get you to start writing a book... :D
Great stuff trog....love the format..looks like exactly what FS needs....thanks

PS:
maybe some other gurus can help out, and you can palm off a section or 2, ease the load..
It's a great looking project, a little wiki in itself, hopefully those who can help - will

Re: Ruby API Reference

Posted: Fri Jun 27, 2014 9:41 am
by tester
Not such a bad idea.
I could write another book. :mrgreen:

it would take 3-6 months I guess.

Re: Ruby API Reference

Posted: Fri Jun 27, 2014 12:06 pm
by trogluddite
billv wrote: I knew sooner or later we'd get you to start writing a book..

:lol: Well, more like a "cheat sheet plus", I think. As RJ says, intended more as a complement to to the User Guide than a replacement for it - I just got fed up with having to scan through the text of the guide just to remind myself exactly what values I was supposed to be passing to the methods.

What I find really interesting is just how many methods I keep finding that aren't mentioned in the manual at all. For the 'Midi' class there are more undocumented methods than there are documented ones! For example, you can change the channel of a message with a simple ".channel=" - much more efficient than allocating some more memory to create a whole new Midi object, and making less "garbage" for Ruby to clean up afterwards.

billv wrote:maybe some other gurus can help out,

I'll see how I get on, but I think there's not a huge amount left to do to get the basic method references finished - mostly just the vector graphics stuff (the "standard" Ruby classes are already in the official Ruby API docs, so I won't be touching those!).
I've no problem with posting the source files. But I'd rather not have to write a second "book" about how to write the source markup and get 'rdoc' to create the HTML. Ironically, the auto-documentation features are one of the worst documented parts of Ruby - and it means having to mess about installing the full "non-FS" version of Ruby, external code editor etc...

Re: Ruby API Reference

Posted: Sat Jun 28, 2014 12:48 am
by trogluddite
Dunnit! 8-)
New download (v1.0.0) is now available in the top post - all 117 Methods in 17 Classes now present!

There's also a 'dummy' class called "API_Notes" - if you click on that one, you get a guide how to make sense of the info (much of which also applies to the standard Ruby API docs).