From 4879437a0f628b3d685a3972695aed5011622ca4 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 9 Oct 2011 10:36:40 -0500 Subject: update dzil stuff --- lib/Locale/POFileManager.pm | 42 ++++++++++++++-------------------------- lib/Locale/POFileManager/File.pm | 42 ++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 52 deletions(-) (limited to 'lib') diff --git a/lib/Locale/POFileManager.pm b/lib/Locale/POFileManager.pm index 5ac7e35..9d4fffd 100644 --- a/lib/Locale/POFileManager.pm +++ b/lib/Locale/POFileManager.pm @@ -2,10 +2,7 @@ package Locale::POFileManager; use Moose; use MooseX::Types::Path::Class qw(Dir); use Scalar::Util qw(reftype weaken); - -=head1 NAME - -Locale::POFileManager - Helpers for keeping a set of related .po files in sync +# ABSTRACT: Helpers for keeping a set of related .po files in sync =head1 SYNOPSIS @@ -29,9 +26,7 @@ the L parser library. =cut -=head1 METHODS - -=head2 new +=method new Accepts a hash of arguments: @@ -54,9 +49,7 @@ C. Optional. =back -=cut - -=head2 base_dir +=method base_dir Returns a L object corresponding to the C passed to the constructor. @@ -70,7 +63,7 @@ has base_dir => ( coerce => 1, ); -=head2 files +=method files Returns a list of L objects corresponding to the .po files that were found in the C. @@ -110,7 +103,7 @@ sub _build_files { return \@files; } -=head2 canonical_language +=method canonical_language Returns the canonical language id passed to the constructor. @@ -135,7 +128,7 @@ sub BUILD { unless $self->has_language($self->canonical_language); } -=head2 stub_msgstr +=method stub_msgstr Returns the string passed to the constructor as C if it was a string, or a coderef wrapped to supply the C option if it was @@ -163,7 +156,7 @@ sub stub_msgstr { } } -=head2 has_language +=method has_language Returns true if a language file exists for the given language in the C, false otherwise. @@ -181,7 +174,7 @@ sub has_language { return; } -=head2 add_language +=method add_language Creates a new language file for the language passed in as an argument. Creates a header for that file copied over from the header in the C @@ -223,7 +216,7 @@ sub add_language { $self->_add_file($pofile); } -=head2 language_file +=method language_file Returns the L object corresponding to the given language. @@ -239,7 +232,7 @@ sub language_file { }); } -=head2 canonical_language_file +=method canonical_language_file Returns the L object corresponding to the C. @@ -251,7 +244,7 @@ sub canonical_language_file { return $self->language_file($self->canonical_language); } -=head2 find_missing +=method find_missing Searches through all of the files in the C, and returns a hash mapping language names to an arrayref of msgids that were found in the @@ -271,7 +264,7 @@ sub find_missing { return %ret; } -=head2 add_stubs +=method add_stubs Adds stub msgid (and possibly msgstr, if the C option was given) entries to each language file for each msgid found in the C @@ -335,16 +328,11 @@ L =back -=head1 AUTHOR - - Jesse Luehrs - -=head1 COPYRIGHT AND LICENSE +=begin Pod::Coverage -This software is copyright (c) 2010 by Jesse Luehrs. +BUILD -This is free software; you can redistribute it and/or modify it under -the same terms as perl itself. +=end Pod::Coverage =cut diff --git a/lib/Locale/POFileManager/File.pm b/lib/Locale/POFileManager/File.pm index 2b38cef..88bb4a0 100644 --- a/lib/Locale/POFileManager/File.pm +++ b/lib/Locale/POFileManager/File.pm @@ -1,5 +1,6 @@ package Locale::POFileManager::File; use Moose; +# ABSTRACT: A single .po file use MooseX::Types::Path::Class qw(File); use List::MoreUtils qw(any); @@ -11,10 +12,6 @@ require Locale::Maketext::Lexicon; Locale::Maketext::Lexicon::set_option(decode => 1); Locale::Maketext::Lexicon::set_option(allow_empty => 1); -=head1 NAME - -Locale::POFileManager::File - A single .po file - =head1 SYNOPSIS use Locale::POFileManager; @@ -40,9 +37,7 @@ manipulating the translation entries in it. =cut -=head1 METHODS - -=head2 new +=method new Accepts a hash of arguments: @@ -62,7 +57,7 @@ and C. Optional. =cut -=head2 file +=method file Returns a L object corresponding to the C passed to the constructor. @@ -76,7 +71,7 @@ has file => ( required => 1, ); -=head2 stub_msgstr +=method stub_msgstr Returns the C passed to the constructor. @@ -87,15 +82,15 @@ has stub_msgstr => ( isa => 'Str|CodeRef', ); -=head2 msgids +=method msgids Returns a list of msgids found in the file. -=head2 has_msgid +=method has_msgid Returns true if the given msgid is found in the file, and false otherwise. -=head2 msgstr +=method msgstr Returns the msgstr that corresponds with the given msgid. @@ -118,11 +113,11 @@ has lexicon => ( }, ); -=head2 headers +=method headers Returns the list of header entries. -=head2 header +=method header Returns the value of the given header entry. @@ -156,7 +151,7 @@ sub BUILD { $self->headers; } -=head2 add_entry +=method add_entry Adds an entry to the translation file. Arguments are a hash, with valid keys being C and C. @@ -182,7 +177,7 @@ sub add_entry { $self->_add_lexicon_entry($msgid => $msgstr); } -=head2 language +=method language Returns the language that this file corresponds to. @@ -195,7 +190,7 @@ sub language { return $language; } -=head2 find_missing_from +=method find_missing_from Takes another translation file (either as a filename or as a L object), and returns a list of msgids that the @@ -217,7 +212,7 @@ sub find_missing_from { return @ret; } -=head2 add_stubs_from +=method add_stubs_from Takes another translation file (either as a filename or as a L object), and adds stubs for each msgid that the @@ -244,16 +239,13 @@ sub add_stubs_from { __PACKAGE__->meta->make_immutable; no Moose; -=head1 AUTHOR - - Jesse Luehrs +=pod -=head1 COPYRIGHT AND LICENSE +=begin Pod::Coverage -This software is copyright (c) 2010 by Jesse Luehrs. +BUILD -This is free software; you can redistribute it and/or modify it under -the same terms as perl itself. +=end Pod::Coverage =cut -- cgit v1.2.3-54-g00ecf