Re: http_referrer

2012-04-17 Thread Dave Everitt
Hi cdr - thanks for this, but I've not been able to do key value on the Rack envs as some seem to have a different format - see the other post I added to this thread - DaveE how Rack env vars are stored, and how to get a nice printout? i defined #to_html on everything. on Array thats map(&

Re: http_referrer

2012-04-17 Thread Dave Everitt
Just to be clear (obviously env vars are going to differ according to setup, but): when env is used inside Camping, it's equivalent to @env and get Rack env vars when ENV is used, it will get any other environment variables, not just from Passenger etc. but also any set by the system. W

Re: http_referrer

2012-04-16 Thread Nokan Emiro
2012/4/16 Bartosz Dziewoński > You do realize that there exists an annotated version of source, with > comments, proper indentation and (whoa!) some whitespace? > https://github.com/camping/camping/blob/master/lib/camping-unabridged.rb > > No, actually I did know that there's an indented version,

Re: http_referrer

2012-04-16 Thread Philippe Monnet
I think Nokan has a good point there: it is not easy for people new to Camping to know about the trick to compile/process/compact the source code. So an idea for the "new" version could be to leave the source as is (unabridged). Plus this makes debugging easier. :-) On 4/16/2012 2:59 PM, Bartos

Re: http_referrer

2012-04-16 Thread david costa
Well the point of the original camping was *not* to be easy to read nor to have camping used in the next big commercial project. The annotated version gives you pretty much all you want if you want to read it :) On Mon, Apr 16, 2012 at 10:59 PM, Bartosz Dziewoński wrote: > W dniu 16 kwietnia 20

Re: http_referrer

2012-04-16 Thread Bartosz Dziewoński
W dniu 16 kwietnia 2012 22:45 użytkownik Nokan Emiro napisał: > I'm totally convinced...  so I'm going to download the whole source > before the guys start to rewrite it as a "modern framework"... :) > > But to be frank, this, for instance, is not so great to read: > https://github.com/camping/cam

Re: http_referrer

2012-04-16 Thread Nokan Emiro
I'm totally convinced... so I'm going to download the whole source before the guys start to rewrite it as a "modern framework"... :) But to be frank, this, for instance, is not so great to read: https://github.com/camping/camping/blob/master/lib/camping.rb I mean I'm big http://catseye.tc/ fan,

Re: http_referrer

2012-04-16 Thread Philippe Monnet
Everything I actually learned about Camping was by reading the source code as it is quite a feat of engineering. And I learned a ton about metaprogramming too. So it can be quite interesting. :-) On 4/16/2012 12:41 PM, Nokan Emiro wrote: > Actually env[] works with mongrel also, not just

Re: http_referrer

2012-04-16 Thread Nokan Emiro
> > > Actually env[] works with mongrel also, not just fcgi or passenger. > > (No, it's not a typo: env, and not ENV. But I'm sure ENV works too.) > > Yes, env inside Camping is the same @env (it's just an attr_accessor). > Same for @body, @request, @method, @status etc: > > https://github.com/camp

Re: http_referrer

2012-04-16 Thread Magnus Holm
On Mon, Apr 16, 2012 at 13:45, Nokan Emiro wrote: > Actually env[] works with mongrel also, not just fcgi or passenger. > (No, it's not a typo: env, and not ENV. But I'm sure ENV works too.) Yes, env inside Camping is the same @env (it's just an attr_accessor). Same for @body, @request, @method,

Re: http_referrer

2012-04-16 Thread Nokan Emiro
Actually env[] works with mongrel also, not just fcgi or passenger. (No, it's not a typo: env, and not ENV. But I'm sure ENV works too.) On Sun, Apr 15, 2012 at 12:37 PM, Magnus Holm wrote: > > > The only reason ENV['HTTP_REFERER'] works for you is that you deploy > on (Fast)CGI. You should only

Re: http_referrer

2012-04-15 Thread david costa
sure I was just explaining that was not fcgi :) BTW I am making some good progress with the on the fly deployment. I have found an apparently good security solution to allow users to deploy their app without major problems and at the same time not compromise other users/the server. More testing thi

Re: http_referrer

2012-04-15 Thread Jenna Fox
O_o I think the extra character is worth it. — Jenna On Monday, 16 April 2012 at 9:40 AM, david costa wrote: > Ah well the is not on fcgi but passenger :) > I would say that most of the serious ruby/rails hosting now offer passenger > as an option so shouldn't limit your application porta

