Copied from rubyforge.