From lasso at lassoweb.se Wed May 2 13:05:18 2007 From: lasso at lassoweb.se (Lars Olsson) Date: Wed, 02 May 2007 19:05:18 +0200 Subject: [Rg 19] Unable to display binary data Message-ID: <4638C4CE.6050106@lassoweb.se> Hi list! Can somebody please explain to me what is wrong with the following code. I'm trying to define an action that displays an image, but things go wrong as soon as I try to change the content type. I get different errors on JPG and PNG content. When using PNG, the image gets corrupted and cannot be displayed in the browser, when using JPG the console spits out a big chunk of errors regarding "illegal characters". Any ideas for solving this? Tested on: [WinXP, ruby 1.8.6, ramaze repo version] [OpenSuse 10.2, ruby 1.8.5, ramaze 0.0.9] with identical results. ----- code start ----- class MyController < Ramaze::Controller # The show_image uses no template def show_image data = '' File.open('/path/to/some/image/in/png/format', 'rb') do |f| data = f.read end response.header['Content-Type'] = 'image/png' data end end ----- code end ----- Sincerely /lasso -- ________________________________________ Lars Olsson lasso at lassoweb.se http://www.lassoweb.se/ From john at oxyliquit.de Thu May 3 16:59:24 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Thu, 03 May 2007 23:59:24 +0300 Subject: [Rg 20] Re: Unable to display binary data In-Reply-To: <4638C4CE.6050106@lassoweb.se> References: <4638C4CE.6050106@lassoweb.se> Message-ID: Hi, hit'n run: def file(uuid) file = DMS::File[uuid] unless file response.code = 404 return 'File not found.' end response.header["Content-Type"] = file.file_type response.body = File.open(file.disk_location) throw(:respond) end throw is important here. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From john at oxyliquit.de Fri May 4 03:55:32 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Fri, 04 May 2007 10:55:32 +0300 Subject: [Rg 21] Re: Unable to display binary data In-Reply-To: References: <4638C4CE.6050106@lassoweb.se> Message-ID: Hi, to make this a little more.. descriptive: I stumbled over this some days ago and manveru made a little helper for that: send_file(file, mime_type = Tool::MIME.type_for(file)) You can use that anywhere in the controller. It File.open()'s the file (so it must be a string) and does the throw for you. (Which means, any code after send_file won't be executed.) Hope that helps, Jo -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From lasso at lassoweb.se Fri May 4 06:01:32 2007 From: lasso at lassoweb.se (Lars Olsson) Date: Fri, 4 May 2007 10:01:32 -0000 (UTC) Subject: [Rg 22] Re: Unable to display binary data In-Reply-To: References: <4638C4CE.6050106@lassoweb.se> Message-ID: <36343.192.176.230.1.1178272892.squirrel@webmaiil.lassoweb.se> Thanks, that throw(:respond) thing looked way too cryptic for an otherwise nicely documented framework like Ramaze. :) Only two actions to go until my website is fully converted to using Ramaze. Kindly /lasso On Fri, May 4, 2007 07:55, Jonathan Buch wrote: > Hi, > > > to make this a little more.. descriptive: I stumbled over this some days > ago and manveru made a little helper for that: > > send_file(file, mime_type = Tool::MIME.type_for(file)) > > You can use that anywhere in the controller. It File.open()'s the > file (so it must be a string) and does the throw for you. (Which means, any > code after send_file won't be executed.) > > Hope that helps, > > > Jo > > > -- > Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ > _______________________________________________ > Ramaze-general mailing list > Ramaze-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/ramaze-general > > From john at oxyliquit.de Fri May 4 06:53:34 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Fri, 04 May 2007 13:53:34 +0300 Subject: [Rg 23] Re: Unable to display binary data In-Reply-To: <36343.192.176.230.1.1178272892.squirrel@webmaiil.lassoweb.se> References: <4638C4CE.6050106@lassoweb.se> <36343.192.176.230.1.1178272892.squirrel@webmaiil.lassoweb.se> Message-ID: Hi, > Thanks, no problem. :) > that throw(:respond) thing looked way too cryptic for an otherwise nicely > documented framework like Ramaze. :) Yeah, I was tired and 2 minutes before going to bed, so this rather unhelpful email slipped out. ;) > Only two actions to go until my website is fully converted to using > Ramaze. Nice! Another happy ramaze user I hope? :P Ramaze is now very close to a new release, did you notice any rough spots left, or any weird behaviour, bugs, uglyness? Jo -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From clive at crous.co.za Fri May 4 07:45:33 2007 From: clive at crous.co.za (clive at crous.co.za) Date: Fri, 04 May 2007 13:45:33 +0200 Subject: [Rg 24] darcs patch: Add my surname Message-ID: Fri May 4 13:40:31 SAST 2007 clive at crous.co.za * Add my surname -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/x-darcs-patch Size: 14282 bytes Desc: A darcs patch for your repository! Url : http://rubyforge.org/pipermail/ramaze-general/attachments/20070504/3ac3b3a3/attachment.bin From clive at crous.co.za Fri May 4 08:05:14 2007 From: clive at crous.co.za (clive at crous.co.za) Date: Fri, 04 May 2007 14:05:14 +0200 Subject: [Rg 25] darcs patch: Add a spec for testing Markaby links Message-ID: Fri May 4 14:02:41 SAST 2007 clive at crous.co.za * Add a spec for testing Markaby links -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/x-darcs-patch Size: 14724 bytes Desc: A darcs patch for your repository! Url : http://rubyforge.org/pipermail/ramaze-general/attachments/20070504/6489ee75/attachment-0001.bin From clive at crous.co.za Fri May 4 12:09:09 2007 From: clive at crous.co.za (clive at crous.co.za) Date: Fri, 04 May 2007 18:09:09 +0200 Subject: [Rg 26] darcs patch: add initial (working but ugly visually) ... (and 2 more) Message-ID: Fri May 4 15:16:00 SAST 2007 clive at crous.co.za * add initial (working but ugly visually) bl_Og example Fri May 4 17:54:48 SAST 2007 clive at crous.co.za * Style the bl_Og Fri May 4 18:06:31 SAST 2007 clive at crous.co.za * Order entries from most recent first. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/x-darcs-patch Size: 21784 bytes Desc: A darcs patch for your repository! Url : http://rubyforge.org/pipermail/ramaze-general/attachments/20070504/f855d424/attachment.bin From lasso at lassoweb.se Sun May 6 13:57:48 2007 From: lasso at lassoweb.se (Lars Olsson) Date: Sun, 06 May 2007 19:57:48 +0200 Subject: [Rg 27] Re: Unable to display binary data In-Reply-To: References: <4638C4CE.6050106@lassoweb.se> <36343.192.176.230.1.1178272892.squirrel@webmaiil.lassoweb.se> Message-ID: <463E171C.5050709@lassoweb.se> Jonathan Buch skrev: > Hi, > >> Thanks, > > no problem. :) > >> that throw(:respond) thing looked way too cryptic for an otherwise nicely >> documented framework like Ramaze. :) > > Yeah, I was tired and 2 minutes before going to bed, so this rather > unhelpful email slipped out. ;) > >> Only two actions to go until my website is fully converted to using >> Ramaze. > > Nice! Another happy ramaze user I hope? :P Yes, most things are pretty straightforward. My current site uses Nitro so most things only need small changes to work properly. > Ramaze is now very close to a new release, did you notice any rough > spots left, or any weird behaviour, bugs, uglyness? No, not really. I'm missing some conveniance methods for the request object (request method, content type), but I guess I can come up with a patch myself for that. :) Overall, I think you are doing excellent! > > Jo > Kindly /lasso From m.fellinger at gmail.com Mon May 7 02:22:02 2007 From: m.fellinger at gmail.com (Michael Fellinger) Date: Mon, 7 May 2007 15:22:02 +0900 Subject: [Rg 28] Re: Unable to display binary data In-Reply-To: <463E171C.5050709@lassoweb.se> References: <4638C4CE.6050106@lassoweb.se> <36343.192.176.230.1.1178272892.squirrel@webmaiil.lassoweb.se> <463E171C.5050709@lassoweb.se> Message-ID: <9c00d3e00705062322m3a8dfdb0jae6855ad0465f44c@mail.gmail.com> On 5/7/07, Lars Olsson wrote: > Jonathan Buch skrev: > > Hi, > > > >> Thanks, > > > > no problem. :) > > > >> that throw(:respond) thing looked way too cryptic for an otherwise nicely > >> documented framework like Ramaze. :) > > > > Yeah, I was tired and 2 minutes before going to bed, so this rather > > unhelpful email slipped out. ;) > > > >> Only two actions to go until my website is fully converted to using > >> Ramaze. > > > > Nice! Another happy ramaze user I hope? :P > > Yes, most things are pretty straightforward. My current site uses Nitro > so most things only need small changes to work properly. > > > Ramaze is now very close to a new release, did you notice any rough > > spots left, or any weird behaviour, bugs, uglyness? > > No, not really. I'm missing some conveniance methods for the request > object (request method, content type), but I guess I can come up with a > patch myself for that. :) Overall, I think you are doing excellent! these methods are here already :) request.request_method #=> "POST" request.content_type #=> "application/x-www-form-urlencoded" the first one comes from Rack::Request, the other one works on basis of method_missing, searching for a key in request.env named 'CONTENT_TYPE' (just upcases your method) hope that helps, and thanks for the compliments, that's fuel for my mind :) ^ manveru > > > > > Jo > > > > Kindly > > /lasso From clive at crous.co.za Mon May 7 13:41:16 2007 From: clive at crous.co.za (clive at crous.co.za) Date: Mon, 07 May 2007 19:41:16 +0200 Subject: [Rg 29] darcs patch: Add a few specs for the base ramaze template class Message-ID: Mon May 7 16:05:18 SAST 2007 clive at crous.co.za * Add a few specs for the base ramaze template class -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/x-darcs-patch Size: 17684 bytes Desc: A darcs patch for your repository! Url : http://rubyforge.org/pipermail/ramaze-general/attachments/20070507/32685657/attachment.bin From clive at crous.co.za Mon May 7 13:46:40 2007 From: clive at crous.co.za (clive at crous.co.za) Date: Mon, 07 May 2007 19:46:40 +0200 Subject: [Rg 30] darcs patch: Add a few specs for the base ramaze template class Message-ID: Mon May 7 19:46:00 SAST 2007 clive at crous.co.za * Add a few specs for the base ramaze template class -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/x-darcs-patch Size: 17865 bytes Desc: A darcs patch for your repository! Url : http://rubyforge.org/pipermail/ramaze-general/attachments/20070507/d423a2ed/attachment-0001.bin From lasso at lassoweb.se Mon May 28 09:46:00 2007 From: lasso at lassoweb.se (Lars Olsson) Date: Mon, 28 May 2007 13:46:00 -0000 (UTC) Subject: [Rg 31] Ramaze 0.1.1 is broken Message-ID: <53230.192.176.230.1.1180359960.squirrel@webmaiil.lassoweb.se> Hi! Ramaze 0.1.1 completely breaks apps created with earlier versions of the framwork. Steps to reproduce (similar results in both WinXP and Linux): 1. Create project with 0.1.0 2. Update gem to 0.1.1 3. *kaboom* Backtrace (proto project, no changes): C:\Documents and Settings\olslar06\Skrivbord\ramaze_test>ramaze running `main.rb' C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:37:in `send': undefined method `autoreload=' for # (NoMethodError) from C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:37:in `setup' from C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:36:in `each' from C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:36:in `setup' from ./main.rb:16 from C:/Program/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2 7:in `gem_original_require' from C:/Program/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2 7:in `require' from C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/bin/ramaze:89 from C:/Program/Ruby/bin/ramaze:16:in `load' from C:/Program/Ruby/bin/ramaze:16 Any suggestions? /lasso From m.fellinger at gmail.com Mon May 28 10:03:56 2007 From: m.fellinger at gmail.com (Michael Fellinger) Date: Mon, 28 May 2007 23:03:56 +0900 Subject: [Rg 32] Re: Ramaze 0.1.1 is broken In-Reply-To: <53230.192.176.230.1.1180359960.squirrel@webmaiil.lassoweb.se> References: <53230.192.176.230.1.1180359960.squirrel@webmaiil.lassoweb.se> Message-ID: <9c00d3e00705280703o65a97c36s8ca6b46cf2f20ae1@mail.gmail.com> yes, it's Global.sourcereload after the huge Global restructuring. I hope that fixes your problem, also - all the conf/*.yaml files are deprecated. ^ manveru On 5/28/07, Lars Olsson wrote: > Hi! > > Ramaze 0.1.1 completely breaks apps created with earlier versions of the > framwork. Steps to reproduce (similar results in both WinXP and Linux): > > 1. Create project with 0.1.0 > 2. Update gem to 0.1.1 > 3. *kaboom* > > Backtrace (proto project, no changes): > C:\Documents and Settings\olslar06\Skrivbord\ramaze_test>ramaze > running `main.rb' > C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:37:in > `send': undefined method `autoreload=' for > # (NoMethodError) > from > C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:37:in > `setup' > from > C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:36:in > `each' > from > C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:36:in > `setup' > from ./main.rb:16 > from > C:/Program/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2 > 7:in `gem_original_require' > from > C:/Program/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2 > 7:in `require' > from > C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/bin/ramaze:89 > from C:/Program/Ruby/bin/ramaze:16:in `load' > from C:/Program/Ruby/bin/ramaze:16 > > Any suggestions? > > /lasso > > _______________________________________________ > Ramaze-general mailing list > Ramaze-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/ramaze-general > From lasso at lassoweb.se Mon May 28 17:05:46 2007 From: lasso at lassoweb.se (Lars Olsson) Date: Mon, 28 May 2007 23:05:46 +0200 Subject: [Rg 33] Re: Ramaze 0.1.1 is broken In-Reply-To: <9c00d3e00705280703o65a97c36s8ca6b46cf2f20ae1@mail.gmail.com> References: <53230.192.176.230.1.1180359960.squirrel@webmaiil.lassoweb.se> <9c00d3e00705280703o65a97c36s8ca6b46cf2f20ae1@mail.gmail.com> Message-ID: <465B442A.20507@lassoweb.se> Thanks, I figured most things out the new configuration after reading the new docs some more. The only thing I don't get is how to turn off the messages in the console (i.e like in the old 'live' mode). There's probably is an easy way of doing so, but I wouldn't mind a hint... :) Sincerely /lasso Michael Fellinger skrev: > yes, it's Global.sourcereload after the huge Global restructuring. > I hope that fixes your problem, also - all the conf/*.yaml files are deprecated. > > ^ manveru > > On 5/28/07, Lars Olsson wrote: > >> Hi! >> >> Ramaze 0.1.1 completely breaks apps created with earlier versions of the >> framwork. Steps to reproduce (similar results in both WinXP and Linux): >> >> 1. Create project with 0.1.0 >> 2. Update gem to 0.1.1 >> 3. *kaboom* >> >> Backtrace (proto project, no changes): >> C:\Documents and Settings\olslar06\Skrivbord\ramaze_test>ramaze >> running `main.rb' >> C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:37:in >> `send': undefined method `autoreload=' for >> # (NoMethodError) >> from >> C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:37:in >> `setup' >> from >> C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:36:in >> `each' >> from >> C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:36:in >> `setup' >> from ./main.rb:16 >> from >> C:/Program/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2 >> 7:in `gem_original_require' >> from >> C:/Program/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2 >> 7:in `require' >> from >> C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/bin/ramaze:89 >> from C:/Program/Ruby/bin/ramaze:16:in `load' >> from C:/Program/Ruby/bin/ramaze:16 >> >> Any suggestions? >> >> /lasso >> >> _______________________________________________ >> Ramaze-general mailing list >> Ramaze-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ramaze-general >> >> > _______________________________________________ > Ramaze-general mailing list > Ramaze-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/ramaze-general > From m.fellinger at gmail.com Mon May 28 21:04:01 2007 From: m.fellinger at gmail.com (Michael Fellinger) Date: Tue, 29 May 2007 10:04:01 +0900 Subject: [Rg 34] Re: Ramaze 0.1.1 is broken In-Reply-To: <465B442A.20507@lassoweb.se> References: <53230.192.176.230.1.1180359960.squirrel@webmaiil.lassoweb.se> <9c00d3e00705280703o65a97c36s8ca6b46cf2f20ae1@mail.gmail.com> <465B442A.20507@lassoweb.se> Message-ID: <9c00d3e00705281804t55d0c53exbcce819d86652a5d@mail.gmail.com> On 5/29/07, Lars Olsson wrote: > Thanks, > > I figured most things out the new configuration after reading the new > docs some more. The only thing I don't get is how to turn off the > messages in the console (i.e like in the old 'live' mode). There's > probably is an easy way of doing so, but I wouldn't mind a hint... :) All loggers are now located in Inform.loggers, it's a normal Array, so you can .clear it :) ^ manveru > > Sincerely > > /lasso > > > Michael Fellinger skrev: > > yes, it's Global.sourcereload after the huge Global restructuring. > > I hope that fixes your problem, also - all the conf/*.yaml files are deprecated. > > > > ^ manveru > > > > On 5/28/07, Lars Olsson wrote: > > > >> Hi! > >> > >> Ramaze 0.1.1 completely breaks apps created with earlier versions of the > >> framwork. Steps to reproduce (similar results in both WinXP and Linux): > >> > >> 1. Create project with 0.1.0 > >> 2. Update gem to 0.1.1 > >> 3. *kaboom* > >> > >> Backtrace (proto project, no changes): > >> C:\Documents and Settings\olslar06\Skrivbord\ramaze_test>ramaze > >> running `main.rb' > >> C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:37:in > >> `send': undefined method `autoreload=' for > >> # (NoMethodError) > >> from > >> C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:37:in > >> `setup' > >> from > >> C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:36:in > >> `each' > >> from > >> C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/lib/ramaze/global/globalstruct.rb:36:in > >> `setup' > >> from ./main.rb:16 > >> from > >> C:/Program/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2 > >> 7:in `gem_original_require' > >> from > >> C:/Program/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2 > >> 7:in `require' > >> from > >> C:/Program/Ruby/lib/ruby/gems/1.8/gems/ramaze-0.1.1/bin/ramaze:89 > >> from C:/Program/Ruby/bin/ramaze:16:in `load' > >> from C:/Program/Ruby/bin/ramaze:16 > >> > >> Any suggestions? > >> > >> /lasso > >> > >> _______________________________________________ > >> Ramaze-general mailing list > >> Ramaze-general at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/ramaze-general > >> > >> > > _______________________________________________ > > Ramaze-general mailing list > > Ramaze-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ramaze-general > > > > _______________________________________________ > Ramaze-general mailing list > Ramaze-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/ramaze-general >