Acme-MetaSyntactic

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

you have.  You must make sure that they, too, receive or can get the
source code.  And you must tell them their rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  The precise terms and conditions for copying, distribution and
modification follow.

                    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be

LICENSE  view on Meta::CPAN

the Program under this License.  However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.

  5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions.  You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.

  7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program

LICENSE  view on Meta::CPAN

    cost, duplication charges, time of people involved, and so on. (You will
    not be required to justify it to the Copyright Holder, but only to the
    computing community at large as a market that must bear the fee.) 
  - "Freely Available" means that no fee is charged for the item itself, though
    there may be fees involved in handling the item. It also means that
    recipients of the item may redistribute it under the same conditions they
    received it. 

1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.

2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.

3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:

  a) place your modifications in the Public Domain or otherwise make them

dist.ini  view on Meta::CPAN

[Git::Check]
[Git::Commit]
commit_msg  = Changes for version %v
changelog   = Changes

[Git::Tag]
tag_format  = v%v
tag_message = %N v%v

[Git::Push]
push_to     = origin
push_to     = github

lib/Acme/MetaSyntactic.pm  view on Meta::CPAN


The theme is made of several collections of names, each associated with
a "category". Categories can include sub-categories, etc, I<ad infinitum>
(or when disk space or memory is exhausted, whichever happens first).
The category is either passed as a constructor parameter or the default
value is selected.

=item C<Acme::MetaSyntactic::Alias>

The theme is simply an alias of another theme. All items are identical,
as the original behaviour. The only difference is the theme name.

=back

Over time, new theme "behaviours" will be added.

=head1 SEE ALSO

L<Acme::MetaSyntactic::Themes>, L<meta>, L<metafy>.

=head1 AUTHOR

lib/Acme/MetaSyntactic/Alias.pm  view on Meta::CPAN

    my ( $self, $alias ) = @_;
    my $class = caller(0);

    eval "require Acme::MetaSyntactic::$alias;";
    croak "Aliased theme Acme::MetaSyntactic::$alias failed to load: $@"
        if $@;

    no strict 'refs';
    no warnings;

    # copy almost everything over from the original
    for my $k ( grep { ! /^(?:Theme|meta|import)$/ }
        keys %{"Acme::MetaSyntactic::$alias\::"} )
    {
        *{"$class\::$k"} = *{"Acme::MetaSyntactic::$alias\::$k"};
    }

    # local things
    ${"$class\::Theme"} = ( split /::/, $class )[-1];
    ${"$class\::meta"}  = $class->new();
    *{"$class\::import"} = sub {

lib/Acme/MetaSyntactic/Alias.pm  view on Meta::CPAN

C<Acme::MetaSyntactic::Alias> is the base class for any themes that is
simply an alias of another theme.

=head1 METHOD

Acme::MetaSyntactic::Alias defines a single method, C<init()> that
make aliases very easy to write (see the full example in L<SYNOPSIS>):

=over 4

=item init( $original )

C<init()> must be called when the subclass is loaded, so as to correctly
load and alias the original theme.

C<$original> is the name of the original theme we want to alias.

=back

=head1 AUTHOR

Philippe 'BooK' Bruhat, C<< <book@cpan.org> >>

=head1 COPYRIGHT & LICENSE

Copyright 2006 Philippe 'BooK' Bruhat, All Rights Reserved.

script/metafy  view on Meta::CPAN

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
$^I = '' if $conf{'in-place'};

# loop on the files
while(<>) {
    s/$re_from/
        my $repl;
        if ( $conf{'force-random'} ) { push @{ $to{$1} }, $repl = $to->name() }

script/metafy  view on Meta::CPAN


Modify a bunch of files in-place:

    $ metafy --in-place foo:batman *.c

There is currently no way to create backup files (like perl's I<-i> option
allows).

=back

Each word from the original theme is replaced by the same word of the
target theme. However, if the target theme does not contain enough words
to map to the words from the original theme used in the file, then the
same words maybe used more than once. B<This may break programs!>

The option I<--force-random> will certainly break your stuff.

=head1 COMMAND-LINE OPTIONS

The following command-line options are available (and can all be abbreviated):

=head2 Metasyntactic options



( run in 1.873 second using v1.01-cache-2.11-cpan-1c8d708658b )