Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu User (http://www.linux-archive.org/ubuntu-user/)
-   -   mahoro-ruby: Calling =flags to set type to MIME doesn't work (http://www.linux-archive.org/ubuntu-user/191039-mahoro-ruby-calling-flags-set-type-mime-doesnt-work.html)

Francis Irving 11-10-2008 04:13 PM

mahoro-ruby: Calling =flags to set type to MIME doesn't work
 
Package: mahoro-ruby
Version: 0.1-2
Severity: normal


If I set the flag to MIME with the flags= command like this,
it doesn't work:

irb(main):001:0> require 'mahoro'
=> true
irb(main):002:0> m = Mahoro.new
=> #<Mahoro:0xb7c228f8>
irb(main):003:0> m.flags = Mahoro::MIME
=> 16
irb(main):004:0> m.file("Issue")
=> "Microsoft Office Document"

(where "Issue" is a Word document in the current directory)

In contrast, if I set it via initialize then it is fine.

irb(main):001:0> require 'mahoro'
=> true
irb(main):002:0> m = Mahoro.new(Mahoro::MIME)
=> #<Mahoro:0xb7c71688>
irb(main):003:0> m.file("Issue")
=> "application/msword"

I believe that this is because you have to call magic_load to force use of new
flags but mahoro_set_flags doesn't do that. I don't know libmagic well enough
to know exactly the right fix.

Francis


-- System Information:
Debian Release: lenny/sid
APT prefers hardy-updates
APT policy: (500, 'hardy-updates'), (500, 'hardy-security'), (500, 'hardy')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-21-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages mahoro-ruby depends on:
ii mahoro-ruby1.8 0.1-2 File type determination library fo

mahoro-ruby recommends no packages.

-- no debconf information

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


All times are GMT. The time now is 12:58 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.