This post originated from an RSS feed registered with Ruby Buzz
by Red Handed.
Original Post: Scripting Portupgrade with Ruby
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
I guess it’s hard to top RubyX when it comes to an OS alliance with Ruby. However, FreeBSD’s portupgrade long ago heaved the bar up—it’s a scriptable application for updating ports. I’ve always considered it to be neck-and-neck with tDiary for being Ruby’s first killer app. And portupgrade has got tDiary beat on worldwide adoption. tDiary is hot snakes in Japan—and only.
The primary means of scripting portupgrade is with the pkgtools.conf, which is a Ruby script full of constants. For example, should you want to give make arguments for certain packages, MAKE_ARGS is a hash:
If you know Ruby, scripting portupgrade becomes really trivial. In fact, one of the first Ruby programs I wrote kept the long and winding PHP make flags I had and abstracted them into a simple array.
Imagine if you could script your web server in this manner. See and it seems like the budding courtship between lighttpd and Ruby would yield such scripting. (VHosts in a YAML file, anyone??)
The author of portupgrade (and portsdb), knu, has been the Ruby CVS chieftain since 2000. He has been nothing but judicious and kind. And we’ve all benefited from cvsmailer at one time or another, wouldn’t you say??