Acme-MetaSyntactic
view release on metacpan or search on metacpan
lib/Test/MetaSyntactic.pm view on Meta::CPAN
#
# t/01load.t
# t/51useall.t
sub subtest_load {
my ($theme) = @_;
my $tb = __PACKAGE__->builder;
$tb->plan( tests => 2 );
# load in the current process
my ( $pkg, $error ) = _load( $theme, 1 );
$tb->ok( !$error, "use Acme::MetaSyntactic::$theme;" );
$tb->diag($error) if $error;
# load in isolation
local $ENV{PERL5LIB} = join $Config::Config{path_sep} || ';', @INC;
`$^X -MAcme::MetaSyntactic::$theme -e1`;
$tb->is_eq( $? >> 8, 0, "perl -MAcme::MetaSyntactic::$theme -e1" );
}
lib/Test/MetaSyntactic.pm view on Meta::CPAN
=head2 subtest_encoding( $theme, $source )
Checks that the theme source files contains an C<=encoding> line if
it contains some non us-ascii characters.
=head2 subtest_load( $theme )
Tries to load the theme module.
First in the currently running process, and then in isolation inside
its own environment.
=head2 subtest_version( $theme )
Checks that the theme has a C<$VERSION>.
=head2 subtest_format( $theme )
Checks that each metasyntactic name in the theme is a valid Perl
variable name.
script/meta view on Meta::CPAN
"meta, a simple front-end to Acme::MetaSyntactic version $Acme::MetaSyntactic::VERSION\n"
if $conf{version};
print STDERR $usage if $conf{help};
print map "$_\n", Acme::MetaSyntactic->themes if $conf{themes};
if ( $conf{sources} ) {
my @sources = $module->sources( $conf{category} );
print map "$_\n", @sources;
}
exit if $conf{themes} || $conf{version} || $conf{help} || $conf{sources};
# real processing starts here
$\ = $/;
my $sep = $conf{whitespace} ? ' ' : $\;
my $meta = Acme::MetaSyntactic->new( $theme, category => $conf{category} );
my (@remote, @local);
@remote = $module->remote_list( $conf{category} )
if $conf{remote} || $conf{check};
if ( !$conf{remote} ) {
my $count = shift;
script/metafy view on Meta::CPAN
}
# informative options
print STDERR
"metafy your files, using Acme::MetaSyntactic version $Acme::MetaSyntactic::VERSION\n"
if $conf{version};
print STDERR $usage if $conf{help};
print map "$_\n", Acme::MetaSyntactic->themes if $conf{themes};
exit if $conf{themes} || $conf{version} || $conf{help};
# real processing starts here
my $from =
Acme::MetaSyntactic->new( $conf{from}, category => $conf{from_category} );
my $to = Acme::MetaSyntactic->new( $conf{to}, category => $conf{to_category} );
my @to = $to->name(0);
my %to;
# find the origin list
my $re_from = qr/\b(@{[join'|', sort $from->name( 0 ) ]})\b/;
# modify files in place
( run in 0.330 second using v1.01-cache-2.11-cpan-8d75d55dd25 )