some ruby improvements

0 views
Skip to first unread message

mike castleman

unread,
Mar 7, 2010, 12:00:28 AM3/7/10
to mimepa...@googlegroups.com
hello list,

I've made some improvements to the ruby version of MIMEParse; a diff is
attached.

One big improvement is that there is now support for running the
testsuite. (This means that the ruby implementation is now two files;
should it thus be moved to its own directory?)

The other improvement is that best_match will now return the
last-specified MIME type in the case of many equally good matches (as do
the JavaScript version and some of the others). I added some a test case
for this directly to the ruby test runner rather than to the JSON
because I don't want to step on any toes. But if it is generally
accepted that this is a good idea then we can easily put the test into
the JSON.

And perhaps the smallest change is that we now return the empty string
rather than nil in the case where no match is found. I don't know if
this is a good idea or not, but it's what the testsuite demands, so I've
done it.

One final note: one of the testcases had an extra argument. This broke
the way my test suite was written, so removing that extra argument is
included in this diff.

I can provide individual diffs for each of these changes if needed, but
one diff for all of these changes is attached.

Let me know if there are any questions or if there's any further work
needed on this.

cheers,
mlc

ruby-improvements.diff
Reply all
Reply to author
Forward
0 new messages