stamp: Ruby library for formatting dates and times based on human-friendly examples

https://github.com/jeremyw/stamp


See the Github page for a full list of features.

Dates

date = Date.new(2011, 6, 9)
date.stamp("March 1, 1999")         #=> "June 9, 2011"
date.stamp("Jan 1, 1999")           #=> "Jun 9, 2011"
date.stamp("Jan 01")                #=> "Jun 09"
date.stamp("Sunday, May 1, 2000")   #=> "Thursday, June 9, 2011"
date.stamp("Sun Aug 5")             #=> "Thu Jun 9"
date.stamp("12/31/99")              #=> "06/09/11"
date.stamp("DOB: 12/31/2000")       #=> "DOB: 06/09/2011"

Ordinal Days

date.stamp("November 5th")          #=> "June 9th"
date.stamp("1st of Jan")            #=> "9th of Jun"

Times

time = Time.utc(2011, 6, 9, 20, 52, 30)
time.stamp("3:00 AM")               #=> "8:52 PM"
time.stamp("01:00:00 AM")           #=> "08:52:30 PM"
time.stamp("23:59")                 #=> "20:52"
time.stamp("23:59:59")              #=> "20:52:30"
time.stamp("Jan 1 at 01:00 AM")     #=> "Jun 9 at 08:52 PM"
time.stamp("23:59 UTC")             #=> "20:52 PST"

Capybara: Ruby library to simulate user browser interactions with support for multiple test drivers

Capybara logo

http://jnicklas.github.io/capybara/


From the Capybara site:

Tired of clicking around in your browser trying to make sure your applications work as expected? Capybara is a library written in the Ruby programming language which makes it easy to simulate how a user interacts with your application.

Capybara can talk with many different drivers which execute your tests through the same clean and simple interface. You can seamlessly choose between Selenium, Webkit or pure Ruby drivers.

Tackle the asynchronous web with Capybara’s powerful synchronization features. Capybara automatically waits for your content to appear on the page, you never have to issue any manual sleeps.