[Catalyst] Chart::Graph::Gnuplot trouble.

2008-03-16 Thread Mojo Nichols
I am unable to get this package to work in Catalyst, despite it working 
outside of catalyst.  I'm at a loss of where to go with it next.


My output:

[EMAIL PROTECTED]:~/catalyst/test$ ./script/test_server.pl -r -f -k
[debug] Debug messages enabled
[debug] Statistics enabled
[debug] Loaded plugins:
..
| Catalyst::Plugin::ConfigLoader  
0.14   |
| Catalyst::Plugin::Static::Simple  
0.17 |

''

[debug] Loaded dispatcher "Catalyst::Dispatcher"
[debug] Loaded engine "Catalyst::Engine::HTTP::Restarter"
[debug] Found home "/home/mnichols/catalyst/test"
[debug] Loaded Config "/home/mnichols/catalyst/test/test.yml"
[debug] Loaded components:
.-+--.
| Class   | 
Type |

+-+--+
| test::Controller::Root  | 
instance |

'-+--'

[debug] Loaded Private actions:
.--+--+--.
| Private  | Class| 
Method   |

+--+--+--+
| /default | test::Controller::Root   | 
default  |
| /end | test::Controller::Root   | 
end  |
| /plot| test::Controller::Root   | 
plot |

'--+--+--'

[debug] Loaded Path actions:
.-+--.
| Path| 
Private  |

+-+--+
| /plot   | 
/plot|

'-+--'

[info] test powered by Catalyst 5.7012
You can connect to your server at http://trillian:3000
exit value = 16777215
signal number = 127
dumped core = 128
at /usr/local/share/perl/5.8.8/Chart/Graph/Gnuplot.pm line 768
[info] *** Request 1 (0.143/s) [13684] [Sun Mar 16 22:16:47 2008] ***
[debug] "GET" request for "plot" from "127.0.0.1"
[debug] Path is "plot"
[info] Request took 0.035527s (28.148/s)
.+---.
| Action | 
Time  |

++---+
| /plot  | 
0.024378s |
| /end   | 
0.000708s |

'+---'



The controller:

package test::Controller::Root;

use strict;
use warnings;
use Chart::Graph::Gnuplot (qw/gnuplot/);
use base 'Catalyst::Controller';

#
# Sets the actions in this controller to be registered with no prefix
# so they function identically to actions created in MyApp.pm
#
__PACKAGE__->config->{namespace} = '';

=head1 NAME

test::Controller::Root - Root Controller for test

=head1 DESCRIPTION

[enter your description here]

=head1 METHODS

=cut

=head2 default

=cut
sub plot : Local {
 my ( $self, $c ) = @_;
 gnuplot({'title' => 'foo',
   'x2-axis label' => 'bar',
   'logscale x2' => '1',
   'logscale y' => '1',
   'output type' => 'png',
  'output file' =>'/tmp/try.png',
  'xtics' => [ ['small\nfoo', 10], ['medium\nfoo', 20], 
['large\nfoo', 30] ],

   'ytics' => [10,20,30,40,50],
   'extra_opts' => 'set key left top Left'},
  [{'title' => 'data1',
'type' => 'matrix'}, [[1, 10],
 [2, 20],
  [3, 30]] ],
  [{'title' => 'data2',
'style' => 'lines',
'type' => 'columns'},
   [8, 26, 50, 60, 70],
   [5, 28, 50, 60, 70] ]
 );

 $c->response->body("Test plot");
}

sub default : Private {
   my ( $self, $c ) = @_;

   # Hello World
   $c->response->body( $c->welcome_message );
}

=head2 end

Attempt to render a view, if needed.

=cut

sub end : ActionClass('RenderView') {}

=head1 AUTHOR

Mojo Nichols,,,

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;


An example perl script that demonstrats that the above function should work:

#!/usr/bin/perl

use strict;
use warnings;
use Chart::Graph::Gnuplot (qw/gnuplot/);
use base 'Catalyst::Controller';


