halst/docopt.rb — pull request #4 by alexspeller (2012-06-03 18:53:14+00:00)
Title: Rearchitect and use test/unit

So, quite a major refactor here, this is still api-compatible but with a simpler structure.

The main changes are:

1) Make ```docopt``` a convenience method that returns a new instance of the ```Docopt``` class
2) Remove ```option``` method and place logic inside initalize method of ```Option``` class. This makes the class less of a 'dumb container' and instead knows how to intialize itself from an option line
3) Namespace ```Option``` class to ```Docopt::Option```
4) Add ```Docopt::UnknownOptionError``` custom exception class
5) Refactor tests to use ruby's built in ```test/unit``` functionality.
6) Add tests for ```Docopt``` class
7) Add ability to access argument values by short or long name if both valid, along with allowing access by symbols also

Quite a lot at once but the changes were quite interdependent, let me know what you think!