Re: http_referrer

2012-04-15 Thread david costa
Ah well the is not on fcgi but passenger :) I would say that most of the serious ruby/rails hosting now offer passenger as an option so shouldn't limit your application portability. On Sun, Apr 15, 2012 at 11:41 PM, Dave Everitt wrote: > Understood about compatible - this is David's Camping serve

Re: http_referrer

2012-04-15 Thread Dave Everitt
Understood about compatible - this is David's Camping server, and I'm experimenting with QUERY_STRING in the URL and various other env vars - DaveE On Sat, Apr 14, 2012 at 10:38, Dave Everitt wrote: Haha! How did you get Spock on board... :-) I must admit I'm a little confused about the

Re: http_referrer

2012-04-15 Thread Magnus Holm
On Sat, Apr 14, 2012 at 10:38, Dave Everitt wrote: > Haha! How did you get Spock on board... :-) > > I must admit I'm a little confused about the sytnax for environmental > variables, because as well as >   @env[HTTP_REFERER] > this also works: >   ENV['SCRIPT_NAME'] > > For a test I just used it

Re: http_referrer

2012-04-14 Thread cdr
how Rack env vars are stored, and how to get a nice printout? i defined #to_html on everything. on Array thats map(&:html).join ', ' on Hash it prints a , Object is html_escape(to_s) Rack just iterates thru env in an ERB template: Rack ENV Variable

Re: http_referrer

2012-04-14 Thread Dave Everitt
About environment variables - I've just used this in my Camping helpers to print them all out, but the Rack variables seem to have multiple values or values with no name: def envars(theenv) if theenv == "ENV" ul do theenv.each_pair do |name,value| li { name + " " + value }

Re: http_referrer

2012-04-14 Thread Dave Everitt
Haha! How did you get Spock on board... :-) I must admit I'm a little confused about the sytnax for environmental variables, because as well as @env[HTTP_REFERER] this also works: ENV['SCRIPT_NAME'] For a test I just used it like this: ENV['SCRIPT_NAME'].scan(/\w+\.\w+$/) to get the Cam

Re: http_referrer

2012-04-08 Thread Nokan Emiro
Starship Enterprise, Stardate #{Time.now.to_f}. Captain's Log. network.http.sendrefererheader was set to 0 in my Firefox for unknown reasons. Probably Mr Spock, the Chief of security did this. I make this log entry for those who don't want to spend hours in a spacedock repairing a working applicati

Re: http_referrer

2012-04-07 Thread Nokan Emiro
Why does it work without the @ for me? On Fri, Apr 6, 2012 at 4:26 PM, Magnus Holm wrote: > It should be in @env: > > @env['HTTP_REFERER'] > > (Note that it's misspelled in the spec) > > ___ Camping-list mailing list Camping-list@rubyforge.org http:/

Re: http_referrer

2012-04-06 Thread Magnus Holm
It should be in @env: @env['HTTP_REFERER'] (Note that it's misspelled in the spec) // Magnus Holm On Friday 6. April 2012 at 15:01, Nokan Emiro wrote: > Hi, > > How can I access the Rack request object in a controller? I need > to know the HTTP_REFERRER, but I

Re: http_referrer

2012-04-06 Thread Magnus Holm
On Fri, Apr 6, 2012 at 3:01 PM, Nokan Emiro (mailto:uzleep...@gmail.com)> wrote: > > Hi, > > > > How can I access the Rack request object in a controller? I need > > to know the HTTP_REFERRER, but I ca

Re: http_referrer

2012-04-06 Thread Nokan Emiro
roller? I need > to know the HTTP_REFERRER, but I can't find it in env. (I'm > sure I need glasses, or have to sleep more...) > > ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list

http_referrer

2012-04-06 Thread Nokan Emiro
Hi, How can I access the Rack request object in a controller? I need to know the HTTP_REFERRER, but I can't find it in env. (I'm sure I need glasses, or have to sleep more...) ___ Camping-list mailing list Camping-list@rubyforg