Hi,
How do I retrieve form parameters with FCGI in a way that works for both GET and POST?
I'm using FCGI.each{|request| ...} and trying to avoid the need to use the CGI object.
Hi,
How do I retrieve form parameters with FCGI in a way that works for both GET and POST?
I'm using FCGI.each{|request| ...} and trying to avoid the need to use the CGI object.
GET parameters you have to parse from ENV['QUERY_STRING'].
POST parameters you parse from standard input. It gets more complicated for multipart forms though.
CGI object provides you with exactly this functionality. I wonder does it make sense to implement CGI class as a native extension?
Cheers,
Kent.
On Nov 4, 2004, at 4:03 PM, J. D. wrote:
Hi,
How do I retrieve form parameters with FCGI in a way that works for both GET and POST?
I'm using FCGI.each{|request| ...} and trying to avoid the need to use the CGI object.
Kent Sibilev wrote:
GET parameters you have to parse from ENV['QUERY_STRING'].
POST parameters you parse from standard input. It gets more complicated for multipart forms though.CGI object provides you with exactly this functionality. I wonder does it make sense to implement CGI class as a native extension?
Cheers,
Kent.Hi,
How do I retrieve form parameters with FCGI in a way that works for both GET and POST?
I'm using FCGI.each{|request| ...} and trying to avoid the need to use the CGI object.
I see. So I guess, I'd have to do a $stdin = req.in and manually parse in order to handle POST requests using FCGI (if I want to avoid using CGI object).
On Nov 4, 2004, at 4:03 PM, J. D. wrote:
You might be able to hack something from bits of Narf. The parsing methods are in a module Web::Parser:
http://www.narf-lib.org/doc/classes/Web/Parser.html
Of course, if you like the Narf API you could just use that.
~ patrick
On Thursday, November 4, 2004, at 04:38 PM, J. D. wrote:
I see. So I guess, I'd have to do a $stdin = req.in and manually parse in order to handle POST requests using FCGI (if I want to avoid using CGI object).
Patrick May wrote:
I see. So I guess, I'd have to do a $stdin = req.in and manually parse in order to handle POST requests using FCGI (if I want to avoid using CGI object).
You might be able to hack something from bits of Narf. The parsing methods are in a module Web::Parser:
http://www.narf-lib.org/doc/classes/Web/Parser.html
Of course, if you like the Narf API you could just use that.
Nora supports CGI/mod_ruby/FastCGI.
http://raa.ruby-lang.org/project/nora/
interface is automatic detect.
some interface works not need chagne source code.
example:
#!/usr/bin/env ruby
require 'web'
api = Web::Interface::AUTO.new
api.each {|request|
response = Web::Response.new
api.response request, response
}
On Thursday, November 4, 2004, at 04:38 PM, J. D. wrote:
Hm, download link goes to nowhere.
Cheers,
Kent.
On Nov 5, 2004, at 8:14 AM, MoonWolf wrote:
Nora supports CGI/mod_ruby/FastCGI.
http://raa.ruby-lang.org/project/nora/
interface is automatic detect.
some interface works not need chagne source code.example:
#!/usr/bin/env ruby
require 'web'
api = Web::Interface::AUTO.new
api.each {|request|
response = Web::Response.new
api.response request, response
}
Quoting MoonWolf <moonwolf@moonwolf.com>:
Nora supports CGI/mod_ruby/FastCGI.
http://raa.ruby-lang.org/project/nora/
interface is automatic detect.
some interface works not need chagne source code.example:
#!/usr/bin/env ruby
require 'web'
api = Web::Interface::AUTO.new
api.each {|request|
response = Web::Response.new
api.response request, response
}
We should figure out a way to work together.
~ patrick
thanx
URL: http://www.moonwolf.com/ruby/archive/nora-0.0.20041021.tar.gz
Japanese tutorial is here:
http://jp.rubyist.net/magazine/?0001-NoraTutorial
http://jp.rubyist.net/magazine/?0002-NoraTutorial
J to E machine-translation link:
http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=ja_en&url=http://jp.rubyist.net/magazine/?0001-NoraTutorial
http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=ja_en&url=http://jp.rubyist.net/magazine/?0002-NoraTutorial
Kent Sibilev wrote:
Hm, download link goes to nowhere.
Cheers,
Kent.On Nov 5, 2004, at 8:14 AM, MoonWolf wrote:
Nora supports CGI/mod_ruby/FastCGI.
http://raa.ruby-lang.org/project/nora/
interface is automatic detect.
some interface works not need chagne source code.example:
#!/usr/bin/env ruby
require 'web'
api = Web::Interface::AUTO.new
api.each {|request|
response = Web::Response.new
api.response request, response
}
Patrick May ha scritto:
Quoting MoonWolf <moonwolf@moonwolf.com>:
Nora supports CGI/mod_ruby/FastCGI.
http://raa.ruby-lang.org/project/nora/
interface is automatic detect.
some interface works not need chagne source code.
<snip>
We should figure out a way to work together.
~ patrick
funny how things are the same in every place.. Did ruby web devs ever heard of python's WSGI ? It is an interface defined for web frameworks to access web engines (such as mod_*, cgi, fcgi and random webservers/containers).
A formal spec is here:
I think having such a thing for ruby would be reqly useful..
The actual interface layer between different engines is a small amount of code:
http://www.narf-lib.org/doc/classes/Web/CGD.html
On top of that, there's alot of functionality you can write. Sharing that more difficult b/c it is api, aka judgement call. Integrating Narf and Nora and all the other cgi replacements, then we'd have a php replacement.
I've integrated code from various other projects into Narf. If the developers from those projects like the direction of Narf, then I'd love to give them commit access.
I think that a rich, low-level web api would be a good thing. Integrating WebUnit, Nora, Narf, Amrita all together I think would be quite useful.
~ Patrick
On Friday, November 5, 2004, at 02:58 PM, gabriele renzi wrote:
funny how things are the same in every place.. Did ruby web devs ever heard of python's WSGI ? It is an interface defined for web frameworks to access web engines (such as mod_*, cgi, fcgi and random webservers/containers).
A formal spec is here:
PEP 333 – Python Web Server Gateway Interface v1.0 | peps.python.org
I think having such a thing for ruby would be reqly useful..
i thought i was the only one still using amrita! development seems to have
died on it, but i still find it's feature set the richest and the
code/template separation the cleanest of the engines i've tried.
what's your take on the current crop of template engines vs. amrita? i've
been out of web development for a bit but am starting a new project and trying
to make an assesment of the ruby tools out there.
kind regards.
-a
On Sun, 7 Nov 2004, Patrick May wrote:
I think that a rich, low-level web api would be a good thing. Integrating
WebUnit, Nora, Narf, Amrita all together I think would be quite useful.
EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
When you do something, you should burn yourself completely, like a good
bonfire, leaving no trace of yourself. --Shunryu Suzuki
===============================================================================
I still dig Amrita. So do the developer(s) of Cerise
(http://cerise.rubyforge.org/\), which looks good, and bases its
template engine on Amrita. Iowa
(http://enigo.com/projects/iowa/index.html\), while not based on
Amrita, has templates that are philosophically similar, by and large -
you don't often need to use invalid html to set the template up.
On Sun, 7 Nov 2004 02:23:40 +0900, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
On Sun, 7 Nov 2004, Patrick May wrote:
> I think that a rich, low-level web api would be a good thing. Integrating
> WebUnit, Nora, Narf, Amrita all together I think would be quite useful.i thought i was the only one still using amrita! development seems to have
died on it, but i still find it's feature set the richest and the
code/template separation the cleanest of the engines i've tried.what's your take on the current crop of template engines vs. amrita? i've
been out of web development for a bit but am starting a new project and trying
to make an assesment of the ruby tools out there.
--
David Naseby
http://homepages.ihug.com.au/~naseby/
i thought i was the only one still using amrita! development seems to have
died on it, but i still find it's feature set the richest and the
code/template separation the cleanest of the engines i've tried.
I agree. I keep my eyes open, but amrita is just so ... clean.
Cameron
i thought i was the only one still using amrita! development seems to have
died on it, but i still find it's feature set the richest and the
code/template separation the cleanest of the engines i've tried.
It appears that Amrita has new maintainers and that the site has moved
to here: http://amrita.sourceforge.jp/index.html
I too am pretty enamored with it. I especially like the parts template
addition, which I find to be quite powerful.
what's your take on the current crop of template engines vs. amrita? i've
been out of web development for a bit but am starting a new project and trying
to make an assesment of the ruby tools out there.
My biggest complaint with Amrita is that is its' performance.
Although, for my current needs that has not been too much of a
problem. I have tried to look into the other engines, but as soon as
start to see custom tags or erb/asp/jsp like syntax I tend to stop my
investigation. I guess I have spoiled myself with Amrita
Although, I could be swayed if some of the other template engines
have something like parts template.
Cheers,
Zev
On Sun, 7 Nov 2004 02:23:40 +0900, <Ara.T.Howard@noaa.gov> wrote:
i thought i was the only one still using amrita! development seems to
have
died on it, but i still find it's feature set the richest and the
code/template separation the cleanest of the engines i've tried.It appears that Amrita has new maintainers and that the site has moved
to here: http://amrita.sourceforge.jp/index.htmlI too am pretty enamored with it. I especially like the parts template
addition, which I find to be quite powerful.
cool - thanks for the pointer - i'd missed that.
what's your take on the current crop of template engines vs. amrita?
i've
been out of web development for a bit but am starting a new project and
trying
to make an assesment of the ruby tools out there.My biggest complaint with Amrita is that is its' performance. Although, for
my current needs that has not been too much of a problem. I have tried to
look into the other engines, but as soon as start to see custom tags or
erb/asp/jsp like syntax I tend to stop my investigation. I guess I have
spoiled myself with AmritaAlthough, I could be swayed if some of the
other template engines have something like parts template.
my thoughts too. i hate adding yet another markup to html. i haven't used
css too extensively, but i wonder if that's where the amriata paradigm would
fall down. using class and id (and possibly deleteing them) could confuse
things - but my limited usage suggested it was o.k.. i seem to recall there
was a setting that left the class/id attributes untouched. anyone else with
amrita/css experience?
regards.
-a
On Mon, 8 Nov 2004, Zev Blut wrote:
On Sun, 7 Nov 2004 02:23:40 +0900, <Ara.T.Howard@noaa.gov> wrote:
EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
When you do something, you should burn yourself completely, like a good
bonfire, leaving no trace of yourself. --Shunryu Suzuki
===============================================================================
Give XTemplate a spin -- with a little work to emulate hashes in your
objects, you can use arbitrary objects as data, as in Amrita, and it
works nicely and fast.
On Mon, 8 Nov 2004 18:24:22 +0900, Zev Blut <rubyzbibd@ubit.com> wrote:
On Sun, 7 Nov 2004 02:23:40 +0900, <Ara.T.Howard@noaa.gov> wrote:
> i thought i was the only one still using amrita! development seems to
> have
> died on it, but i still find it's feature set the richest and the
> code/template separation the cleanest of the engines i've tried.It appears that Amrita has new maintainers and that the site has moved
to here: http://amrita.sourceforge.jp/index.htmlI too am pretty enamored with it. I especially like the parts template
addition, which I find to be quite powerful.> what's your take on the current crop of template engines vs. amrita?
> i've
> been out of web development for a bit but am starting a new project and
> trying
> to make an assesment of the ruby tools out there.My biggest complaint with Amrita is that is its' performance.
Although, for my current needs that has not been too much of a
problem. I have tried to look into the other engines, but as soon as
start to see custom tags or erb/asp/jsp like syntax I tend to stop my
investigation. I guess I have spoiled myself with Amrita
Although, I could be swayed if some of the other template engines
have something like parts template.
I am make use of CSS and do not have any problems, of course I have
not tried to push the boundaries of CSS yet. There are a number
of settings in Amrita::Template that let you control how id is
handled.
If you do not like using id as the expansion point for amrita you can
define your own custom attribute with "amrita_id". My only problem with
this is that I do not know if Web tools will like/allow you to put in
new attributes.
Or you can use "escaped_id" to define a new attribute that will become
the id attribute expansion.
Or you can use "keep_id" to keep the expanded id for use afterwards.
If you run rdoc on amrita and look at Amrita::Template you will find
these attributes with some documentation about them.
Cheers,
Zev
On Mon, 8 Nov 2004 23:43:43 +0900, <Ara.T.Howard@noaa.gov> wrote:
my thoughts too. i hate adding yet another markup to html. i haven't used
css too extensively, but i wonder if that's where the amriata paradigm would
fall down. using class and id (and possibly deleteing them) could confuse
things - but my limited usage suggested it was o.k.. i seem to recall there
was a setting that left the class/id attributes untouched. anyone else with
amrita/css experience?
XTemplate seems pretty close to Amrita, but I really do not want to
have to make my objects emulate hashes. If I have to put that much
work into preparing my output, then I might as well stick the data I
want into hashes in the first place... Although, thanks for reminding
me of XTemplate! When I get the time I will try to look into it a bit
more. How much faster is it than Amrita?
Best,
Zev
On Tue, 9 Nov 2004 04:13:08 +0900, Aredridel <aredridel@gmail.com> wrote:
Give XTemplate a spin -- with a little work to emulate hashes in your
objects, you can use arbitrary objects as data, as in Amrita, and it
works nicely and fast
A fair bit, since it can use an XML parser. Not an order of magnitude,
but noticeably. Depends on what you do, of course.
On Tue, 9 Nov 2004 12:53:11 +0900, Zev Blut <rubyzbibd@ubit.com> wrote:
On Tue, 9 Nov 2004 04:13:08 +0900, Aredridel <aredridel@gmail.com> wrote:
> Give XTemplate a spin -- with a little work to emulate hashes in your
> objects, you can use arbitrary objects as data, as in Amrita, and it
> works nicely and fastXTemplate seems pretty close to Amrita, but I really do not want to
have to make my objects emulate hashes. If I have to put that much
work into preparing my output, then I might as well stick the data I
want into hashes in the first place... Although, thanks for reminding
me of XTemplate! When I get the time I will try to look into it a bit
more. How much faster is it than Amrita?
I've often heard Amrita is great but slow. I wonder if anyone is up to
translating the slow bits to c ?
T.
On Saturday 13 November 2004 01:00 am, Aredridel wrote:
On Tue, 9 Nov 2004 12:53:11 +0900, Zev Blut <rubyzbibd@ubit.com> wrote:
> On Tue, 9 Nov 2004 04:13:08 +0900, Aredridel <aredridel@gmail.com> wrote:
> > Give XTemplate a spin -- with a little work to emulate hashes in your
> > objects, you can use arbitrary objects as data, as in Amrita, and it
> > works nicely and fast
>
> XTemplate seems pretty close to Amrita, but I really do not want to
> have to make my objects emulate hashes. If I have to put that much
> work into preparing my output, then I might as well stick the data I
> want into hashes in the first place... Although, thanks for reminding
> me of XTemplate! When I get the time I will try to look into it a bit
> more. How much faster is it than Amrita?A fair bit, since it can use an XML parser. Not an order of magnitude,
but noticeably. Depends on what you do, of course.