Aozora2Epub
view release on metacpan or search on metacpan
lib/Aozora2Epub/Epub.pm view on Meta::CPAN
}
sub render {
my ($self, $template, $args) = @_;
$self->render_to($template, $template, $args);
}
sub write_string {
my ($self, $bin, $to) = @_;
my $dest = $self->dest_file($to);
$dest->spew({binmode => ":raw"}, $bin);
}
sub files_in_dir {
my $dir = shift;
my @files;
File::Find::find(sub { push @files, $File::Find::name unless -d || /^\./ },
$dir);
return \@files;
}
script/aozora2epub view on Meta::CPAN
#!perl
use utf8;
use strict;
use warnings;
use Aozora2Epub;
use Getopt::Long;
use Path::Tiny;
our $VERSION = '0.03';
binmode(STDERR, "utf8");
binmode(STDOUT, "utf8");
my $cmd_name = path($0)->basename;
my ($output, $title, $author, $cover, $no_okuzuke, $use_subtitle);
Getopt::Long::Configure ("bundling");
GetOptions("o|output=s" => \$output,
"t|title=s" => \$title,
"a|author=s" => \$author,
"use-subtitle" => \$use_subtitle,
"c|cover=s" => \$cover,
package t::Util;
use strict;
use warnings;
use utf8;
use Path::Tiny;
use File::ShareDir;
use Test::More;
$File::ShareDir::DIST_SHARE{'Aozora2Epub'} = path('share')->absolute;
binmode(STDERR, "utf8");
binmode(STDOUT, "utf8");
{
# utf8 hack from Amon2
binmode Test::More->builder->$_, ":utf8" for qw/output failure_output todo_output/;
no warnings 'redefine';
my $code = \&Test::Builder::child;
*Test::Builder::child = sub {
my $builder = $code->(@_);
binmode $builder->output, ":utf8";
binmode $builder->failure_output, ":utf8";
binmode $builder->todo_output, ":utf8";
return $builder;
};
}
1;
( run in 0.416 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )