* [sup-talk] mime-view.rb: content_type not found
@ 2010-10-22 8:34 Shadowfirebird
2010-10-22 10:31 ` Philipp Überbacher
2010-10-23 12:00 ` Sascha Silbe
0 siblings, 2 replies; 6+ messages in thread
From: Shadowfirebird @ 2010-10-22 8:34 UTC (permalink / raw)
To: sup-talk
[-- Attachment #1.1: Type: text/plain, Size: 453 bytes --]
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!"
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 140 bytes --]
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sup-talk] mime-view.rb: content_type not found
2010-10-22 8:34 [sup-talk] mime-view.rb: content_type not found Shadowfirebird
@ 2010-10-22 10:31 ` Philipp Überbacher
2010-10-23 9:28 ` Shadowfirebird
2010-10-23 12:00 ` Sascha Silbe
1 sibling, 1 reply; 6+ messages in thread
From: Philipp Überbacher @ 2010-10-22 10:31 UTC (permalink / raw)
To: sup-talk
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
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sup-talk] mime-view.rb: content_type not found
2010-10-22 10:31 ` Philipp Überbacher
@ 2010-10-23 9:28 ` Shadowfirebird
2010-10-23 21:46 ` Matthew Goodall
0 siblings, 1 reply; 6+ messages in thread
From: Shadowfirebird @ 2010-10-23 9:28 UTC (permalink / raw)
To: sup-talk
[-- Attachment #1.1: Type: text/plain, Size: 390 bytes --]
> 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?
--
A synonym is a word you use when you can't spell the word you first
thought of.
-- Burt Bacharach
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 140 bytes --]
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sup-talk] mime-view.rb: content_type not found
2010-10-22 8:34 [sup-talk] mime-view.rb: content_type not found Shadowfirebird
2010-10-22 10:31 ` Philipp Überbacher
@ 2010-10-23 12:00 ` Sascha Silbe
2010-10-23 21:42 ` Shadowfirebird
1 sibling, 1 reply; 6+ messages in thread
From: Sascha Silbe @ 2010-10-23 12:00 UTC (permalink / raw)
To: sup-talk
[-- Attachment #1.1: Type: text/plain, Size: 695 bytes --]
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/
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
[-- Attachment #2: Type: text/plain, Size: 140 bytes --]
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sup-talk] mime-view.rb: content_type not found
2010-10-23 12:00 ` Sascha Silbe
@ 2010-10-23 21:42 ` Shadowfirebird
0 siblings, 0 replies; 6+ messages in thread
From: Shadowfirebird @ 2010-10-23 21:42 UTC (permalink / raw)
To: sup-talk
[-- Attachment #1.1: Type: text/plain, Size: 420 bytes --]
> 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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 140 bytes --]
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [sup-talk] mime-view.rb: content_type not found
2010-10-23 9:28 ` Shadowfirebird
@ 2010-10-23 21:46 ` Matthew Goodall
0 siblings, 0 replies; 6+ messages in thread
From: Matthew Goodall @ 2010-10-23 21:46 UTC (permalink / raw)
To: sup-talk
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
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-10-23 23:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-22 8:34 [sup-talk] mime-view.rb: content_type not found Shadowfirebird
2010-10-22 10:31 ` Philipp Überbacher
2010-10-23 9:28 ` Shadowfirebird
2010-10-23 21:46 ` Matthew Goodall
2010-10-23 12:00 ` Sascha Silbe
2010-10-23 21:42 ` Shadowfirebird
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox