hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

Become a Try Ruby Narrator Straightaway #

by why in inspect

Well, with the Try Ruby tutorial done, it’s time to work on adding a number of other more advanced tutorials. Or even just different takes on starting off.

You can find a list of tutorials in the TUTORIALS constant. To start a small test tutorial I started: run 'meta'. Alternatively, they’re listed in /Tutorials.

 >> Dir['/Tutorials/*']                                                          
 => [".", "..", "intro.rb", "meta.rb"]                                           
 >> require '/Tutorials/intro'                                                   
 => true

Finally, if you want to link directly to a tutorial: http://tryruby.hobix.com/?meta.

To add your own tutorial, check out from http://code.whytheluckystiff.net/svn/tryruby/trunk/htdocs/tutorials. Add your-tutorial.html, following the conventions in meta.html and intro.html.

  1. Each lesson page is contained in a div with a CSS class of stretcher.
  2. Summaries, chapter headers are a CSS class of chapmark.
  3. Load code into the interpreter with a div of CSS class of load, placed inside the lesson page. It will be executed when the page is displayed.
  4. Check answers with answer and stdout classed div elements. These elements contain a regular expression. If the answer matches the regexp, the lesson proceeds.

I still need a script to update the site from SVN. For now, I’ll push things over manually each night.

Safari patches are applied now. Sorry about that. No browser bigotry going on here, just compatibility infantility.

said on 27 Dec 2005 at 18:39

_why… Sadly the try ruby site seems to be broken in Safari again. I don’t get any prompt at all. But it works fine in Firefox on OSX .

said on 27 Dec 2005 at 18:43

In Camino, in the Your Own Turf section, the tutorial doesn’t change page after the File.open(”/Home/comics.txt”, “a”) do |f|. It just sits there, waiting for a block that will never come, shivering in the darkness between the |.

said on 27 Dec 2005 at 18:46

... and does the same thing in Firefox 1.5.

said on 27 Dec 2005 at 18:48

... and summary #5. Any incomplete statement results not in a page turn, but only of aching inertia borne of loneliness and regret.

said on 27 Dec 2005 at 18:55

B0rked in Safari: seconded.

said on 27 Dec 2005 at 20:12

likewise for shiira (very similar to safari but sometimes more picky).

said on 27 Dec 2005 at 20:19

Why, you are my hero.

said on 27 Dec 2005 at 23:05

Does it means that we could begin the translation of the tutorials too ?

said on 28 Dec 2005 at 04:43

Indeed, I think that if why allows it, the establishment of a Poignant Guide translation body would be most prudent.

The best thing would be to slice it up into chunks that would take roughly… 2 hours to transpose, that way filling in a section would be easy and quick enough that any Ruby guru could drop one in.

said on 28 Dec 2005 at 06:30

Danno: In fact translation of Poignant Guide is already started ;) For the time being German and French are ongoing

said on 28 Dec 2005 at 09:51

Ho Ho! But I think you know what I mean.

I18N can come later for the TryRuby, perhaps.

said on 29 Dec 2005 at 09:14

Requiring meta.rb doesn’t cause it to run. You have to figure out what it does, and then just “run ‘meta’”

said on 29 Dec 2005 at 11:32

Hmm.. can anyone get the popup to work? Type help 5 and try that chapter out. I can’t get the IFRAME to switch its src.

said on 29 Dec 2005 at 12:29

Popup.make do .. h1 “Comics” .. list do .. comics.each do |name, url| :( :( :( It hung right here.

said on 01 Feb 2006 at 15:01

Why et al. – just so’s you know, Try Ruby is fantastic. Surely one of the most engaging programming tutorials I’ve ever seen. As with the Poignant Guide, you’ve made a little piece of art here, masquerading as tech.

Gorgeous.

Comments are closed for this entry.