App-Followme
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/App/Followme.pm view on Meta::CPAN
$self->{configuration}{case_sensitive} =
$self->check_sensitivity($configuration_files[0]);
return;
}
#----------------------------------------------------------------------
# Update files in one folder
sub update_folder {
my ($self, $directory, $configuration_files, %configuration) = @_;
my $configuration_file = shift(@$configuration_files) ||
catfile($directory, $self->{configuration_file});
my ($base_directory, $filename) = fio_split_filename($configuration_file);
my ($run_before, $run_after);
if (-e $configuration_file) {
%configuration = $self->read_configuration($configuration_file,
lib/App/Followme/ConvertPage.pm view on Meta::CPAN
$new_filename =~ s/ +/\-/g;
$new_filename = catfile($dir, join('.', $new_filename, $ext));
return $new_filename;
}
#----------------------------------------------------------------------
# Convert a single file
sub update_file {
my ($self, $folder, $prototype, $file) = @_;
my $new_file = $self->{data}->convert_filename($file);
my $page = $self->render_file($self->{template_file}, $file);
$page = $self->reformat_file($prototype, $new_file, $page);
$self->write_file($new_file, $page);
return;
}
#----------------------------------------------------------------------
# Find files in directory to convert and do that
sub update_folder {
my ($self, $folder) = @_;
my $index_file = $self->to_file($folder);
my $source_folder = $self->{data}->convert_source_directory($folder);
return unless $source_folder;
my $same_directory = fio_same_file($folder, $source_folder,
$self->{case_sensitivity});
$index_file = $self->to_file($source_folder);
lib/App/Followme/CreateIndex.pm view on Meta::CPAN
sub setup {
my ($self) = @_;
$self->{data}{exclude_index} = 1;
return;
}
#----------------------------------------------------------------------
# Find files in directory to convert and do that
sub update_folder {
my ($self, $folder) = @_;
my $index_file = $self->to_file($folder);
my $base_index_file = $self->to_file($self->{data}{base_directory});
my $template_file = $self->get_template_name($self->{template_file});
my $newest_file = $self->{data}->build('newest_file', $base_index_file);
unless (fio_is_newer($index_file, $template_file, @$newest_file) &&
lib/App/Followme/EditSections.pm view on Meta::CPAN
push(@output, $token) unless $self->{remove_comments};
}
}
return join('', @output);
}
#----------------------------------------------------------------------
# Strip file of comments and combine with prototype
sub update_file {
my ($self, $file, $prototype) = @_;
my $page = $self->strip_comments($file, 0);
$page = $self->update_page($page, $prototype);
fio_write_page($file, $page);
return;
}
#----------------------------------------------------------------------
# Parse prototype and page and combine them
sub update_page {
my ($self, $page, $prototype) = @_;
my @output;
my $notfound;
while ($prototype =~ /(<!--\s*(?:end)?section\s+.*?-->)/g) {
my $comment = $1;
my $pos = pos($prototype);
my $after = $comment =~ /<!--\s*end/;
# locate the position of the comment from the prototype in the page
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.528 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )