I’ve released the ruby-sun-times gem, which calculates sunrise and sunset times according to date and location.
The project is hosted on GitHub.
The gem is available from here.
$ irb >> require 'rubygems' => true >> require 'sun_times' => true >> SunTimes.set( Date.today, 44, 11 ).localtime => Tue Mar 09 18:14:08 +0100 2010
So, the sun will be setting round here at 6:14 PM local time.