Re: Are we ready for a release ?

2008-03-12 Thread pedro mg
On 3/12/08, Jonas Pfenniger <[EMAIL PROTECTED]> wrote:
> Hi campers,
>
>  what do you think of releasing the current trunk as camping-1.6 ?
>  Nothing much has moved since a while and apart from FastCGI, I believe
>  most bugs where ironed out.
>
>  After the gem release, I propose putting some effort on documentation
>  and how to use Rack's FastCGI. When that's done, we'll have a
>  Rubyforge announcement and such.
>
>  /me is waiting for community input

agree

-- 
pedro mg
http://blog.tquadrado.com
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Fwd: Camping is a winner at SXSW-i

2008-03-10 Thread pedro mg
On 3/10/08, John Beppu <[EMAIL PROTECTED]> wrote:
 > Last night, a little Camping application I wrote called MetaNotes won the
 > Experimental division in the SXSW Web Awards.

Hey, congrats John ;) Very well indeed.
Camping is in fact very cool.

--
pedro mg
http://blog.tquadrado.com
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: how can I catch HTTP 501?

2008-02-23 Thread pedro mg
Hi,

i gave a quick look at the code and it seems you need to work out the
route for "ping" on the Devices class. I'm not using reststop, but
went to check it out.

http://reststop.rubyforge.org/classes/Camping/Controllers.src/M11.html

def no_method(e)
 _error("No controller method responds to this route!", 501, e)
end

def not_found(e)
  _error("Record not found!", 404, e)
end

Seems those 501 are being delivered by reststop.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
"10.5.2 501 Not Implemented
The server does not support the functionality required to fulfill the
request. This is the appropriate response when the server does not
recognize the request method and is not capable of supporting it for
any resource. "

In Reststop: "Calling REST "" creates a controller with
the appropriate routes and maps your REST methods to standard Camping
controller mehods. This is meant to be used in your Controllers module
in place of R ."

You'l need to specify those possible routes probably:
# GET /devices/1/ping
 def ping(id)
   ...
 end

If i well understood, you'd like to have a /devices/1/(\w+) route that
reststop could parse. It is not a case solved by a 'prefix'. If you
knew the possible methods, you'd implement them. In this case, i'd use
Camping standard Routes, where you are free to specify what you want
by the use of RegExp's.

Or... you can try to change Reststop yourself ;) on your own risk,
following or not the REST architecture :)
Start by redirecting that error message to a specific Route of yours.

/lib/reststop.rb
if e.message =~ /no such method/
 return no_method(e) # <== act here ;)
else
 raise e
end

...or even a bit above, in the protected block under send(custom_action...)

pedro mg

On 2/23/08, Albert Ng <[EMAIL PROTECTED]> wrote:
> I'm using camping with reststop to do a html front end for sending
> pre-defined messages to different devices (puts will work) depending on the
> time (will parse cron).  No real deadline.
>
> Works great up to now, much fun, forgot to sleep.
>
> Problem is when I pass a URL of the form /device/1/ping without a "Ping"
> controller method.  It will send me a "501 Not Implemented".  Interestingly
> enough, /device/1/1/ping will give me "404 Not Found" which I have properly
> handled.
>
> So my question are:
> In what part of the code can I catch the 501?
> How can I implement a catch-all controller method?
> Who's giving me the nicely formated web page when the 501's happening?
> Where could I have found that out?
>  If I stop using reststop, will the problem go away?
>
> Attached is what I have worked up till now.  Has a postamble, will work with
> webrick.
>
> ___
>  Camping-list mailing list
>  Camping-list@rubyforge.org
>  http://rubyforge.org/mailman/listinfo/camping-list
>
>
--
pedro mg
http://blog.tquadrado.com
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Keeping Camping going

2008-01-11 Thread pedro mg
Yes, lets keep Camping moving on. Feeling very confortable in it.

Received "Nobody knows Shoes" yesterday. So wonderfuly odd :)
I wonder if Mr. _Why can take some time for a Camping book too from Lulu...
What a nice collection it would be.

(I think I saw some S. Lem books on the shelf)

-- pedro mg

On 1/11/08, why the lucky stiff <[EMAIL PROTECTED]> wrote:
>
> On Wed, Jan 09, 2008 at 11:29:17PM -0500, Jeremy McAnally wrote:
> > If that's not acceptable, then I'd like a commit bit at least so I can
>
> Yes, sure, anyone who has a trac account is also granted commit
> rights for all of my projects.  (Except for Shoes, which I am much
> more protective of.)  It would be courteous to talk to Jonas as
> well (he's zimbatm) because he's done so much.
>
>
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: css image url's and :img problem FIXED

2007-11-24 Thread pedro mg
Finally, a solution.
After spending days on this, i got to a solution: use a Lighty specific header.

Instead of:
@headers['X-Sendfile'] = full_path

Use:
@headers['X-LIGHTTPD-Send-file'] = full_path

There is still the need of the:
fastcgi.server = ( "..." => (( ..., "allow-x-send-file" => "enable" )))

http://trac.lighttpd.net/trac/changeset/1097/branches/lighttpd-merge-1.4.x/doc/fastcgi.txt

Wget logs the headers correctly:
$ wget -d -S http://machine:port/webapp -o log
$ wget -d -S http://machine:port/webapp/static/img001.jpg -o log

TY zimbatm for the refactor.

http://pastebin.com/mdd73c8b

-- 
pedro mg
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-21 Thread pedro mg
On Sun, Nov 18, 2007 at 04:10:04AM +, pedro mg wrote:
> img :src => R(Static, 'img04.jpg'), :alt => 'test image'

Hi,

anyone using Lighttpd + FastCGI to run Camping using Why's configuration
shown at 4) in:
http://code.whytheluckystiff.net/camping/wiki/TheCampingServerForLighttpd

