Acme-MetaSyntactic

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    [THEME UPDATES]
    - new contributor added to contributors theme

1.000 2012-05-07 BOOK
    [NEW THEME 2012/05/07]
    - contributors
    [ENHANCEMENTS]
    - eta.pm provided as a shortcut for one-liners (perl -Meta)
      (closed RT #28849)
    [THEME UPDATES]
    - all themes but foo (the default) and any moved to another
      distribution: Acme-MetaSyntactic-Themes

0.99_05 2012-05-04 BOOK
    [ENHANCEMENTS]
    - Acme::MetaSyntactic::MultiList init() now accepts an argument.
      (closed RT #40116)
    [TESTS]
    - made sure no tests depend on included themes

0.99_04 2012-04-10 BOOK

Changes  view on Meta::CPAN

    - Added support for empty lists (prevents AMS from falling into
      an infinite loop), thanks to Abigail
    - Better support in Acme::MetaSyntactic::Locale for language
      tags longer than 2 characters
    - Acme::MetaSyntactic::RemoteList now uses LWP::UserAgent to fetch
      remote lists
    [THEME UPDATES]
    - booze (see below)
    - dilbert
    - unicode (better support for various Perl versions and a very basic
      default list)
    [TICKET CLOSED]
    - #16256 on rt.cpan.org (David Landgren provided 11 new beverages
      and corrected a typo in AMS::booze)

0.50 2005-11-26 BOOK
    [NEW WEEKLY THEME 2005/11/28]
    - unicode
    [ENHANCEMENTS]
    - Acme::MetaSyntactic::List and Acme::MetaSyntactic::Locale-based
      theme can now supply their lists to __PACKAGE__->init(), instead

Changes  view on Meta::CPAN

0.07 2005-01-18 BOOK
    [NEW WEEKLY THEME 2005/01/31]
    - jamesbond (heh)

0.06 2005-01-18 BOOK
    [BIG FUX]
    - themes() didn't work correctly in scalar context.
    [SMILL FAX]
    - meta did issue a warning when called without arguments.
      Rafael Garcia-Suarez provided a patch, which I modified
      so that no args means default theme.
    [NEW WEEKLY THEME 2005/01/24]
    - tld (Scott Lanning suggested ISO 3166 country codes)

0.05 2005-01-16 BOOK
    [ANNOUNCE]
    - From now on, releases should happen on a weekly
      basis, every monday morning (CET)... A new list every week!
    - Email me with suggestions (and lists).
    [STUPID ME]
    - 0.04 was released too soon, so this version:

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

package Acme::MetaSyntactic;
$Acme::MetaSyntactic::VERSION = '1.015';
use strict;
use warnings;
use Carp;
use File::Basename;
use File::Spec;
use File::Glob;

# some class data
our $Theme = 'foo'; # default theme
our %META;

# private class method
sub _find_themes {
    my ( $class, @dirs ) = @_;
    return
        map  @$_,
        grep { $_->[0] !~ /^[A-Z]/ }    # remove the non-theme subclasses
        map  { [ ( fileparse( $_, qr/\.pm$/ ) )[0] => $_ ] }
        map  { File::Glob::bsd_glob( File::Spec->catfile( $_, qw( Acme MetaSyntactic *.pm ) ) ) } @dirs;

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

        eval "require Acme::MetaSyntactic::$theme; import Acme::MetaSyntactic::$theme;";
        croak $@ if $@;
        *{"$callpkg\::meta$theme"} = sub { $meta->name( $theme, @_ ) };
    }
}

sub new {
    my ( $class, @args ) = ( @_ );
    my $theme;
    $theme = shift @args if @args % 2;
    $theme = $Theme unless $theme; # same default everywhere

    # defer croaking until name() is actually called
    bless { theme => $theme, args => { @args }, meta => {} }, $class;
}

# CLASS METHODS
sub add_theme {
    my $class  = shift;
    my %themes = @_;

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

__END__

=encoding iso-8859-1

=head1 NAME

Acme::MetaSyntactic - Themed metasyntactic variables names

=head1 SYNOPSIS

    use Acme::MetaSyntactic; # loads the default theme
    print metaname();

    # this sets the default theme and loads Acme::MetaSyntactic::shadok
    my $meta = Acme::MetaSyntactic->new( 'shadok' );

    print $meta->name();          # return a single name
    my @names = $meta->name( 4 ); # return 4 distinct names (if possible)

    # you can temporarily switch theme
    # (though it shifts your metasyntactical paradigm in other directions)
    my $foo = $meta->name( 'foo' );       # return 1 name from theme foo
    my @foo = $meta->name( toto => 2 );   # return 2 names from theme toto

    # but why would you need an instance variable?
    use Acme::MetaSyntactic qw( batman robin );

    # the first loaded theme is the default (here batman)
    print metaname;
    my @names = metaname( 4 );

    print join ',', metabatman(3), metarobin;

    # the convenience functions are only exported
    # - via the Acme::MetaSyntactic import list
    # - when an individual theme is used
    print join $/, metabatman( 5 );

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

=head2 Methods

If you choose to use the OO interface, the following methods are
available:

=over 4

=item new( $theme )

Create a new instance of C<Acme::MetaSyntactic> with the theme C<$theme>.
If C<$theme> is omitted, the default theme is C<foo>.

=item name( [ $theme, ] $count )

Return C<$count> items from theme C<$theme>. If no theme is given,
the theme is the one passed to the constructor.

If C<$count> is omitted, it defaults to C<1>.

If C<$count> is C<0>, the whole list is returned (this may vary depending
on the "behaviour" of the theme) in list context, and the size of the
list in scalar context.

=back

There are also some class methods:

=over 4

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

The C<init()> method in all "behaviour" classes will also accept an optional
C<$data> hashref and if it provided, will use it instead of reading the
C<__DATA__> section of the module. The actual structure of the hashref
depends on the C<Acme::MetaSyntactic::> class.

=back

Convenience methods also exists for all the themes. The methods are named
after the theme. They are exported only when the theme is actually used
or when it appear in the C<Acme::MetaSyntactic> import list. The first
imported theme is the default, used by the C<metaname()> function.

=head1 EXPORTS

Depending on how C<Acme::MetaSyntactic> is used, several functions can
be exported. All of them behave like the following:

=over 4

=item metaname( [ $theme, ] $count )

Return C<$count> items from theme C<$theme>. If no theme is given,
the theme is "default" theme. See below how to change what the default is.

=back

=head2 Use cases

=over 4

=item C<use Acme::MetaSyntactic;>

This exports the C<metaname()> function only.

=item C<use Acme::MetaSyntactic 'theme';>

This exports the C<metaname()> function and the C<metaI<theme>()>
function. C<metaname()> default to the theme I<theme>.

=item C<use Acme::MetaSyntactic qw(theme1 theme2);>

This exports the C<metaname()>, C<metaI<theme1>()>, C<metaI<theme2>()>
functions. C<metaname()> default to the first theme of the list (I<theme1>).

=item C<use Acme::MetaSyntactic ':all';>

This exports the C<metaname()> function and the meta* functions for
B<all> themes. C<metaname()> default to the standard default theme (C<foo>).

=item C<use Acme::MetaSyntactic::theme;>

This exports the C<metaI<theme>()> function only. The C<metaname()>
function is not exported.

=back

=head1 THEMES

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

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

The theme is a simple collection of names. An object instance will
return names at random from the list, and not repeat any until the list
is exhausted.

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

The theme is made of several collections of names, each associated with
a "language". The language is either passed as a constructor parameter,
extracted from the environment or a default is selected.

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

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.

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

The constructor of a single instance. An instance will not repeat items
until the list is exhausted.

=item init()

init() must be called when the subclass is loaded, so as to read the
__DATA__ section and fully initialise it.

=item name( $count )

Return $count names (default: C<1>).

Using C<0> will return the whole list in list context, and the size of the
list in scalar context.

=item theme()

Return the theme name.

=back

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

    # call the parent class init code
    goto &Acme::MetaSyntactic::MultiList::init;
}

sub new {
    my $class = shift;

    no strict 'refs';
    my $self = bless { @_, cache => [] }, $class;

    # compute some defaults
    if( ! exists $self->{category} ) {
        $self->{category} =
            exists $self->{lang}
            ? $self->{lang}
            : $ENV{LANGUAGE} || $ENV{LANG} || '';
        if( !$self->{category} && $^O eq 'MSWin32' ) {
            eval { require Win32::Locale; };
            $self->{category} = Win32::Locale::get_language() unless $@;
        }
    }

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

    
    Acme::MetaSyntactic::digits - The numbers theme
    
    =head1 DESCRIPTION
    
    You can count on this module. Almost.

    =cut
    
    __DATA__
    # default
    en
    # names en
    zero one two three four five six seven eight nine
    # names fr
    zero un deux trois quatre cinq six sept huit neuf
    # names it
    zero uno due tre quattro cinque sei sette otto nove
    # names yi
    nul eyn tsvey dray fir finf zeks zibn akht nayn

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


the given C<lang> or C<category> parameter,

=item 2.

the current locale, as given by the environment variables C<LANGUAGE>,
C<LANG> or (under Win32) Win32::Locale.

=item 3.

the default language for the selected theme.

=back

The language codes should conform to the RFC 3066 and ISO 639 standard.

=head1 METHODS

Acme::MetaSyntactic::Locale offers several methods, so that the subclasses
are easy to write (see full example in L<SYNOPSIS>):

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


The C<lang> or C<category> parameter(both are synonymous) should be
expressed as a locale category. If none of those parameters is given
Acme::MetaSyntactic::Locale will try to find the user locale (with the
help of environment variables C<LANGUAGE>, C<LANG> and the module
C<Win32::Locale>).

POSIX locales are defined as C<language[_territory][.codeset][@modifier]>.
If the specific territory is not supported, C<Acme::MetaSyntactic::Locale>
will use the language, and if the language isn't supported either,
the default is used.

=item init()

init() must be called when the subclass is loaded, so as to read the
__DATA__ section and fully initialise it.

=item name( $count )

Return $count names (default: C<1>).

Using C<0> will return the whole list in list context, and the size of the
list in scalar context (according to the C<lang> parameter passed to the
constructor).

=item lang()

=item category()

Return the selected language for this instance.

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

        }
        else {    # leaf
            my @items = split /\s+/, $h;
            while ($k) {
                push @{ ${"$class\::MultiList"}{$k} }, @items;
                $k =~ s!$tail!!;
            }
        }
    }

    ${"$class\::Default"} = ${"$class\::Default"} = $data->{default} || ':all';
    ${"$class\::Theme"} = ${"$class\::Theme"} = ( split /::/, $class )[-1];

    *{"$class\::import"} = sub {
        my $callpkg = caller(0);
        my $theme   = ${"$class\::Theme"};
        my $meta    = $class->new;
        *{"$callpkg\::meta$theme"} = sub { $meta->name(@_) };
    };

    ${"$class\::meta"} = ${"$class\::meta"} = $class->new();

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

    }
    splice( @$list, 0, $count );
}

sub new {
    my $class = shift;

    no strict 'refs';
    my $self = bless { @_, cache => [] }, $class;

    # compute some defaults
    $self->{category} ||= ${"$class\::Default"};

    # fall back to last resort (FIXME should we carp()?)
    $self->{category} = ${"$class\::Default"}
        if $self->{category} ne ':all'
        && !exists ${"$class\::MultiList"}{ $self->{category} };

    $self->_compute_base();
    return $self;
}

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

    
    Acme::MetaSyntactic::digits - The numbers theme
    
    =head1 DESCRIPTION
    
    You can count on this module. Almost.

    =cut
    
    __DATA__
    # default
    :all
    # names primes even
    two
    # names primes odd
    three five seven
    # names composites even
    four six eight
    # names composites odd
    nine
    # names other

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

The category is selected at construction time from:

=over 4

=item 1.

the given C<category> parameter,

=item 2.

the default category for the selected theme.

=back

Categories and sub-categories are separated by a C</> character.

=head1 METHODS

Acme::MetaSyntactic::MultiList offers several methods, so that the subclasses
are easy to write (see full example in L<SYNOPSIS>):

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

until the list is exhausted.

    $meta = Acme::MetaSyntactic::digits->new( category => 'primes' );
    $meta = Acme::MetaSyntactic::digits->new( category => 'primes/odd' );

