From: jens wille Date: 2007-04-03T21:04:02+09:00 Subject: Re: {ANN] Rio 0.4.0 --------------010208070506040002030101 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit hi christopher! rio4ruby [03/04/07 05:10]: > Rio 0.4.0 > > = Rio - Ruby I/O Facilitator > > fa-cil-i-tate: To make easy or easier [http:// > www.thefreedictionary.com/facilitate] awesome! just went through the code and docs. awesome library, awesome docs! ...what can i say more? ;-) one suggestion though: what about adding a content_type method to RIO::IF::File? this would allow to treat local and remote files alike, just call content_type on the respective rio. rio('http://example.com/image.png').content_type #=> "image/png" rio('some/local/image.png').content_type #=> "image/png" the former via open-uri, the latter via mime-types (which, however, is not part of the standard library). please see attached diff for a simple implementation. cheers jens -- Jens Wille, Dipl.-Bibl. (FH) prometheus - Das verteilte digitale Bildarchiv f�r Forschung & Lehre An St. Laurentius 4, 50931 K�ln Tel.: +49 (0)221 470-6668, E-Mail: jens.wille@uni-koeln.de http://www.prometheus-bildarchiv.de/ --------------010208070506040002030101 Content-Type: text/plain; name="content_type.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="content_type.diff" *** rio-0.4.0/lib/rio/if/file.rb~ 2007-04-03 13:36:00.000000000 +0200 --- rio-0.4.0/lib/rio/if/file.rb 2007-04-03 13:40:08.000000000 +0200 *************** *** 35 **** --- 36 ---- + require 'mime/types' *************** *** 80 **** --- 82,89 ---- + def mime_types + MIME::Types.of(self.path) + end + + def content_type + mime_types.first.content_type + end + --------------010208070506040002030101--