Focusing on the fastcgi module configuration we have:
fastcgi.server = ( "" => (
 ...
)

With this, camping mounts all apps at ROOT.
The problem is the image file handling. It handles ".css" and ".js" files 
correctly, but no image is handled.

Mounting the app in a subdirectory:
fastcgi.server = ( "/project1" => (
 ...
)
starts serving image files correctly for all other apps except for this one, 
since fastcgi will handle /project images (with error)

In Debian, mime types are assigned to lighty via PERL script called from 
lighttpd.conf, so no need for assignement at the 10-fastcgi.conf file.

So my question is: anyone using Lighttpd + FastCGI + Camping ? How do you serve 
images ?

System: Debian 4.0
Camping 1.5

best regards,
-- 
pedro mg
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-20 Thread pedro mg
On Tue, Nov 20, 2007 at 06:34:12AM +, pedro mg wrote:
> > You aren't running on Windows are you? The newline handling might
> > be corrupting your files...

If i test http://localhost:3301/project/static/img01.png

I get the correct Content-Type in the browser title:
img01.png (PNG Image)

If it is a gif file, i get (GIF Image), etc.
But it doesnt render in the browser, reporting:
The image "http://localhost:3301/project/static/img01.png"; cannot be displayed 
because it contains errors.

Any hint  ?

-- 
pedro mg
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-19 Thread pedro mg
On Mon, Nov 19, 2007 at 02:10:06PM +1100, Clifford Heath wrote:
> When you get that, do a File->Save and see whether the file you save is
> identical to the source file.

no, diff size corrupted image file. 2 more bytes added... \nl ?

> You aren't running on Windows are you? The newline handling might
> be corrupting your files...

no, Debian Etch. Epiphany and Iceweasel, same results.

best regards,
-- 
pedro mg
http://blog.tquadrado.com
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-19 Thread pedro mg
On Mon, Nov 19, 2007 at 03:13:11PM +0100, Jonas Pfenniger wrote:
> 2007/11/18, pedro mg <[EMAIL PROTECTED]>:
> > The class is here: http://pastebin.com/f7c92f95a
> 
> Remove the quotes around the regexp on line 5. Right now the
> expression returns nil, which is not an entry in your MIME_TYPES hash.
> Apparently the browser can work around a nil mime-type for the .css
> but not for the pics.

Yes Jonas, thanks, i noticed it almost immediately through IRB testing ;) and
did remove them:

MIME_TYPES[file[(/\.\w+$/)]] || 'text/plain'

best regards,
-- 
pedro mg
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-18 Thread pedro mg
On Sun, 2007-11-18 at 18:23 +0100, Magnus Holm wrote:
> Can you access the image at (localhost:3301)/static/img01.gif through
> your browser?

I get an error message:

Couldn't load image 'img01.gif'
Unrecognized image file format

Same result for .jpg and .png image files.
I guess i'm having problems with DOCTYPE and headers...

-- 
pedro mg

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-18 Thread pedro mg
On Sat, 2007-11-17 at 21:43 -0800, John Beppu wrote:
> On Nov 17, 2007 8:10 PM, pedro mg <[EMAIL PROTECTED]> wrote:
> 
> background: #33 url(img01.gif) repeat-x;
> 
> url(/static/img01.gif)

oh, sorry for the 2nd post.
Ty John, but i tried that, and even the whole path to the images, and
still no results.

-- 
pedro mg



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


css image url's and img problem

2007-11-18 Thread pedro mg
2nd post... the first didnt got here ?
==

Hi,

i have this controller class to serve static files. It works well for
the stylesheet file under a /static directory, locating it, but the
images referenced in the stylesheet do not appear. They are in the
same /static folder, next to the stylesheet.css file.

link :rel => 'stylesheet', :href => R(Static, 'stylesheet.css'), :type
=> 'text/css'

In the CSS file i try:

background: #33 url(img01.gif) repeat-x;

The class is here: http://pastebin.com/f7c92f95a

Another problem is for images, i cant seem to make them appear in the
page using:

img :src => R(Static, 'img04.jpg'), :alt => 'test image'

I always get the alternate description (or a thumb is no :alt is
supplied).

Any hint ? Thank you.

-- 
pedro mg

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


css image url's and :img problem

2007-11-17 Thread pedro mg
Hi,

i have this controller class to serve static files. It works well for
the stylesheet file under a /static directory, locating it, but the
images referenced in the stylesheet do not appear. They are in the
same /static folder, next to the stylesheet.css file.

link :rel => 'stylesheet', :href => R(Static, 'stylesheet.css'), :type
=> 'text/css'

In the CSS file i try:

background: #33 url(img01.gif) repeat-x;

The class is here: http://pastebin.com/f7c92f95a

Another problem is for images, i cant seem to make them appear in the
page using:

img :src => R(Static, 'img04.jpg'), :alt => 'test image'

I always get the alternate description (or a thumb is no :alt is
supplied).

Any hint ? Thank you.

-- 
pedro mg

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list