Discussion:
[jifty-devel] how to "perl -wc" a Jifty Model
Mark Aufflick
2009-11-18 11:51:42 UTC
Permalink
Hi all,

playing with Jifty a bit more seriously than I have before but have a
problem with my workflow. I have my editor configured to do a compile test
(perl -wc) on any perl file when I save it. I find that saves me doing dumb
stuff like checking in code that doesn't even compile.

Problem with Jifty of course is all the runtime magic that doesn't seem to
happen in BEGIN blocks, and so never gets executed under -c.

Is there some sort of incantation that can achieve this? I'm imagining
something like "perl -MJifty=compiletest -wc MyModel.pm" or even jifty
--compiletest MyModel.pm that could cause the magic to happen at import()
time. Is there such a procedure?

I searched the mailing list, but all I found was a reference to a Jifty
console which would also be useful, but "jifty script" seems to do something
different these days.

Any info or tips appreciated!

Thanks,

Mark.
--
Mark Aufflick
contact info at http://mark.aufflick.com/about/contact
Jesse Vincent
2009-11-18 16:12:24 UTC
Permalink
Post by Mark Aufflick
Hi all,
playing with Jifty a bit more seriously than I have before but have a problem with my workflow. I have my
editor configured to do a compile test (perl -wc) on any perl file when I save it. I find that saves me
doing dumb stuff like checking in code that doesn't even compile.
Problem with Jifty of course is all the runtime magic that doesn't seem to happen in BEGIN blocks, and so
never gets executed under -c.
Is there some sort of incantation that can achieve this? I'm imagining something like "perl -MJifty=
compiletest -wc MyModel.pm" or even jifty --compiletest MyModel.pm that could cause the magic to happen
at import() time. Is there such a procedure?
I searched the mailing list, but all I found was a reference to a Jifty console which would also be
useful, but "jifty script" seems to do something different these days.
How's this work for you?

perl -wc -MJifty -e'Jifty->new' lib/RT/Model/Ticket.pm
-e syntax OK
Post by Mark Aufflick
Any info or tips appreciated!
Thanks,
Mark.
--
Mark Aufflick
contact info at http://mark.aufflick.com/about/contact
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
Mark Aufflick
2010-01-26 05:27:59 UTC
Permalink
Hi Jesse,

It's been a while, but I'm back on the Jifty trail again. Thanks for your
reply, but unfortunately the commandline you have given only does a compile
check on the -e string (you can try it on a blatantly bad perl file and you
still get ok).

I have, though, found a neat solution using your hint. Create a package
called, ignominiously, JiftyWC:

package JiftyWC;

use Jifty;

BEGIN { Jifty->new }

1;

you can then:

perl -MJiftyWC -wc lib/App/Model/Foo.pm

with the desired result.

Cheers,

Mark.
Post by Mark Aufflick
Post by Mark Aufflick
Hi all,
playing with Jifty a bit more seriously than I have before but have a
problem with my workflow. I have my
Post by Mark Aufflick
editor configured to do a compile test (perl -wc) on any perl file when I
save it. I find that saves me
Post by Mark Aufflick
doing dumb stuff like checking in code that doesn't even compile.
Problem with Jifty of course is all the runtime magic that doesn't seem
to happen in BEGIN blocks, and so
Post by Mark Aufflick
never gets executed under -c.
Is there some sort of incantation that can achieve this? I'm imagining
something like "perl -MJifty=
Post by Mark Aufflick
compiletest -wc MyModel.pm" or even jifty --compiletest MyModel.pm that
could cause the magic to happen
Post by Mark Aufflick
at import() time. Is there such a procedure?
I searched the mailing list, but all I found was a reference to a Jifty
console which would also be
Post by Mark Aufflick
useful, but "jifty script" seems to do something different these days.
How's this work for you?
perl -wc -MJifty -e'Jifty->new' lib/RT/Model/Ticket.pm
-e syntax OK
Post by Mark Aufflick
Any info or tips appreciated!
Thanks,
Mark.
--
Mark Aufflick
contact info at http://mark.aufflick.com/about/contact
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
--
Mark Aufflick
contact info at http://pumptheory.com/about

http://pumptheory.com
iPhone and Enterprise software development
Jesse Vincent
2010-01-28 21:45:21 UTC
Permalink
Post by Mark Aufflick
Hi Jesse,
It's been a while, but I'm back on the Jifty trail again. Thanks for your
reply, but unfortunately the commandline you have given only does a compile
check on the -e string (you can try it on a blatantly bad perl file and you
still get ok).
My adminttedly hazy recollection is that this is just what 'jifty env'
does.

-Jesse
Post by Mark Aufflick
I have, though, found a neat solution using your hint. Create a package
package JiftyWC;
use Jifty;
BEGIN { Jifty->new }
1;
perl -MJiftyWC -wc lib/App/Model/Foo.pm
with the desired result.
Cheers,
Mark.
Post by Mark Aufflick
Post by Mark Aufflick
Hi all,
playing with Jifty a bit more seriously than I have before but have a
problem with my workflow. I have my
Post by Mark Aufflick
editor configured to do a compile test (perl -wc) on any perl file when I
save it. I find that saves me
Post by Mark Aufflick
doing dumb stuff like checking in code that doesn't even compile.
Problem with Jifty of course is all the runtime magic that doesn't seem
to happen in BEGIN blocks, and so
Post by Mark Aufflick
never gets executed under -c.
Is there some sort of incantation that can achieve this? I'm imagining
something like "perl -MJifty=
Post by Mark Aufflick
compiletest -wc MyModel.pm" or even jifty --compiletest MyModel.pm that
could cause the magic to happen
Post by Mark Aufflick
at import() time. Is there such a procedure?
I searched the mailing list, but all I found was a reference to a Jifty
console which would also be
Post by Mark Aufflick
useful, but "jifty script" seems to do something different these days.
How's this work for you?
perl -wc -MJifty -e'Jifty->new' lib/RT/Model/Ticket.pm
-e syntax OK
Post by Mark Aufflick
Any info or tips appreciated!
Thanks,
Mark.
--
Mark Aufflick
contact info at http://mark.aufflick.com/about/contact
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
--
Mark Aufflick
contact info at http://pumptheory.com/about
http://pumptheory.com
iPhone and Enterprise software development
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
--

Loading...