Hi, I''m having trouble setting up the mime-view.rb hook.
According to the wiki, there should be a "variable" content_type.
But, here''s my program:
begin
log content_type filename
rescue
log "Error: #{$!}"
end
And here''s what the log file says:
hook[mime-view]: Error: undefined method `content_type'' for
#<Redwood::HookManager::HookContext:0x7f13003fe110>
Anyone got any ideas?
--
Bones: "The man''s DEAD, Jim!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL:
<http://rubyforge.org/pipermail/sup-talk/attachments/20101022/75caa1e7/attachment.bin>
Excerpts from Shadowfirebird''s message of 2010-10-22 10:34:04 +0200:> Hi, I''m having trouble setting up the mime-view.rb hook. > > According to the wiki, there should be a "variable" content_type. > > But, here''s my program: > > begin > log content_type filename > > rescue > log "Error: #{$!}" > end > > And here''s what the log file says: > > hook[mime-view]: Error: undefined method `content_type'' for #<Redwood::HookManager::HookContext:0x7f13003fe110> > > > Anyone got any ideas?I might be wrong, but I seem to remember that the mime type checking depends on some funky debian/ubuntu script. I ran into this when I tried to get this to work: http://sup.rubyforge.org/wiki/wiki.pl?ViewingAttachments Regards, Philipp
> I might be wrong, but I seem to remember that the mime type checking > depends on some funky debian/ubuntu script. I ran into this when I tried > to get this to work: > http://sup.rubyforge.org/wiki/wiki.pl?ViewingAttachmentsHas *anyone* got mime-view.rb working? If so, what OS? -- A synonym is a word you use when you can''t spell the word you first thought of. -- Burt Bacharach -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20101023/da3c1690/attachment.bin>
Excerpts from Shadowfirebird''s message of Fri Oct 22 10:34:04 +0200 2010:> According to the wiki, there should be a "variable" content_type. > > log content_type filename > > hook[mime-view]: Error: undefined method `content_type'' for #<Redwood::HookManager::HookContext:0x7f13003fe110>Looks like a syntax error to me (in Ruby you don''t have to add parentheses around the parameters, but as in your case above things can get ambiguous then). Also log doesn''t support more than one parameter. Try: log content_type log filename Or: log "content_type=#{content_type} filename=#{filename}" Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: not available URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20101023/bb8fad1a/attachment.bin>
> Looks like a syntax error to me (in Ruby you don''t have to add > parentheses around the parameters, but as in your case above things can > get ambiguous then). Also log doesn''t support more than one parameter.::headdesk:: You called it. The error message threw me, I guess. That''s me, though: the only mistakes I make are stupid ones. Many thanks. -- What this country needs is a good five cent microcomputer. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20101023/f0eb2471/attachment-0001.bin>
Excerpts from Shadowfirebird''s message of Sat Oct 23 22:28:29 +1300 2010:> > I might be wrong, but I seem to remember that the mime type checking > > depends on some funky debian/ubuntu script. I ran into this when I tried > > to get this to work: > > http://sup.rubyforge.org/wiki/wiki.pl?ViewingAttachments > > Has *anyone* got mime-view.rb working? If so, what OS? >I guess I have it going, I use a standard OSX configuration. mime-view.rb: system "open ''#{filename}''">From the open man page "The open command opens a file (or a directoryor URL), just as if you had double-clicked the file''s icon." If you are on linux you may want to try xdg-open and iirc you can use ''cmd /c start'' on windows.