@jjmerelo
/JMERELO@CPAN
jj.github.io/literaturame
language: perl
perl:
- "5.16"
before_install:
- sudo apt-get update -qq
- sudo apt-get -y install libhunspell-1.3-0 libhunspell-dev
- echo "use Test::Text;just_check( 'text','/usr/share/hunspell' );" > just_check.t
install: cpanm ExtUtils::PkgConfig Test::Text TAP::Harness
script: >
perl -MTAP::Harness -e 'use utf8;
my $harness = TAP::Harness->new( { verbosity => 0} );
die "FAIL" if $harness->runtests( "just_check.t" )->failed;'
my $dir = shift || ".";
my @logs = glob("$dir/log*.log");
my @data;
for my $l ( @logs ) {
my ($number) = ( $l =~ /log-(\d+)/);
my $file_content = read_file ($l );
if ( $file_content =~ /Tests=(\d+)/ ) {
$data[$number] = $1;
}
}
say "Commit,Words,Delta";
my $old_number_of_words = 0;
for (my $i = 0; $i <=$#data; $i ++ ) {
if ( $data[$i] ) {
say "$i, $data[$i], ", $data[$i]- $old_number_of_words;
$old_number_of_words = $data[$i];
}
}
self-organizing
IS they tune themselvescritical
IS changes can cause any effectscale-invariant
IS no average scalelong-distance
IS exactly that.pink noise
IS ...my $repo = Git->repository (Directory => $dir);
my @filespec = split(/ /,$filespec);
my @revs = $repo->command('rev-list', '--all', '--', @filespec);
my @data = ("Lines changed");
my $prev_commit = pop @revs; #Throwaway first commit
$prev_commit = pop @revs;
for my $commit ( reverse @revs ) {
my $file_contents = $repo->command('diff','--shortstat', "$commit..$prev_commit", "--", @filespec );
my ($insertions) = ($file_contents =~ /(\d+)\s+insertion\S+/s);
my ($deletions) = ($file_contents =~ /(\d+)\s+deletion\S+/s);
$insertions = $insertions || 0; $deletions = $deletions || 0;
my $lines_changed = ($insertions > $deletions)?$insertions:$deletions;
push @data, $lines_changed;
$prev_commit = $commit;
}