Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Interchange: users

Interchange::Link changes - submitted for your approval

 

 

Interchange users RSS feed   Index | Next | Previous | View Threaded


emailgrant at gmail

Aug 21, 2009, 5:42 PM

Post #1 of 6 (1001 views)
Permalink
Interchange::Link changes - submitted for your approval

I've made a couple changes to the Interchange::Link module which I
think have general applicability. I've added a config option which
removes all blank lines from the HTML output and changed the "IC is
not running" message to be a little more user-friendly, although not
as useful for debugging. I've left the debugging variables in, just
commented. The patch is very simple.

- Grant
Attachments: patch.txt (1.19 KB)


jon at endpoint

Aug 22, 2009, 9:01 AM

Post #2 of 6 (939 views)
Permalink
Re: Interchange::Link changes - submitted for your approval [In reply to]

On Fri, 21 Aug 2009, Grant wrote:

> I've made a couple changes to the Interchange::Link module which I think
> have general applicability. I've added a config option which removes
> all blank lines from the HTML output and changed the "IC is not running"
> message to be a little more user-friendly, although not as useful for
> debugging. I've left the debugging variables in, just commented. The
> patch is very simple.

The extra block and method call for every single line of output will slow
things down a little. You could mitigate that like this:

$r->content_type($set_content);
$skip_blank_lines = $r->dir_config('NoBlankLines');
while (<SOCK>) {
push @out, $_ unless $skip_blank_lines and ! /\S/;
}

Can you confirm that that still works?

Thanks,
Jon

--
Jon Jensen
End Point Corporation
http://www.endpoint.com/

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


jon at endpoint

Aug 22, 2009, 9:11 AM

Post #3 of 6 (946 views)
Permalink
Re: Interchange::Link changes - submitted for your approval [In reply to]

On Sat, 22 Aug 2009, Jon Jensen wrote:

> $r->content_type($set_content);
> $skip_blank_lines = $r->dir_config('NoBlankLines');
> while (<SOCK>) {
> push @out, $_ unless $skip_blank_lines and ! /\S/;
> }

Well, it was silly to use a slightly different name, and I see I didn't
declare the variable first. How about:

$r->content_type($set_content);
my $no_blank_lines = $r->dir_config('NoBlankLines');
while (<SOCK>) {
push @out, $_ unless $no_blank_lines and ! /\S/;
}

Jon

--
Jon Jensen
End Point Corporation
http://www.endpoint.com/
Software development with Interchange, Perl, PostgreSQL, Apache, Linux, ...

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


emailgrant at gmail

Aug 22, 2009, 2:58 PM

Post #4 of 6 (921 views)
Permalink
Re: Interchange::Link changes - submitted for your approval [In reply to]

>>    $r->content_type($set_content);
>>    $skip_blank_lines = $r->dir_config('NoBlankLines');
>>    while (<SOCK>) {
>>        push @out, $_ unless $skip_blank_lines and ! /\S/;
>>    }
>
> Well, it was silly to use a slightly different name, and I see I didn't
> declare the variable first. How about:
>
>     $r->content_type($set_content);
>     my $no_blank_lines = $r->dir_config('NoBlankLines');
>     while (<SOCK>) {
>         push @out, $_ unless $no_blank_lines and ! /\S/;
>     }
>
> Jon

Still works great, thank you for the correction.

- Grant

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


jon at endpoint

Aug 22, 2009, 3:24 PM

Post #5 of 6 (937 views)
Permalink
Re: Interchange::Link changes - submitted for your approval [In reply to]

On Sat, 22 Aug 2009, Grant wrote:

> Still works great, thank you for the correction.

Thanks. Would you mind downloading the whole file and testing in your
environment again? There was some bogus whitespace in the indenting
originally, and it'd be good to make sure it works correctly:

http://git.icdevgroup.org/?p=interchange.git;a=blob_plain;f=dist/src/mod_perl2/Interchange/Link.pm;hb=0501ff1b4cdee9dfa661b8ff0e7099f41f8836b3

Also I added back a <title> to the HTML.

Thanks,
Jon

--
Jon Jensen
End Point Corporation
http://www.endpoint.com/

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


emailgrant at gmail

Aug 22, 2009, 9:15 PM

Post #6 of 6 (926 views)
Permalink
Re: Interchange::Link changes - submitted for your approval [In reply to]

>> Still works great, thank you for the correction.
>
> Thanks. Would you mind downloading the whole file and testing in your
> environment again? There was some bogus whitespace in the indenting
> originally, and it'd be good to make sure it works correctly:
>
> http://git.icdevgroup.org/?p=interchange.git;a=blob_plain;f=dist/src/mod_perl2/Interchange/Link.pm;hb=0501ff1b4cdee9dfa661b8ff0e7099f41f8836b3
>
> Also I added back a <title> to the HTML.
>
> Thanks,
> Jon

Still working perfectly. I'd be happy to test any other changes.

- Grant

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users

Interchange users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.