view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
235236237238239240241242243244245246247248249250251252253254255
else
{
$DisabledTests
{
$_
} = 1
for
map
{
glob
(
$_
) }
@tests
;
}
}
if
(
@Missing
and not(
$CheckOnly
or
$UnderCPAN
) ) {
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n"
;
# make an educated guess of whether we'll need root permission.
" (You may need to do that as the 'root' user.)\n"
if
eval
'$>'
;
}
"*** $class configuration finished.\n"
;
chdir
$cwd
;
# import to main::
no
strict
'refs'
;
*{
'main::WriteMakefile'
} = \
&Write
if
caller
(0) eq
'main'
;
inc/Module/AutoInstall.pm view on Meta::CPAN
552553554555556557558559560561562563564565566567568569570571sub
_has_cpanplus {
return
(
$HasCPANPLUS
= (
$INC
{
'CPANPLUS/Config.pm'
}
or _load(
'CPANPLUS::Shell::Default'
)
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub
_under_cpan {
my
$cwd
= File::Spec->canonpath( Cwd::cwd() );
my
$cpan
= File::Spec->canonpath(
$CPAN::Config
->{cpan_home} );
return
(
index
(
$cwd
,
$cpan
) > -1 );
}
lib/App/I18N.pm view on Meta::CPAN
434445464748495051525354555657585960616263646566676869
'Locale::Maketext::Extract::Plugin::PPI'
=> [
'pm'
,
'pl'
],
'tt2'
=> [ ],
# 'perl' => ['pl','pm','js','json'],
'perl'
=> [
'*'
],
# _( ) , gettext( ) , loc( ) ...
'mason'
=> [ ] ,
'generic'
=> [
'*'
],
},
verbose
=> 1,
warnings
=> 1 );
}
sub
guess_appname {
return
lc
(basename(getcwd()));
}
sub
pot_name {
my
$self
=
shift
;
return
guess_appname();
}
sub
_check_mime_type {
my
$self
=
shift
;
my
$local_path
=
shift
;
my
$mimeobj
=
$MIME
->mimeTypeOf(
$local_path
);
my
$mime_type
= (
$mimeobj
?
$mimeobj
->type :
"unknown"
);
return
if
(
$mime_type
=~ /^image/ );
return
if
(
$mime_type
=~ /compressed/ );
# ignore compressed archive files
lib/App/I18N.pm view on Meta::CPAN
118119120121122123124125126127128129130131132133134135136137138
if
(
$cmd
->{mo} ) {
my
$mofile
=
$translation
;
$mofile
=~ s{\.po$}{.mo};
$logger
->info(
"Generating MO file: $mofile"
);
system
(
qq{msgfmt -v $translation -o $mofile}
);
}
}
sub
guess_podir {
my
(
$class
,
$cmd
) =
@_
;
my
$podir
;
$podir
=
'po'
if
-e
'po'
;
$podir
=
'locale'
,
$cmd
->{locale} = 1
if
-e
'locale'
;
$podir
||=
'locale'
if
$cmd
->{locale};
$podir
||=
'po'
;
return
$podir
;
}
sub
get_po_path {
lib/App/I18N/Command/Auto.pm view on Meta::CPAN
383940414243444546474849505152535455565758unless
(
$self
->{from} ) {
return
$logger
->error(
"--from [Language] is required. please specify your language to translate."
);
}
# XXX: check this option
$self
->{backend} ||=
'rest-google'
;
my
$podir
=
$self
->{podir};
$podir
= App::I18N->guess_podir(
$self
)
unless
$podir
;
$self
->{mo} = 1
if
$self
->{locale};
mkpath [
$podir
];
my
$pot_name
= App::I18N->pot_name;
my
$potfile
= File::Spec->catfile(
$podir
,
$pot_name
.
".pot"
) ;
if
( ! -e
$potfile
) {
$logger
->info(
"$potfile not found."
);
return
;
}
lib/App/I18N/Command/Gen.pm view on Meta::CPAN
828384858687888990919293949596979899100101102LAST UPDATE:
$now
END
}
sub
run {
my
(
$self
,
$type
) =
@_
;
my
$output_dir
=
$self
->{output_dir} || getcwd();
my
$logger
= App::I18N->logger();
my
$podir
=
$self
->{podir};
$podir
= App::I18N->guess_podir(
$self
)
unless
$podir
;
$self
->{mo} = 1
if
$self
->{locale};
File::Path::mkpath [
$output_dir
];
if
(
$self
->{locale} ) {
}
else
{
lib/App/I18N/Command/Lang.pm view on Meta::CPAN
515253545556575859606162636465666768697071
$self
->logger->info(
"Generating MO file: $mofile"
);
system
(
qq{msgfmt -v $pofile -o $mofile}
);
}
}
sub
run {
my
(
$self
,
@langs
) =
@_
;
my
$logger
=
$self
->logger();
my
$podir
=
$self
->{podir};
$podir
= App::I18N->guess_podir(
$self
)
unless
$podir
;
$self
->{mo} = 1
if
$self
->{locale};
mkpath [
$podir
];
my
$pot_name
= App::I18N->pot_name;
my
$potfile
= File::Spec->catfile(
$podir
,
$pot_name
.
".pot"
) ;
if
( ! -e
$potfile
) {
$logger
->info(
"$potfile not found."
);
return
;
lib/App/I18N/Command/Parse.pm view on Meta::CPAN
525354555657585960616263646566676869707172
_(
"Hello %1"
, \
$world
);
}
END
}
sub
run {
my
(
$self
,
@args
) =
@_
;
my
$podir
=
$self
->{podir};
$podir
= App::I18N->guess_podir(
$self
)
unless
$podir
;
$self
->{mo} = 1
if
$self
->{locale};
my
@dirs
=
@args
;
App::I18N->extract_messages(
@dirs
);
# update app.pot catalog
mkpath [
$podir
];
my
$pot_name
= App::I18N->pot_name;
App::I18N->update_catalog( File::Spec->catfile(
$podir
,
$pot_name
.
".pot"
) );
lib/App/I18N/Command/Server.pm view on Meta::CPAN
353637383940414243444546474849505152535455# }
#
sub
run {
my
(
$self
) =
@_
;
$self
->{mo} = 1
if
$self
->{locale};
my
$podir
=
$self
->{podir};
$podir
= App::I18N->guess_podir(
$self
)
unless
$podir
;
my
@dirs
= @{
$self
->{directories} || [] };
my
$logger
= App::I18N->logger;
# pre-process messages
my
$lme
= App::I18N->lm_extract;
if
(
@dirs
) {
App::I18N->extract_messages(
@dirs
);
mkpath [
$podir
];
App::I18N->update_catalog(
lib/App/I18N/Command/Status.pm view on Meta::CPAN
232425262728293031323334353637383940414243
"="
x (
$value_width
);
" "
x (
$rest_width
);
"]"
;
}
sub
run {
my
$self
=
shift
;
my
$logger
=
$self
->logger();
my
$podir
=
$self
->{podir};
$podir
= App::I18N->guess_podir(
$self
)
unless
$podir
;
$self
->{mo} = 1
if
$self
->{locale};
"Translation Status:\n"
;
my
@pofiles
= File::Find::Rule->file->name(
"*.po"
)->in(
$podir
);
for
my
$pofile
(
@pofiles
) {
my
$extract
= Locale::Maketext::Extract->new;
my
$lang
;
if
(
$self
->{locale} ) {
lib/App/I18N/Command/Update.pm view on Meta::CPAN
121314151617181920212223242526272829303132sub
options { (
'podir=s'
=>
'podir'
,
'mo'
=>
'mo'
,
# generate mo file
'locale'
=>
'locale'
,
) }
sub
run {
my
(
$self
,
$lang
) =
@_
;
my
$logger
= App::I18N->logger();
my
$podir
=
$self
->{podir};
$podir
= App::I18N->guess_podir(
$self
)
unless
$podir
;
$self
->{mo} = 1
if
$self
->{locale};
my
@pofiles
= File::Find::Rule->file->name(
"*.po"
)->in(
$podir
);
for
my
$pofile
(
@pofiles
) {
$logger
->info(
"Updating $pofile"
);
if
(
$self
->{mo} ) {
my
$mofile
=
$pofile
;
$mofile
=~ s{\.po$}{.mo};
$logger
->info(
"Updating $mofile"
);
qx{msgfmt -v $pofile -o $mofile}
;
share/static/Stream.js view on Meta::CPAN
162163164165166167168169170171172173174175176177178179180181182
}
else
{
//No
//Grab from the start of the start flag to the end of the chunk
this.currentStream += packet.
substr
(startFlag);
//Leave this.currentStream set and
wait
for
another packet
}
}
else
{
//WTF? No
open
stream and
no
start flag means someone fucked up the output
//...OR maybe they're sending garbage in front of their first payload. Weird.
//I guess just ignore it
for
now?
}
//Else we have an
open
stream
}
else
{
//Is there an end flag?
if
(endFlag > -1) {
//Yes
//Use the end flag to grab the rest of the payload
var chunk = packet.substring(0, endFlag);
this.currentStream += chunk;