I have open-sourced a fairly comprehensive morse code tutor I have written (and used) in the Ruby language. It goes by the name of CW.
In case you were wondering, CW stands for Continuous Wave. When communicating by morse code you are effectively interrupting a continuous-wave signal with a key to generate dots and dashes. For this reason, the name CW became synonymous with morse code.
The tutor is in the form of domain-specific language and a couple of simple CW test examples are shown below:
Ex.1 Play a daily quotation from an rss feed (18 words per minute / 12 effective words per minute)
comment 'read daily quotation via RSS feed (1 article)'
Ex.2 Play eight words having five or less letters (18 words per minute)
comment "Eight words, five or less letters (18 WPM)"
I have documented CW using the excellent Jekyll static website generator, and a theme called Documentation theme jekyll.