UPnP-MediaServer 1.0.0
Eric Hodel | Wed, 23 Jul 2008 08:41:00 GMT
UPnP-MediaServer version 1.0.0 has been released!
A UPnP MediaServer. Currently a work in progress. Only tested on a PlayStation 3.
Changes:
1.0.0 / 2008-07-23
- 1 major enhancement
- Birthday!
UPnP-ContentDirectory 1.0
Eric Hodel | Wed, 23 Jul 2008 08:40:00 GMT
UPnP-ContentDirectory version 1.0 has been released!
A UPnP ContentDirectory service with some DLNA extensions. Currently this is a work in progress, and is only adequate for viewing images on a PlayStation 3.
Changes:
1.0.0 / 2008-07-23
- 1 major enhancement
- Birthday!
UPnP-ConnectionManager 1.0
Eric Hodel | Wed, 23 Jul 2008 08:38:00 GMT
UPnP-ConnectionManager version 1.0 has been released!
Stub implementation for a UPnP ConnectionManager service. Currently has no implementation. Works great for a PlayStation 3.
Changes:
1.0.0 / 2008-07-23
- 1 major enhancement
- Birthday!
UPnP 1.1.0
Eric Hodel | Wed, 23 Jul 2008 08:36:00 GMT
UPnP version 1.1.0 has been released!
An implementation of the UPnP protocol
Changes:
1.1.0 / 2008-07-23
- 2 major enhancements
- Server support
- SSDP now supports sending advertisements
- 1 bug fix
- Gem dependencies now listed
UPnP-IGD 1.0.0
Eric Hodel | Mon, 30 Jun 2008 06:45:00 GMT
UPnP-IGD version 1.0.0 has been released!
UPnP-IGD is a UPnP extension for Internet Gateway Devices that displays information about the device. UPnP-IGD is an example of the use of some UPnP APIs.
UPnP-IGD comes with the upnp_igd utility which outputs information like this:
Gateway at http://10.1.1.1/ Connected, up since 2008-06-29 03:31:00 (66123 seconds) Connection type: IP_Routed 384 Kb/s up, 1536 Kb/s down External IP address: 10.255.255.254 Port mappings: 0 UDP *:4502 -> 10.1.1.2:4500 "iC4502" 1 UDP *:5355 -> 10.1.1.2:5353 "iC5355" 2 UDP *:58712 -> 10.1.1.3:58712 "Skype UDP at 10.1.1.3:58712 (546)" 3 TCP *:58712 -> 10.1.1.3:58712 "Skype TCP at 10.1.1.3:58712 (546)" 4 UDP *:5353 -> 10.1.1.4:5353 "iC5353"
Unfortunately, UPnP-IGD does not allow anything to be set on the device, and has only been tested against miniupnpd.
UPnP 1.0.0
Eric Hodel | Mon, 30 Jun 2008 06:09:00 GMT
UPnP version 1.0.0 has been released!
UPnP-1.0.0 is an implementation of the UPnP protocol. The 1.0 release:
- Discovers UPnP devices and services via SSDP, see UPnP::SSDP
- Creates a SOAP RPC driver for discovered services, see UPnP::Control::Service
- Creates concrete UPnP device and service classes that may be extended with utility methods, see UPnP::Control::Device::create, UPnP::Control::Service::create and the UPnP-IGD gem.
- Does not support eventing
- Does not support server creation
UPnP comes with upnp_discover which searches for UPnP devices and dumps information about them and upnp_listen which will listen for device notifications.
Gem Dependencies
Eric Hodel | Mon, 23 Jun 2008 22:28:40 GMT
I was chatting with Yehuda Katz, and somehow we ended up talking about speed:
Eric Hodel: I don’t worry about inheritance
Eric Hodel: or speed, for that matter
Yehuda Katz: heh
Yehuda Katz: that’s why you wrote RubyInline?
Eric Hodel: Ryan wrote RubyInline because, roughly, “How hard could it be?”
Eric Hodel: and an intense hatred of C
This got me thinking, how long did it take from RubyInline to be written until it was actually used? The RubyGems answer is 151 days, and by ParseTree, but RubyInline is actually about 2 years older than its gem, first committed on 2002/09/05.
To figure this out, I wrote a script that walks all the gems and figures out when a gem was first released, when a gem was first mentioned in a dependency, and the time between the two. Today, the figures are:
681 of 3234 gems used as dependencies (21%) average time to first use is 148 days maximum time to first use is 1332 (dnssd)
You can get the full output in the gem dependency report (which updates weekly), and download the gem dependency script too.
Static Typing for Ruby
Eric Hodel | Wed, 16 Apr 2008 23:36:00 GMT
Last week I went to a presentation by Jeff Foster about Diamondback Ruby (DRuby), a static type inferencer for Ruby. DRuby's goals are to be simple to use, be flexible enough to handle common ruby idioms, be reasonably useful, and to revert to run-time type checking as needed.
DRuby features its own GLR parser for Ruby grammar with extensions for type annotations and is written in OCaml. Internally it uses a normalized and simplified ruby subset to perform the type analysis in order to remove ambiguities and simplify flow analysis.
Type inference is fed a prebuilt set of type annotations derived from the core library that look very similar to rdoc. The annotation system can handle variable arguments to methods, type intersections and type unions. Basically, this means it's expressive enough to handle String#slice which can be called six different ways.
For details on the type inferencing itself, you should read the paper. There are currently some limitations in DRuby, among them are unsuitability for large applications due to time constraints and too many false positives, it flattens namespaces such that A::C and B::C are considered the same, and it doesn't handle #eval.
On a set of eight benchmark applications, five required some minor modifications for DRuby to operate (described in the paper), and three of the eight had false positives. I found two of the false positives interesting, as I think the code highlighted by DRuby is questionably written.
The false positive in sudokosolver is from a method that returns an Array or false then performs a run-time type check to do the appropriate thing with the results. The false positive in ObjectGraph involves a String that is duck-typed into a StringIO if StringIO wasn't required through a singleton class.
Compared to other static typing add-ons for Ruby, this is the most promising one I've seen. There's no type annotations required to muck up my existing applications (they would be provided with DRuby), no penalties for checking at run-time, and it's smart about functions as convoluted as String#slice.
Unfortunately, since it hasn't been released into the wild yet (the target date we were given was sometime this summer) it's hard to say if it how useful it would be. Judging from the two false positives given, it may have some utility as an equivalent to a flog, though.
3000 Gems
Eric Hodel | Mon, 14 Apr 2008 22:39:12 GMT
Earlier this month the 3000th gem was released! Here’s how the repository has grown since its early days:

An RDoc Wiki
Eric Hodel | Fri, 15 Feb 2008 00:14:37 GMT
For fun, I wrote a 200 line wiki a couple of weeks ago using WEBrick and RDoc withRCS as the only external dependency for history. You’ll need a recent build of Ruby 1.9 or Rubinius to run it:
It uses RDoc’s markup for formatting, and stores its content into ~/.rdocwiki as plain text files.
RdocWiki has one special page, /WikiCss that you can use to style things, here’s what I used:
#wiki_edit textarea {
width: 40em;
height: 20em;
}
#wiki_edit input {
display: block;
}
#wiki_restore {
display: inline;
}
I’d run a copy on Rubinius for you to use, but currently Rubinius is broken on FreeBSD.

Articles