gnuplot({'title' => 'foo',
  'x2-axis label'

[Catalyst] Catalyst::Controller::REST and JSON::XS - Namespace/Custom modules

2008-03-16 Thread Simon Zmijanow

Hello list,

Started last month with Catalyst and got fascinated with all the nice 
things one can do with it.


But now got a little question and hope it is not too stupid :-)

I must admit, I don't have a clue how to cleanly load my custom 
module/class into the frameworks namespace (anywhere, not only into the 
Schema part)


I'm using Catalyst::Controller::REST in my application and want to use 
JSON::XS serializer instead of default JSON::Syck (By the way, why is 
Syck still default x-json serializer - even the comment in Syck advises 
us to change to more reliable XS)


So I copied the two JSON wrappers from Action directory into my 
application dir, modified them to use JSON::XS and renamed them into 
JSONXS. The Catalyst::Controller::REST got config option map 'JSONXS'. 
Now I should tell somehow catalyst to use my new classes, to load them 
from my application dir, maybe the way similar like the DBIC Schema 
Class by calling load_classes(). Is there trivial or documented way to 
accomplish this within other part of catalyst i.e. Controller?


For now I added my new JSONXS wrappers into Action subdirs of catalyst 
root, but I regard it more as temporary hack then good solution for 
custom serializer.


cu

-=-=-=-=-=-=oO:>
simon zmijanow

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can I install the catalyst manual from cpan?

2008-03-16 Thread J. Shirley
On Sun, Mar 16, 2008 at 7:03 AM, Ali M. <[EMAIL PROTECTED]> wrote:
> Well, I downloaded Catalyst (on windows of course) using the using the
>  cat-install script.
>  So apparently the script did sucessfully install the latest Catalyst::Runtime
>
>  But it only installed few pod documents Catalyst::Manual,
>  Catalyst::Manual::About and Catalyst::Manual::Installation
>
>  I want the Intro and tutorial pages hopefully in html format too, what
>  can I do?
>
>

Hey Ali,

Your best bet is to download the tarball from CPAN and install it
manually: 
http://search.cpan.org/CPAN/authors/id/J/JR/JROCKWAY/Catalyst-Manual-5.701003.tar.gz

I'm not sure what the problem is, but something changed in the
Catalyst-Manual package that caused it to no longer be able to be
installed via CPAN.  Hopefully this gets fixed soon, as it's rather
frustrating for users.

Also, you can use my interim static doc browser system I'm working
with at http://catsite.toeat.com/docs/Catalyst-Manual-Intro.html

Hope this helps.

-Jay

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can I install the catalyst manual from cpan?

2008-03-16 Thread Ali M.
Well, I downloaded Catalyst (on windows of course) using the using the
cat-install script.
So apparently the script did sucessfully install the latest Catalyst::Runtime

But it only installed few pod documents Catalyst::Manual,
Catalyst::Manual::About and Catalyst::Manual::Installation

I want the Intro and tutorial pages hopefully in html format too, what
can I do?

On Sun, Mar 16, 2008 at 1:25 PM, Chisel Wright <[EMAIL PROTECTED]> wrote:
> On Sun, Mar 16, 2008 at 11:09:12AM +, Chisel Wright wrote:
> > The manuals are part of the runtime distribution:
> >
> > http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7012/lib/Catalyst/Manual.pm
>
>
> On a related note, I just upgraded Catalyst::Devel and saw:
>
>  Warning: prerequisite Catalyst::Manual 5.7000 not found.
>
> Presumably because the manual module has no version:
>
>  [EMAIL PROTECTED]:~$ grep -i VERSION `perldoc -l Catalyst::Manual`
>  [EMAIL PROTECTED]:~$
>
> It also doesn't return a true value - I'm not sure what the deal it with
> POD-only modules and "1;", but I'm sure it can't hurt to have it there,
> can it?
>
> --
> Chisel Wright
> e: [EMAIL PROTECTED]
> w: http://www.herlpacker.co.uk/
>
>  Sorry isn't an excuse when you do something stupid on purpose.
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can I install the catalyst manual from cpan?

2008-03-16 Thread Chisel Wright
On Sun, Mar 16, 2008 at 11:09:12AM +, Chisel Wright wrote:
> The manuals are part of the runtime distribution:
> 
> http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7012/lib/Catalyst/Manual.pm


On a related note, I just upgraded Catalyst::Devel and saw:

  Warning: prerequisite Catalyst::Manual 5.7000 not found.

Presumably because the manual module has no version:

  [EMAIL PROTECTED]:~$ grep -i VERSION `perldoc -l Catalyst::Manual`
  [EMAIL PROTECTED]:~$ 

It also doesn't return a true value - I'm not sure what the deal it with
POD-only modules and "1;", but I'm sure it can't hurt to have it there,
can it?

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Sorry isn't an excuse when you do something stupid on purpose.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Can I install the catalyst manual from cpan?

2008-03-16 Thread Chisel Wright
On Sun, Mar 16, 2008 at 12:55:46PM +0200, Ali M. wrote:
> If yes how?
> 
> I just recently started using the Strawberry Perl distribution, so I
> am new to CPAN too!

The manuals are part of the runtime distribution:

http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7012/lib/Catalyst/Manual.pm

If you install Catalyst::Runtime you should find that you have the
manuals.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Flip Flops, Buy 2 Get 1 Free!

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Can I install the catalyst manual from cpan?

2008-03-16 Thread Ali M.
If yes how?

I just recently started using the Strawberry Perl distribution, so I
am new to CPAN too!

I tried "Catalyst::Manual" and "Catalayst-Manual"  but I get

-
...
Warning: Cannot install Catalyst-Manual, don't know what it is.
Try the command

i /Catalyst-Manual/

to find objects with matching identifiers.



Of course   i /Catalyst-Manual/ finds nothing!

I want to be able to browse the docs offline, so I don't insist on
downloading the docs from cpan, if anyone have an html of pdf download
for the docs, it will do

:)
thank you

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/