[jifty-devel] need help with command-line scripting

Andrew Hanenkamp sterling at hanenkamp.com
Mon Jan 7 09:38:35 EST 2008


Since I wondered this for awhile myself and since this one has a formulaic
answer, I've added a new script so you can now just run:

bin/jifty script -n my-fancy-cli

and it will add "my-fancy-cli" to you bin directory with everything you need
to get started with a command-line tool to do some server-side tweaking of
your Jifty app.

Cheers,
Andrew

On 1/7/08, Shawn M Moore <sartak at bestpractical.com> wrote:
>
> On Sat, Jan 05, 2008 at 05:21:50AM -0800, Stanislav Sinyagin wrote:
> > hi all,
> >
> > a long-time RT user, I tried to utilize SearchBuilder
> > for my new project, and finally I found Jifty - which looks very
> promising.
>
> Yeah, Jifty takes everything RT's framework did and cranks the notch
> from six to ten. :)
>
> > use warnings;
> > use strict;
> > use File::Basename qw(dirname);
> > use UNIVERSAL::require;
> >
> > use Jifty;
> >
> > my $devclass = Jifty->app_class('Model', 'Device');
> >
> > my $device = $devclass->new();
> >
> > $device->create(hostname => 'aaa',
> >                 ipv4addr => '10.0.0.1');
> >
> >
> > $device->set_property('snmp-community', 'aaabbb');
> > ================
> >
> > This code results in
> > Can't locate object method "new" via package "Toponet::Model::Device"
> > (perhaps you forgot to load "Toponet::Model::Device"?) at bin/test.pl
> line 12.
>
> If you replace:
>
>     use Jifty;
>
> with:
>
>     use Jifty::Everything;
>     BEGIN { Jifty->new }
>
> it should work. I'm not sure if Jifty->new is required to be in a BEGIN
> block, but it's how I use it.
>
> > thanks,
> > stan
>
> Shawn
>
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20080107/ad81b2d4/attachment.htm


More information about the jifty-devel mailing list