[cgiapp] telecommute CGI::App job posted

2012-10-16 Thread Mark Stosberg

The company I co-founded has posted a job opening for a Perl/JavaScript
contract developer. Telecommute applications are welcome:

http://www.summersault.com/about/careers/position-perl-javascript-developer/

The position could include helping us update the project to incorporate
more PSGI and Moose into the website, among other things.

We also have a test suite with close to 20,000 tests which we are
constantly working on improving. As the project uses more JavaScript
now, we are also using more functional testing using Selenium as well.

If you are interested, details for following through are available
through the link above.

Thanks,

Mark

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Moving to PSGI: Issues with $ENV

2012-10-16 Thread Mark Stosberg
On 10/15/2012 08:42 AM, Mike Tonks wrote:
 Another issue that has come up along the way is using $ENV
 
 While this is fine under apache it doesn't seem to work with PSGI.

You are correct that PSGI uses $env, not %ENV.

 A common occurence is using $ENV{REMOTE_ADDR} for a user IP Address,
 but this is easily solved by using $self-query-remote_addr which
 does the right thing in both environments.

Right, a good choice.

 However today I stumbled across an issue with
 CGI::Application::Plugin::DetectAjax
 
   my $header = 'HTTP_X_REQUESTED_WITH';
 
   if (exists $ENV{$header}  lc $ENV{$header} eq 'xmlhttprequest') {
 return 1;
   }
   else {
 return 0;
   }
 
 This does not work under PSGI.
 
 Looking at CGI::PSGI the correct approach seems to be:
 
 $self-env-{$header}
 
 so a possible patch would look something like:
 
   my $header = 'HTTP_X_REQUESTED_WITH';
 
   my $header_value = $self-{__IS_PSGI} ? $self-env-{$header} : 
 $ENV{$header};
 
   if ($header_value  lc $header_value eq 'xmlhttprequest') {
 return 1;
   }
   else {
 return 0;
   }
 
 Can anyone help / confirm / improve on this?

If you want to use the plugin un-modified, I think you can do this:

{
   local *ENV = $env;
   $self-is_ajax;
}


  Mark

#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] telecommute CGI::App job posted

2012-10-16 Thread Lyle
tbh, the job looks nice, but the pay is a bit low for contracting.


Lyle

On 16/10/2012 15:36, Mark Stosberg wrote:
 The company I co-founded has posted a job opening for a Perl/JavaScript
 contract developer. Telecommute applications are welcome:

 http://www.summersault.com/about/careers/position-perl-javascript-developer/

 The position could include helping us update the project to incorporate
 more PSGI and Moose into the website, among other things.

 We also have a test suite with close to 20,000 tests which we are
 constantly working on improving. As the project uses more JavaScript
 now, we are also using more functional testing using Selenium as well.

 If you are interested, details for following through are available
 through the link above.

 Thanks,

  Mark

 #  CGI::Application community mailing list  
 ####
 ##  To unsubscribe, or change your message delivery options,  ##
 ##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
 ####
 ##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
 ##  Wiki:  http://cgiapp.erlbaum.net/ ##
 ####
 




#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####




Re: [cgiapp] Moving to PSGI: Issues with $ENV

2012-10-16 Thread Jiří Pavlovský
On 16.10.2012 17:14, Mark Stosberg wrote:
 However today I stumbled across an issue with
 CGI::Application::Plugin::DetectAjax

my $header = 'HTTP_X_REQUESTED_WITH';

if (exists $ENV{$header}  lc $ENV{$header} eq 'xmlhttprequest') {
  return 1;
}
else {
  return 0;
}

 This does not work under PSGI.

 Looking at CGI::PSGI the correct approach seems to be:

 $self-env-{$header}

 so a possible patch would look something like:

my $header = 'HTTP_X_REQUESTED_WITH';

my $header_value = $self-{__IS_PSGI} ? $self-env-{$header} : 
 $ENV{$header};

if ($header_value  lc $header_value eq 'xmlhttprequest') {
  return 1;
}
else {
  return 0;
}

 Can anyone help / confirm / improve on this?

Hi,

I'm a humble author of this humble plugin. If you have a patch, please 
send it to me.


Thanks,
Jiri


-- 
Jiří Pavlovský


#  CGI::Application community mailing list  
####
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp##
####
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:  http://cgiapp.erlbaum.net/ ##
####