Commit 031fd477 authored by smoretti's avatar smoretti

Clean and format Description & Summary better

parent f923fad2
......@@ -6,7 +6,7 @@ use diagnostics;
# Sebastien Moretti from the Vital-IT (http://www.vital-it.ch) Center
# for high-performance computing of the SIB Swiss Institute of Bioinformatics.
my $VERSION = '0.1.4';
my $VERSION = '0.1.5';
use Cwd 'abs_path';
use DateTime;
......@@ -15,6 +15,7 @@ use File::Slurp;
use Getopt::Long;
use List::MoreUtils qw(uniq);
use LWP::Simple;
use Text::Format;
# Configuration
......@@ -183,11 +184,18 @@ if ( -e "$desc_file" && -s "$desc_file" ){
push @Deps, map { trim($_) }
split(/ *, */, $requirements);
# Fix extra spaces
$Description =~ s{ +}{}mg;
# Clean and format Description & Summary
my $text = Text::Format->new;
$text->firstIndent(0);
$text->justify(1);
chomp $Description;
$Description =~ s{\n}{ }g;
$Description =~ s{ +}{ }g;
$Description .= '.' if ( $Description !~ /[\.\!\?]$/ );
$Description = $text->format($Description);
chomp $Description;
$Description .= '.' if ( $Description !~ /[\.\!\?]$/ );
$Summary =~ s{ +}{ }mg;
$Summary =~ s{ *Authors\@R.+}{};
$Summary = trim($Summary);
$Summary =~ s{\.$}{} if ( $Summary !~ /\.\.$/ );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment