Subject: [sup-talk] mime-view.rb: content_type not found

From: Shadowfirebird <[email-masked]>
Date: Fri, 22 Oct 2010 09:34:04 +0100

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!"
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Matthew Goodall <[email-masked]>
Date: Sun, 24 Oct 2010 10:46:00 +1300

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 directory
or 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.
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Philipp Überbacher <[email-masked]>
Date: Fri, 22 Oct 2010 12:31:08 +0200

Regards,
Philipp

---

From: Sascha Silbe <[email-masked]>
Date: Sat, 23 Oct 2010 14:00:56 +0200

>     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/
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Shadowfirebird <[email-masked]>
Date: Sat, 23 Oct 2010 10:28:29 +0100

-- 
A synonym is a word you use when you can't spell the word you first
thought of.
		-- Burt Bacharach
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Shadowfirebird <[email-masked]>
Date: Sat, 23 Oct 2010 22:42:23 +0100

> 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.
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk