Data-Phrasebook-Loader-YAML-0.12/0000755000175000017500000000000012034227612015575 5ustar barbiebarbieData-Phrasebook-Loader-YAML-0.12/t/0000755000175000017500000000000012034227612016040 5ustar barbiebarbieData-Phrasebook-Loader-YAML-0.12/t/04phrases.yaml0000644000175000017500000000040312034227574020541 0ustar barbiebarbiecabbage: cooked: okay raw: better potato: grow: easy cook: easy cooked: great raw: disaster sprout: dog: dislikes cat: likes cooked: terrible raw: great onion: nice: yummy notnice: strong perl: 'just right' Data-Phrasebook-Loader-YAML-0.12/t/01phrases2.yaml0000644000175000017500000000000012034227574020611 0ustar barbiebarbieData-Phrasebook-Loader-YAML-0.12/t/01load.t0000644000175000017500000000144412034227574017317 0ustar barbiebarbie#!/usr/bin/perl -w use strict; use lib 't'; use vars qw( $class ); use Test::More tests => 7; # ------------------------------------------------------------------------ $class = 'Data::Phrasebook::Loader::YAML'; use_ok($class); my $file = 't/01phrases.yaml'; my $file2 = 't/01phrases2.yaml'; # ------------------------------------------------------------------------ { my $obj = $class->new(); isa_ok( $obj => $class, "Bare new" ); my $phrase = $obj->get(); is($phrase,undef); $phrase = $obj->get('foo'); is($phrase,undef); eval { $obj->load(); }; ok($@); $obj->load( $file ); $phrase = $obj->get('foo'); like( $phrase, qr/Welcome to/); } { my $obj = $class->new(); eval { $obj->load( $file2 ); }; like( $@, qr/Badly formatted YAML/); } Data-Phrasebook-Loader-YAML-0.12/t/01phrases.yaml0000644000175000017500000000017512034227574020544 0ustar barbiebarbie--- foo: > Welcome to [% my %] world. It is a nice [%place %]. bar: > Welcome to :my world. It is a nice :place. Data-Phrasebook-Loader-YAML-0.12/t/94metatest.t0000644000175000017500000000130012034227574020231 0ustar barbiebarbie#!/usr/bin/perl -w use strict; use Test::More; # Skip if doing a regular install plan skip_all => "Author tests not required for installation" unless ( $ENV{AUTOMATED_TESTING} ); eval "use Test::CPAN::Meta"; plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; plan 'no_plan'; my $meta = meta_spec_ok(undef,undef,@_); use Data::Phrasebook::Loader::YAML; my $version = $Data::Phrasebook::Loader::YAML::VERSION; is($meta->{version},$version, 'META.yml distribution version matches'); if($meta->{provides}) { for my $mod (keys %{$meta->{provides}}) { is($meta->{provides}{$mod}{version},$version, "META.yml entry [$mod] version matches"); } } Data-Phrasebook-Loader-YAML-0.12/t/02single.t0000644000175000017500000000226312034227574017662 0ustar barbiebarbie#!/usr/bin/perl -w use strict; use vars qw( $class ); use Test::More tests => 12; # ------------------------------------------------------------------------ BEGIN { $class = 'Data::Phrasebook::Loader::YAML'; use_ok($class); } my $file = 't/01phrases.yaml'; # ------------------------------------------------------------------------ { my $obj = $class->new(); isa_ok( $obj => $class, "Bare new" ); is_deeply( [$obj->dicts], [], 'pre load dicts' ); is_deeply( [$obj->keywords], [], 'pre load keywords' ); my $phrase = $obj->get(); is($phrase,undef,'pre load null get'); $phrase = $obj->get('foo'); is($phrase,undef,'pre load unknown get'); eval { $obj->load(); }; ok($@, 'load dies without a file'); $obj->load( $file ); $phrase = $obj->get('foo'); is_deeply( [$obj->dicts], [], 'single dict empty dict list' ); is_deeply( [$obj->keywords], ['bar','foo'], 'single dict sorted keywords' ); is_deeply( [$obj->keywords('quux')], ['bar','foo'], 'override dict in keyword farm' ); is_deeply( [$obj->keywords([$obj->dicts])], ['bar','foo'], 'farm all keywords' ); like( $phrase, qr/Welcome to/, 'single dict retrieve'); } Data-Phrasebook-Loader-YAML-0.12/t/96metatest.t0000644000175000017500000000132512034227574020242 0ustar barbiebarbie#!/usr/bin/perl -w use strict; use Test::More; # Skip if doing a regular install plan skip_all => "Author tests not required for installation" unless ( $ENV{AUTOMATED_TESTING} ); eval "use Test::CPAN::Meta::JSON"; plan skip_all => "Test::CPAN::Meta::JSON required for testing META.json files" if $@; plan 'no_plan'; my $meta = meta_spec_ok(undef,undef,@_); use Data::Phrasebook::Loader::YAML; my $version = $Data::Phrasebook::Loader::YAML::VERSION; is($meta->{version},$version, 'META.json distribution version matches'); if($meta->{provides}) { for my $mod (keys %{$meta->{provides}}) { is($meta->{provides}{$mod}{version},$version, "META.json entry [$mod] version matches"); } } Data-Phrasebook-Loader-YAML-0.12/t/03multi.t0000644000175000017500000000337112034227574017535 0ustar barbiebarbie#!/usr/bin/perl -w use strict; use vars qw( $class ); use Test::More tests => 16; # ------------------------------------------------------------------------ BEGIN { $class = 'Data::Phrasebook::Loader::YAML'; use_ok($class); } my $file = 't/03phrases.yaml'; # ------------------------------------------------------------------------ { my $obj = $class->new(); isa_ok( $obj => $class, "Bare new" ); eval { $obj->load( $file ); 1; }; ok(! $@, 'Load did not die'); is_deeply( [$obj->dicts], ['first','second'], 'all dicts in file' ); is_deeply( [$obj->keywords], ['baz','foo'], 'default keywords in file' ); is_deeply( [$obj->keywords('second')], ['baz','foo','one','three'], 'keywords in specified dict' ); is_deeply( [$obj->keywords([$obj->dicts])], ['baz','foo','one','three'], 'all keywords in file' ); my $phrase = $obj->get(); is($phrase,undef,'get nothing'); $phrase = $obj->get('quux'); is($phrase,undef,'get unknown'); $phrase = $obj->get('foo'); is( $phrase, 'bar', 'get known key in default'); $phrase = $obj->get('one'); is($phrase,undef,'get known in unavailable dict'); $obj->load( $file, 'second' ); is_deeply( [$obj->keywords], ['baz','foo','one','three'], 'default keywords in file' ); is_deeply( [$obj->keywords([$obj->dicts])], ['baz','foo','one','three'], 'all keywords in file' ); } { my @dicts = ('third','first'); my $obj = $class->new(); $obj->load( $file, @dicts ); my $phrase = $obj->get('three'); is( $phrase, undef, 'get wrong key with missing dictionary'); $phrase = $obj->get('foo'); is( $phrase, 'bar', 'get default key with missing dictionary'); is_deeply( [$obj->keywords(\@dicts)], ['baz','foo'], 'default keywords in file' ); }Data-Phrasebook-Loader-YAML-0.12/t/92distribution.t0000644000175000017500000000030712034227574021126 0ustar barbiebarbie#!/usr/bin/perl -w use strict; use Test::More; BEGIN { eval { require Test::Distribution; }; if($@) { plan skip_all => 'Test::Distribution not installed'; } else { import Test::Distribution; } }Data-Phrasebook-Loader-YAML-0.12/t/91podcover.t0000644000175000017500000000030112034227574020221 0ustar barbiebarbie#!/usr/bin/perl -w use strict; use Test::More; eval "use Test::Pod::Coverage 0.08"; plan skip_all => "Test::Pod::Coverage 0.08 required for testing POD coverage" if $@; all_pod_coverage_ok(); Data-Phrasebook-Loader-YAML-0.12/t/90podtest.t0000644000175000017500000000024112034227574020064 0ustar barbiebarbie#!/usr/bin/perl -w use strict; use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); Data-Phrasebook-Loader-YAML-0.12/t/04default.t0000644000175000017500000000477312034227574020037 0ustar barbiebarbie#!/usr/bin/perl -w use strict; use vars qw( $class ); use Test::More tests => 23; # ------------------------------------------------------------------------ BEGIN { $class = 'Data::Phrasebook::Loader::YAML'; use_ok($class); } my $file = 't/04phrases.yaml'; # ------------------------------------------------------------------------ { my $obj = $class->new(); isa_ok( $obj => $class, "Bare new" ); eval { $obj->load( $file ); 1; }; ok(! $@, 'Load did not die'); is_deeply( [$obj->dicts], ['cabbage','onion','potato','sprout'], 'all dicts in file' ); is_deeply( [$obj->keywords], ['cooked','raw'], 'default keywords in file' ); is_deeply( [$obj->keywords('potato')], ['cook','cooked','grow','raw'], 'keywords in specified dict' ); is_deeply( [$obj->keywords([$obj->dicts])], ['cat','cook','cooked','dog','grow','nice','notnice','perl','raw'], 'all keywords in file' ); my $phrase = $obj->get(); is($phrase,undef,'get nothing'); $phrase = $obj->get('quux'); is($phrase,undef,'get unknown'); $phrase = $obj->get('cooked'); is( $phrase, 'okay', 'get known key in default'); $phrase = $obj->get('nice'); is($phrase,undef,'get known in unavailable dict'); $obj->set_default('potato'); $obj->load( $file ); is_deeply( [$obj->keywords], ['cook','cooked','grow','raw'], 'default keywords changed' ); is_deeply( [$obj->keywords('potato')], ['cook','cooked','grow','raw'], 'keywords in specified dict changed 1' ); is_deeply( [$obj->keywords('sprout')], ['cat','cook','cooked','dog','grow','raw'], 'keywords in specified dict changed 2' ); is_deeply( [$obj->keywords([$obj->dicts])], ['cat','cook','cooked','dog','grow','nice','notnice','perl','raw'], 'all keywords in file' ); $phrase = $obj->get(); is($phrase,undef,'get nothing'); $phrase = $obj->get('quux'); is($phrase,undef,'get unknown'); $phrase = $obj->get('cooked'); is( $phrase, 'great', 'get known key in default'); $phrase = $obj->get('nice'); is($phrase,undef,'get known in unavailable dict'); $obj->set_default('potato'); $obj->load( $file, ['sprout','onion'] ); $phrase = $obj->get('cooked'); is( $phrase, 'terrible', 'get known key 1'); $phrase = $obj->get('grow'); is( $phrase, 'easy', 'get known key 2'); $phrase = $obj->get('perl'); is( $phrase, 'just right', 'get known key 3'); is_deeply( [$obj->keywords], ['cat','cook','cooked','dog','grow','nice','notnice','perl','raw'], 'default keywords changed' ); } Data-Phrasebook-Loader-YAML-0.12/t/95changedate.t0000644000175000017500000000237512034227574020504 0ustar barbiebarbie#!/usr/bin/perl -w use strict; use Test::More; use IO::File; # Skip if doing a regular install plan skip_all => "Author tests not required for installation" unless ( $ENV{AUTOMATED_TESTING} ); my $fh = IO::File->new('Changes','r') or plan skip_all => "Cannot open Changes file"; plan 'no_plan'; use Data::Phrasebook::Loader::YAML; my $version = $Data::Phrasebook::Loader::YAML::VERSION; my $latest = 0; while(<$fh>) { next unless(m!^\d!); $latest = 1 if(m!^$version!); # 2012-08-26T01:02 or 2012-08-26T01:02:03 or 2012-08-26T01:02:03.04 or 2012-08-26T01:02+01:00 like($_, qr! \d[\d._]+\s+ # version ( \d{4}-\d{2}-\d{2} # 2012-08-26 - YYYY-MM-DD ( T\d{2}:\d{2} # T01:02 - Thh:mm ( :\d{2} # :02 - :ss ( \.\d+ # .2 - .ss (microseconds) )? )? ( (Z|[-+]\d+:\d+) # +01:00 - timezone )? )? ) !x,'... version has a date'); } is($latest,1,'... latest version not listed'); Data-Phrasebook-Loader-YAML-0.12/t/03phrases.yaml0000644000175000017500000000010712034227574020541 0ustar barbiebarbiesecond: one: two three: four first: foo: bar baz: quux Data-Phrasebook-Loader-YAML-0.12/lib/0000755000175000017500000000000012034227612016343 5ustar barbiebarbieData-Phrasebook-Loader-YAML-0.12/lib/Data/0000755000175000017500000000000012034227612017214 5ustar barbiebarbieData-Phrasebook-Loader-YAML-0.12/lib/Data/Phrasebook/0000755000175000017500000000000012034227612021311 5ustar barbiebarbieData-Phrasebook-Loader-YAML-0.12/lib/Data/Phrasebook/Loader/0000755000175000017500000000000012034227612022517 5ustar barbiebarbieData-Phrasebook-Loader-YAML-0.12/lib/Data/Phrasebook/Loader/YAML.pm0000644000175000017500000002111412034227574023625 0ustar barbiebarbiepackage Data::Phrasebook::Loader::YAML; use strict; use warnings FATAL => 'all'; use base qw( Data::Phrasebook::Loader::Base Data::Phrasebook::Debug ); use Carp qw( croak ); use YAML; our $VERSION = '0.12'; =head1 NAME Data::Phrasebook::Loader::YAML - Absract your phrases with YAML. =head1 SYNOPSIS use Data::Phrasebook; my $q = Data::Phrasebook->new( class => 'Fnerk', loader => 'YAML', file => 'phrases.yaml', ); $q->delimiters( qr{ \[% \s* (\w+) \s* %\] }x ); my $phrase = $q->fetch($keyword); =head1 DESCRIPTION This class loader implements phrasebook patterns using YAML. Phrases can be contained within one or more dictionaries, with each phrase accessible via a unique key. Phrases may contain placeholders, please see L for an explanation of how to use these. Groups of phrases are kept in a dictionary. In this implementation a single file is one complete dictionary. An example YAML file: --- foo: > Welcome to [% my %] world. It is a nice [%place %]. Within the phrase text placeholders can be used, which are then replaced with the appropriate values once the get() method is called. The default style of placeholders can be altered using the delimiters() method. =head1 INHERITANCE L inherits from the base class L. See that module for other available methods and documentation. =head1 METHODS =head2 load Given a C, load it. C must contain a YAML map. $loader->load( $file, @dict ); This method is used internally by L's C method, to initialise the data store. It must take a C (be it a scalar, or something more complex) and return a handle. The C is optional, should you wish to use the dictionary support. =cut sub load { my ($class, $file, @dict) = @_; croak "No file given as argument!" unless defined $file; my ($d) = YAML::LoadFile( $file ); croak "Badly formatted YAML file $file" unless ref $d eq 'HASH'; $class->{yaml} = $d; # what sections are we using? my $key = $class->{defaultname} || ($class->dicts)[0]; $class->{default} = ($key ? $class->{yaml}->{$key} : $class->{yaml}); $class->{dict} = []; $class->{dict} = [$class->{defaultname}] if $class->{defaultname}; $class->{dict} = (ref $dict[0] ? $dict[0] : [@dict]) if scalar @dict; } =head2 get Returns the phrase stored in the phrasebook, for a given keyword. my $value = $loader->get( $key ); If one or more named dictionaries have been previously selected, they will be searched in order, followed by the default dictionary. The first hit on C will be returned, otherwise C is returned. =cut sub get { my ($class,$key) = @_; return unless($key); return unless($class->{yaml}); my @dicts = (ref $class->{dict} ? @{$class->{dict}} : ()); foreach ( @dicts ) { return $class->{yaml}->{$_}->{$key} if exists $class->{yaml}->{$_} and exists $class->{yaml}->{$_}->{$key}; } return $class->{default}->{$key} if ref $class->{default} eq 'HASH' and exists $class->{default}->{$key}; return; } =head2 dicts Returns the list of dictionaries available. my @dicts = $loader->dicts(); This is the list of all dictionaries available in the source file. If multiple dictionaries are not being used, then an empty list will be returned. =cut sub dicts { my $class = shift; my @keys = keys %{$class->{yaml}}; if ( scalar @keys == scalar grep {ref $_ eq 'HASH'} values %{$class->{yaml}} ) { # data source looks like it has multiple dictionaries return (sort @keys); } return (); } =head2 keywords Returns the list of keywords available. List is lexically sorted. my @keywords = $loader->keywords( $dict ); If one or more named dictionaries have been previously selected, they will be farmed for keywords, followed by the default dictionary. The C argument is optional, and may be used to override the search to a single named dictionary, or a list of dictionaries if passed by reference, plus the default dictionary of course. To find all available keywords in all available dictionaries, use the following: $loader->keywords( [ $loader->dicts ] ); =cut sub keywords { my ($class, $dict) = @_; my (%keywords, @dicts); @dicts = ( (not $dict) ? (ref $class->{dict} ? @{$class->{dict}} : ()) : (ref $dict) ? @$dict : ($dict) ); foreach my $d (@dicts) { next unless exists $class->{yaml}->{$d} and ref $class->{yaml}->{$d} eq 'HASH'; map { $keywords{$_} = 1 } keys %{$class->{yaml}->{$d}}; } if (ref $class->{default} eq 'HASH') { map { $keywords{$_} = 1 } keys %{$class->{default}}; } my @keywords = sort keys %keywords; return @keywords; } =head2 set_default If a requested phrase is not found in the named dictionary an attempt is made to find it in the I dictionary. L loaders normally use the first dictionary in the phrasebook as the default, but as mentioned in L this does not make sense because the dictionaries in YAML phrasebooks are not ordered. To override the automatically selected default dictionary use this method, and pass it a C. This value is only reset at phrasebook load time, so you'll probably need to trigger a reload: $q->loader->set_default( $default_dictionary_name ); $q->loader->load( $file ); To reset the loader's behaviour to automatic default dictionary selection, pass this method an undefined value, and then reload. =cut sub set_default { $_[0]->{defaultname} = $_[1]; } 1; __END__ =head1 DICTIONARY SUPPORT This loader supports the use of dictionaries, as well as multiple dictionaries with a search order. If you are unfamiliar with these features, see L for more information. Source data format for a single unnamed dictionary is a YAML stream that has as its I an anonymous hash, like so: --- first_key: first_value second_key: second_value In this case, specifying one or more named dictionaries will have no effect. The single dictionary that comprises the YAML file will take the place of your I dictionary, so will always be searched. To override this behaviour use the C object method. Multiple dictionaries B be specified using a two-level hash system, where the root node of your YAML file is an anonymous hash containing dictionary names, and the values of those hash keys are further anonymous hashes containing the dictionary contents. Here is an example: --- dict_one: first_key: first_value second_key: second_value dict_two: first_key: first_value second_key: second_value If you use any other structure for your YAML dictionary files, the result is uncertain, and this loader module is very likely to crash your program. If a requested phrase is not found in the named dictionary an attempt is made to find it in the I dictionary. L loaders normally use the first dictionary in the phrasebook as the default, but this does not make sense because YAML phrasebook files contain an unordered hash of dictionaries. This loader will therefore select the first dictionary from the list of I dictionary names to be the default. To override this behaviour use the C object method. Alternatively, just include a dictionary that is guaranteed to be selected for the default (e.g. C<0000default>); it need not contain any keys. =head1 SEE ALSO L, L. =head1 BUGS, PATCHES & FIXES There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties, that is not explained within the POD documentation, please send an email to barbie@cpan.org or submit a bug to the RT system (http://rt.cpan.org/). However, it would help greatly if you are able to pinpoint problems or even supply a patch. Fixes are dependent upon their severity and my availability. Should a fix not be forthcoming, please feel free to (politely) remind me. =head1 AUTHOR Original author: Iain Campbell Truskett (16.07.1979 - 29.12.2003) Maintainer: Barbie since January 2004. for Miss Barbell Productions . =head1 COPYRIGHT AND LICENSE Copyright (C) 2003 Iain Truskett. Copyright (C) 2004-2012 Barbie for Miss Barbell Productions. This module is free software; you can redistribute it and/or modify it under the Artistic License 2.0. =cut Data-Phrasebook-Loader-YAML-0.12/Changes0000644000175000017500000000356712034227574017112 0ustar barbiebarbie# Changes log for Data::Phrasebook::Loader::YAML 0.12 2012-10-07 - fixed prerequisites in META files (thanks to D Thomas RT#79204). - change file dates changed to meet W3CDTF standards. 0.11 2012-07-29 - added Carp as a prerequisite. - added Test::Distribution as a optional test prerequisite. - implemented Perl::Critic suggestions. 0.10 2012-07-29 - spelling fix. (thanks to Nicholas Bamber, Florian Schlichting & Gregor Herrmann). - removed License files from distro. - Artistic License v2 now sole license. - removed DSLIP info. - added minimum perl version (5.006). - reworked Makefile.PL for clarity. 0.09 2007-03-01 - Fixed META.yml typos. - Added META.yml test script. 0.08 2007-02-22 - Fixed a mistake in the META.yml. 0.07 2007-02-22 - Handwritten META.yml to conform to current specs. - Changed all instances of LICENCE to LICENSE as *apparently*, to all non-British users of this module, this a bug! I beg to differ - http://dictionary.reference.com/search?q=licence - Added an examples directory. Nothing in it yet, except a request for interesting scripts. 0.06 2006-09-27 - Added support for dictionaries. This was a major patch submitted by Oliver Gorwits. Thanks Oliver :) - more tests - Devel::Cover - 99.2% 0.05 2005-03-25 - Added DSLIP information - Rewrote test scripts - Devel::Cover - 97.6% 0.04 2005-03-03 - POD updates. 0.03 2005-03-02 - Removed Test::MockObject from tests. No longer needed. 0.02 2005-02-24 - revamped and renamed as part of the Data::Phrasebook framework 0.01 2004-01-31 - New maintainer - Barbie. - Extracted from main Phrasebook distribution Data-Phrasebook-Loader-YAML-0.12/MANIFEST0000644000175000017500000000054412034227574016740 0ustar barbiebarbieChanges INSTALL LICENSE MANIFEST MANIFEST.SKIP META.json META.yml Makefile.PL README examples/examples.txt lib/Data/Phrasebook/Loader/YAML.pm t/01load.t t/01phrases.yaml t/01phrases2.yaml t/02single.t t/03multi.t t/03phrases.yaml t/04default.t t/04phrases.yaml t/90podtest.t t/91podcover.t t/92distribution.t t/94metatest.t t/95changedate.t t/96metatest.t Data-Phrasebook-Loader-YAML-0.12/examples/0000755000175000017500000000000012034227612017413 5ustar barbiebarbieData-Phrasebook-Loader-YAML-0.12/examples/examples.txt0000644000175000017500000000075512034227574022010 0ustar barbiebarbieTo see examples for this distribution, it is recommended you read the test scripts included under ./t, which cover the basic usage of the modules. I may add further examples should the need ever arise. If you have any example scripts that use the distribution in an unusual way or make good use of all the features available, please feel free to submit one. If submitting an example script, please sure to include the following in your POD: * Author * License * Copyright Thanks, Barbie. Data-Phrasebook-Loader-YAML-0.12/MANIFEST.SKIP0000644000175000017500000000026512034227574017505 0ustar barbiebarbie\.sw.$ \bRCS\b \bCVS\b ^_build/ ^Build$ ^blib/ ^Makefile$ ^Phrasebook- ^MANIFEST.bak$ ^pm_to_blib$ ^Makefile.[a-z]+$ \.cvsignore$ \B\.svn\b ^diff ^patch \.patch$ ^log$ ^data\.yaml$ Data-Phrasebook-Loader-YAML-0.12/META.yml0000644000175000017500000000170312034227574017056 0ustar barbiebarbie--- #YAML:1.0 name: Data-Phrasebook-Loader-YAML version: 0.12 abstract: Loader class for phrasebook implementations using YAML files author: - Barbie license: artistic_2 distribution_type: module installdirs: site requires: perl: 5.006 Carp: 0 Data::Phrasebook: 0.24 YAML: 0.35 recommends: Test::CPAN::Meta: 0 Test::CPAN::Meta::JSON: 0 Test::Distribution: 0 Test::Pod: 1.00 Test::Pod::Coverage: 0.08 build_requires: IO::File: 0 Test::More: 0.70 provides: Data::Phrasebook::Loader::YAML: file: lib/Data/Phrasebook/Loader/YAML.pm version: 0.12 no_index: directory: - t - examples meta-spec: version: 1.3 url: http://module-build.sourceforge.net/META-spec-v1.3.html generated_by: Hand 1.0 Data-Phrasebook-Loader-YAML-0.12/META.json0000644000175000017500000000346112034227574017231 0ustar barbiebarbie{ "name": "Data-Phrasebook-Loader-YAML", "version": "0.12", "abstract": "Loader class for phrasebook implementations using YAML files", "author": [ "Barbie (BARBIE) " ], "license": "artistic_2", "dynamic_config" : 0, "release_status" : "stable", "meta-spec": { "version": "2", "url": "http://search.cpan.org/dist/CPAN-Meta/lib/CPAN/Meta/Spec.pm" }, "generated_by": "Hand 1.0", "keywords" : [ "abstract", "data", "design pattern", "phrasebook" ], "prereqs" : { "runtime" : { "requires" : { "perl": "5.006", "Carp": "0", "Data::Phrasebook": "0.24", "YAML": "0.35" } }, "test" : { "requires": { "IO::File": "0", "Test::More": "0.70" }, "recommends": { "Test::CPAN::Meta": "0", "Test::CPAN::Meta::JSON": "0", "Test::Distribution": "0", "Test::Pod": "1.00", "Test::Pod::Coverage": "0.08" } } }, "provides": { "Data::Phrasebook::Loader::YAML": { "file": "lib/Data/Phrasebook/Loader/YAML.pm", "version": "0.12" } }, "no_index": { "directory": ["t","examples"] }, "resources": { "license": "http://dev.perl.org/licenses/", "bugtracker": { "web": "http://rt.cpan.org/Public/Dist/Display.html?Name=Data-Phrasebook-Loader-YAML" }, "repository": { "url": "git://github.com/barbie/data-phrasebook-loader-yaml.git", "web": "http://github.com/barbie/data-phrasebook-loader-yaml", "type": "git" } } }Data-Phrasebook-Loader-YAML-0.12/INSTALL0000644000175000017500000000602112034227574016634 0ustar barbiebarbieInstallation Instructions The instructions are basically as per any Perl module. INSTALLING AUTOMATICALLY ------------------------ The easiest way to install is via CPAN or CPANPLUS: CPAN: % perl -MCPAN -e shell [as root] > install Data::Phrasebook::Loader::YAML > quit CPANPLUS: % cpanp > i Data::Phrasebook::Loader::YAML > q See your local 'perldoc CPAN' or 'perldoc CPANPLUS' for instructions on setting up and configuring CPAN or CPANPLUS. OBTAINING THE MODULE -------------------- The latest release version of Data::Phrasebook::Loader::YAML can be downloaded from any CPAN site: http://www.cpan.org/modules/by-authors/id/B/BA/BARBIE/ http://search.cpan.org/dist/Data-Phrasebook-Loader-YAML/ Data::Phrasebook::Loader::YAML is distributed as a gzipped tar archive file: Data-Phrasebook-Loader-YAML-.tar.gz where represents the current version number, e.g. 0.01. To install the module, unpack the distribution archive to create an installation directory. Something like this: tar zxf Data-Phrasebook-Loader-YAML-0.01.tar.gz or gunzip Data-Phrasebook-Loader-YAML-0.01.tar.gz tar xf Data-Phrasebook-Loader-YAML-0.01.tar You can then 'cd' into the directory created, cd Data-Phrasebook-Loader-YAML-0.01 INSTALLING MANUALLY ------------------- The 'make install' (done later) will install the modules and scripts on your system. You may need administrator privileges to perform this task. Alternately you can install the module to a local directory (see ExtUtils::MakeMaker for full details), e.g. % perl Makefile.PL PREFIX=/home/abw/ Don't forget to update your PERL5LIB environment variable if you do this, or add a line to your script to tell Perl where to find the files, e.g. use lib qw( /home/abw/lib/perl5/site_perl/5.6.0 ); If you're not after a custom location, just do: % perl Makefile.PL If you are lacking any of the prerequisite modules, running that program will tell you. All prerequisites are available from CPAN. When you have them all: % make && make test If there are any failures, it's best if you contact me. It may help other people who have the same problem. I don't tend to read the Perl newsgroups or PerlMonks, so it's no use posting there. When you report your trouble, be sure to send me the following information; + result of `perl -V' + output from 'make test' - ideally do 'make test TEST_VERBOSE=1 >& errs' Send those to bug-Data-Phrasebook@rt.cpan.org and I'll get back to you as soon as I'm able. If it worked, then become root and type: # make install Congratulations. You've just installed Data::Phrasebook::Loader::YAML. If you have a copy of cpantest installed, type: % cpantest -g pass -nc -p `basename \`pwd\`` -auto Or: % cpantest -g pass -nc -p Data-Phrasebook-Loader-YAML-0.01 -auto That will tell both me and other potential users that the module built correctly on your machine. cheers, Barbie. http://barbie.missbarbell.co.uk/ with much appreciation to Iain (aka Spoon). Data-Phrasebook-Loader-YAML-0.12/Makefile.PL0000644000175000017500000000127612034227574017564 0ustar barbiebarbie#!/usr/bin/perl use strict; use warnings; use 5.006; use ExtUtils::MakeMaker; WriteMakefile( AUTHOR => 'Barbie ', NAME => 'Data::Phrasebook::Loader::YAML', VERSION_FROM => 'lib/Data/Phrasebook/Loader/YAML.pm', ABSTRACT => 'Loader class for phrasebook implementations using YAML files', NO_META => 1, PREREQ_PM => { # runtime prereqs 'Carp' => '0', 'Data::Phrasebook' => '0.24', 'YAML' => '0.35', # build/test prereqs 'Test::More' => '0.70', 'IO::File' => '0' } ); Data-Phrasebook-Loader-YAML-0.12/LICENSE0000644000175000017500000000035412034227574016613 0ustar barbiebarbieLICENSE FOR Data-Phrasebook-Loader-YAML Copyright © 2003 Iain Truskett. Copyright © 2004-2012 Barbie for Miss Barbell Productions. This module is free software; you can redistribute it and/or modify it under the Artistic License 2.0. Data-Phrasebook-Loader-YAML-0.12/README0000644000175000017500000000367012034227574016472 0ustar barbiebarbieData::Phrasebook::Loader::YAML ============================== DESCRIPTION Abstract your queries ... with YAML! This distribution enables the framework for abstracting common or locale data out of your code into a datastore. The default is within a plain text file, however this distribution extends that to use YAML. DEPENDENCIES The distribution requires the following modules: Data::Phrasebook >= 0.24 YAML >= 0.35 For testing purposes, the following modules are required: Test::More >= 0.70 IO::File >= 0 For testing purposes, the following modules are desireable, but not essential: Test::CPAN::Meta >= 0 Test::CPAN::Meta::JSON >= 0 Test::Pod >= 1.00 Test::Pod::Coverage >= 0.08 Pod::Coverage >= 0 INSTALLATION To install this module type the following: perl Makefile.PL make make test make install For more detailed installation instructions, see INSTALL. USAGE Read the pod documentation in the distrubtion files. CHANGES For a complete list of changes, see the Changes file. SUPPORT If you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please send an email to barbie@cpan.org or submit a bug to the RT system (http://rt.cpan.org/). It would help greatly if you are able to pinpoint problems or even supply a patch. Fixes are dependent upon their severity and my availability. Should a fix not be forthcoming, please feel free to (politely) remind me. AUTHOR Original author: Iain Campbell Truskett (16.07.1979 - 29.12.2003) Maintainer: Barbie, for Miss Barbell Productions . COPYRIGHT AND LICENSE Copyright (C) 2004-2012 Barbie for Miss Barbell Productions. Copyright (C) 2003 Iain Truskett. This module is free software; you can redistribute it and/or modify it under the Artistic License 2.0.