NamedResource included in Music, Sound, and Surface

Tonight I finished up the process of including the new NamedResource mixin into the Music, Sound, and Surface classes. It was actually a really simple process. Once I had figured out the proper way to require and include the NamedResource module from the C code, it was just a matter of defining an "autoload" class method for each of the three classes. Even written in C, those methods were less than 10 lines each.

From that standpoint, I'd say that NamedResource has succeeded in being insanely simple to use. You really only have to do two things to use it in a class: 1) include the mixin, 2) define an "autoload" method that returns an instance or nil. For convenience, there's an autoload_dirs class instance variable (an array of directories), and a find_file method that you can use in autoload, to search those directories for a file with a certain name.

So, you could say I'm quite proud of it, and certainly glad that I sat down and created it. It'll make a nice addition to Rubygame 2.3. Speaking of which, all the features for Rubygame 2.3 are done now! I'm going to copy over the features to the 2.3 branch, tweak the demo programs to show off the new features, update the NEWS file, check one last time that everything looks right, and package it up for release.

Pretty exciting times, eh?


ippa submitted a comment on #

indeed :). btw, the “rubygame 2.4 checklist” doesn’t seem to work.

markus/ submitted a comment on #

Hey there a couple of unrelated things I would like to state here briefly:

  • We could need a forum :-)

  • We could need a few “demo” like games, something simple, like pygame has. (They have some games that are really easy.) I think that would in a way be a good “tutorial” because rubyista can just dig into the source and learn (and it is probably more fun than reading a lot of rdoc API documents)

Last but not least, reading the blog about rubygame related news is cool.

Have something interesting to add to the discussion? Email your thoughtful comments to