<br><br><div class="gmail_quote">2009/1/18 Niels Slot <span dir="ltr"><<a href="mailto:nielsslot@gmail.com">nielsslot@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In the last week I've written a Plasma tutorial for Ruby. In the tutorial the reader creates a simple but functional applet using widgets and Ruby. I've put it on a personal subpage on Techbase[1]. I would like to ask for some feedback. I've got one and a half years of Ruby experience, but I'm quite new with programming Plasma.<br>
<br>I've also seen the new Python tutorial, they look really nice. I'd be willing to help 'translate' these to Ruby. When doing this, it would be nice to have a way to share some pieces of the Python tutorials. The parts about, for example, installing plasmoids, metadata.desktop and using the eningeexplorer, are the same for any scripting language. Can we come up with some way to share these texts while not confusing the reader?<br>
<br>Niels<br><br>1: <a href="http://techbase.kde.org/User:Nielsslot/RubyPlasmaTutorial" target="_blank">http://techbase.kde.org/User:Nielsslot/RubyPlasmaTutorial</a><br>
</blockquote><div>That looks excellent to me. As well as a tutorial you've added some Ruby basics stuff so it will make sense to Ruby beginners.<br><br> I have a couple of comments about the example code.<br><br> Firstly, I think the main class doesn't have to be called 'Main' anymore, and if your X-Plasma-MainScript has a value of code/foo_bar_baz.rb you should be able to use a class called 'FooBarBaz'. I haven't actually tried that yet, but if it doesn't work that is a bug.<br>
<br>Secondly you shouldn't need to call methods on @parent.applet explicitely because the PlasmaScripting::Applet class uses method_missing() to forward any calls it can't handle to the underlying @parent.applet. So if you reference 'layout()' and your applet doesn't implement that, the call will automatically be forwarded to @parent.applet. Setters like 'self.layout = my_layout' or 'setLayout(my_layout)' should also work.<br>
<br>-- Richard<br></div></div><br>