The special category C<:all> will use all the items in all categories.

    $meta = Acme::MetaSyntactic::digits->new( category => ':all' );

If no C<category> parameter is given, C<Acme::MetaSyntactic::MultiList>
will use the class default. If the class doesn't define a default,
then C<:all> is used.

=item init()

init() must be called when the subclass is loaded, so as to read the
__DATA__ section and fully initialise it.

=item name( $count )

Return $count names (default: C<1>).

Using C<0> will return the whole list in list context, and the size of the
list in scalar context (according to the C<category> parameter passed to the
constructor).

=item category()

Return the selected category for this instance.

=item categories()

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

use Carp;

our $VERSION = '1.003';

# method that extracts the items from the remote content and returns them
sub extract {
    my $class = ref $_[0] || $_[0];
    no strict 'refs';
    my $func  = ${"$class\::Remote"}{extract};

    # provide a very basic default
    my $meth = ref $func eq 'CODE'
        ? sub { my %seen; return grep { !$seen{$_}++ } $func->( $_[1], $_[2] ); }
        : sub { return $_[1] };    # very basic default

    # put the method in the subclass symbol table (at runtime)
    *{"$class\::extract"} = $meth;

    # now run the function^Wmethod
    goto &$meth;
}

# methods related to the source URL
sub source {

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

    eval {
        require LWP::UserAgent;
        die "version 5.802 required ($LWP::VERSION installed)\n"
            if $LWP::VERSION < 5.802;
    };
    if ($@) {
        carp "LWP::UserAgent not available: $@";
        return;
    }

    # figure out the default category (for an instance)
    my $category = ref $_[0] ? $_[1] || $_[0]->{category} : $_[1];

    # fetch the content
    my @items;
    my @srcs = $class->sources($category);
    my $ua   = LWP::UserAgent->new( env_proxy => 1 );
    foreach my $src (@srcs) {
        my $request = HTTP::Request->new(
            ref $src
            ? ( POST => $src->[0],

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

1;

=encoding iso-8859-1

=head1 NAME

Acme::MetaSyntactic::foo - The foo theme

=head1 DESCRIPTION

The classic. This is the default theme.

As from version 0.85, this theme is multilingual.

=head1 CONTRIBUTORS

Philippe "BooK" Bruhat.

Jérôme Fenal and Sébastien Aperghis-Tramoni contributed to the French theme.

Dutch theme contributed by Abigail.

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


=back

=head1 SEE ALSO

L<Acme::MetaSyntactic>, L<Acme::MetaSyntactic::Locale>.

=cut

__DATA__
# default
en
# names en
foo    bar   baz  foobar fubar qux  quux corge grault
garply waldo fred plugh  xyzzy thud
# names fr
toto titi tata tutu pipo
bidon test1 test2 test3
truc chose machin chouette bidule
# names nl
aap noot mies wim zus jet

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

    _check_file_lines(
        $theme, $file,
        "__DATA__ section for %s",
        sub {
            my @lines;
            my $in_data;
            for my $line (@_) {
                $in_data++ if $line =~ /^__DATA__$/;
                next if !$in_data;
                push @lines, $line
                    if /^#/ && !/^# ?(?:names(?: +[-\w]+)*|default)\s*$/;
            }
            return @lines;
        }
    );
}

sub subtest_version {
    my ($theme) = @_;
    my $tb = __PACKAGE__->builder;
    $tb->plan( tests => 1 );

script/meta  view on Meta::CPAN

    baz
    $ meta batman
    powie
    $ meta donmartin 3
    kloong
    thoof_foing
    weeooweeeoooo
    $ meta -ws browser 4
    arachne netscape voyager w3m

In short, the default theme is C<foo>, the default count is 1, the default
separator is C<$/>, but you can replace it by whitespace with I<--ws>.

=head1 COMMAND-LINE OPTIONS

The following command-line options are available:

=head2 Metasyntactic options

=over 4

script/meta  view on Meta::CPAN

Fetch the remote list (if available) and print only the differences betwen
the current list and the remote list (items are prefixed by C<+> and C<->).

Option added by Abigail.

The output of this option is affected by the I<--whitespace> option.

=item I<--category> category

Only select items in the given category (for C<Acme::MetaSyntactic::MultiList>
subclasses). If not given, use the default category.

Silently fallbacks to the default if the category doesn't exist.

Another way to ask for a specific category is to skip the I<--category>
option and directly ask for C<theme/category>. Note that you cannot use
both calling conventions simultaneously.

=back

=head2 Informative options

The program will exit if any of these options is selected.

t/10meta.t  view on Meta::CPAN

    my $count = $meta->name( 0 );
    is( $count, scalar @all, "name(0) is scalar context returns the count" );
}

DEFAULT: {
    my $meta = Acme::MetaSyntactic->new();

    no warnings;
    my @names = $meta->name;
    my %seen = map { $_ => 0 } @{$Acme::MetaSyntactic::foo::MultiList{en}};
    ok( exists $seen{$names[0]}, "From the default list" );

    %seen = map { $_ => 1 } $meta->name( test_ams_list => 4 );
    is_deeply(
        \%seen,
        { John => 1, Paul => 1, George => 1, Ringo => 1 },
        "Got the whole list"
    );

    @names = $meta->name( 'foo/fr' );
    %seen = map { $_ => 0 } @{$Acme::MetaSyntactic::foo::MultiList{fr}};

t/15func.t  view on Meta::CPAN

use Test::More;
use strict;
use lib 't/lib';
use NoLang;
use Acme::MetaSyntactic;

plan tests => 2;

# the default list
no warnings;
my @names = metaname();
my %seen = map { $_ => 1 } @{$Acme::MetaSyntactic::foo::MultiList{en}};
ok( exists $seen{$names[0]}, "metaname" );

is_deeply(
    [ sort grep { /^meta\w+$/ } keys %:: ],
    [qw( metaname )],
    "Default exported function"
);

t/32multi.t  view on Meta::CPAN

    is_deeply(
        [ sort @categories ],
        [ grep { $_ ne ':all' } sort keys %tests ],
        "All categories (instances)"
    );

    for my $args ( [], map { [ category => $_ ] } @categories, ':all', 'zz' ) {
        my $meta = Acme::MetaSyntactic::mongers->new(@$args);
        my $category = $args->[1] || 'fr/lyon';
        $category = 'fr/lyon'
            if $category eq 'zz';    # check fallback to default

        my ( $one, $four ) = ( 1, 4 );
        ( $one, $four ) = ( 0, 0 ) if $category eq 'mars';    # empty list
        my @mongers = $meta->name();
        is( $meta->category(), $category, "category() is $category" );
        is( @mongers, $one, "Single item ($one $category)" );
        @mongers = $meta->name(4);
        is( @mongers, $four, "Four items ($four $category)" );

        @mongers = sort $meta->name(0);

t/32multi.t  view on Meta::CPAN

    ok( !$meta->has_category('fr/rennes'), "instance hasn't 'fr/rennes'" );
}

package Acme::MetaSyntactic::mongers;
use Acme::MetaSyntactic::MultiList;
our @ISA = ('Acme::MetaSyntactic::MultiList');
__PACKAGE__->init();
1;

__DATA__
# default
fr/lyon
# names fr paris
grinder lacravate echo book
# names fr lyon perrache
book
# names fr lyon ailleurs
jq dm stomakc
# names fr marseille
maddingue arhuman
# names uk london

t/33locale.t  view on Meta::CPAN

is_deeply(
    [ sort @langs ],
    [qw( en fr it x-chiendent yi )],
    "All languages (instance)"
);

for my $args ( [], map { [ lang => $_ ] } @langs, 'zz' ) {
    my $meta = Acme::MetaSyntactic::test_ams_locale->new(@$args);
    my $lang = $args->[1] || 'fr';
    my ( $one, $four ) = ( 1, 4 );
    $lang = 'fr' if $lang eq 'zz';    # check fallback to default
    my @digits = $meta->name;
    is( $meta->lang, $lang, "lang() is $lang" );
    is( @digits, $one, "Single item ($one $lang)" );
    @digits = $meta->name(4);
    is( @digits, $four, "Four items ($four $lang)" );

    @digits = sort $meta->name(0);
    no warnings;
    my @all = sort @{ $Acme::MetaSyntactic::test_ams_locale::Locale{$lang} };
    is_deeply( \@digits, \@all, "All items ($lang)" );

t/33locale_territory.t  view on Meta::CPAN

    }
}

package Acme::MetaSyntactic::test_ams_digits;
use Acme::MetaSyntactic::Locale;
our @ISA = ('Acme::MetaSyntactic::Locale');
__PACKAGE__->init();
1;

__DATA__
# default
en
# names en
seventy
# names fr fr
soixante_dix
# names fr be
septante

t/33locale_win32.t  view on Meta::CPAN

    my (undef, $file) = @_;

    if ($file eq 'Win32/Locale.pm') {
        my @code = ("0;");
        return sub { $_ = shift @code };
    }
};

$^O   = 'MSWin32';
$meta = Acme::MetaSyntactic::test_ams_locale->new;
is( $meta->lang, 'fr', "Correct default without Win32::Locale" );

t/34data.t  view on Meta::CPAN

use strict;
use Test::More;

package Acme::MetaSyntactic::yeye;
no warnings 'once';

use Acme::MetaSyntactic::MultiList;
our @ISA = qw( Acme::MetaSyntactic::MultiList );

my $real_names = {
    default => 'chats_sauvages',
    names   => {
        idole_des_jeunes   => "Jean_Philippe Smet",
        chaussettes_noires => "Claude Moine",
        chats_sauvages     => "Herve Fornieri",
    }
};

__PACKAGE__->init($real_names);

package main;

t/34data.t  view on Meta::CPAN

is( $Acme::MetaSyntactic::yeye::MultiList{idole_des_jeunes}[0],   'Jean_Philippe', 'Christian name of idole des jeunes');
is( $Acme::MetaSyntactic::yeye::MultiList{idole_des_jeunes}[1],   'Smet',          'Surname of idole des jeunes');
is( $Acme::MetaSyntactic::yeye::MultiList{chaussettes_noires}[0], 'Claude',        'Christian name of the singer of chaussettes noires');
is( $Acme::MetaSyntactic::yeye::MultiList{chaussettes_noires}[1], 'Moine',         'Surname of the singer of chaussettes noires');
is( $Acme::MetaSyntactic::yeye::MultiList{chats_sauvages}[0],     'Herve',         'Christian name of the singer of chats sauvages');
is( $Acme::MetaSyntactic::yeye::MultiList{chats_sauvages}[1],     'Fornieri',      'Surname of the singer of chats sauvages');

package Acme::MetaSyntactic::yeye;
__DATA__

# default
chaussettes_noires
# names idole_des_jeunes
Johnny Halliday
# names chaussettes_noires
Eddy Mitchell
# names chats_sauvages
Dick Rivers

t/35remote.t  view on Meta::CPAN

my $list = Acme::MetaSyntactic::test_ams_list->new();
ok( ! $list->has_remotelist(), 'No remote list for test_ams_list object' );
is( $list->source(), undef, 'test_ams_list object source() empty' );

# try to get the list anyway
SKIP: {
    skip "LWP::UserAgent required to test remote_list()", 1 if !$has_lwp;
    is( $list->remote_list(), undef, 'No remote list for test_ams_list object' );
}

# default version of extract
is( $list->extract( 'zlonk aieee' ), 'zlonk aieee', "Default extract()" );


# theme with a remote list
use Acme::MetaSyntactic::test_ams_remote();
ok( Acme::MetaSyntactic::test_ams_remote->has_remotelist(),
    'test_ams_remote has a remote list' );
is( Acme::MetaSyntactic::test_ams_remote->source(),
    'http://www.perdu.com/',
    'test_ams_remote source()'

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

package Acme::MetaSyntactic::test_ams_locale;
use strict;
use Acme::MetaSyntactic::Locale;
our @ISA = qw( Acme::MetaSyntactic::Locale );
__PACKAGE__->init();
1;

__DATA__
# default
fr
# names en
zero one two three four five six seven eight nine
# names fr
zero un deux trois quatre cinq six sept huit neuf
# names it
zero uno due tre quattro cinque sei sette otto nove
# names yi
nul eyn tsvey dray fir finf zeks zibn akht nayn
# names x-chiendent



( run in 0.665 second using v1.01-cache-2.11-cpan-0a6323c29d9 )