<commit_before>=pod

=head1 LICENSE

  Copyright (c) 1999-2013 The European Bioinformatics Institute and
  Genome Research Limited.  All rights reserved.

  This software is distributed under a modified Apache license.
  For license details, please see

    http://www.ensembl.org/info/about/code_licence.html

=head1 CONTACT

  Please email comments or questions to the public Ensembl
  developers list at <<EMAIL>>.

  Questions may also be sent to the Ensembl help desk at
  <<EMAIL>>.

=head1 NAME

Bio::EnsEMBL::Production::Pipeline::EBeye::DumpReleaseNotesFile

=head1 DESCRIPTION

Module responsible for creating the release_note.txt file.

Allowed parameters are:

=over 8

=item release - The current release we are emitting

=item release_date - The current release date we are emitting

=back

=cut

package Bio::EnsEMBL::Production::Pipeline::EBeye::DumpReleaseNotesFile;

use strict;
use warnings;

use Bio::EnsEMBL::Utils::Exception qw/throw/;
use Bio::EnsEMBL::Utils::IO qw/work_with_file/;

use base qw/Bio::EnsEMBL::Production::Pipeline::EBeye::Base/;

sub fetch_input {
  my ($self) = @_;
  
  throw "Need a release" unless $self->param('release');
  throw "Need a release date" unless $self->param('release_date');

  $self->assert_executable('zgrep');
  
  return;
}

sub run {
  my ($self) = @_;

  my $dir = $self->data_path();
  $self->info('Analysing directory %s', $dir);

  opendir(my $dh, $dir) or die "Cannot open directory $dir";
  my @files = sort { $a cmp $b } readdir($dh);
  closedir($dh) or die "Cannot close directory $dir";

  my $release_notes = 
    {
     'release' => $self->param('release'),
     'release_date' => $self->param('release_date'),
     'entry_count' => 0
    };

  foreach my $file (@files) {
    next unless $file =~ /xml/;
    
    my $path = File::Spec->catfile($dir, $file);<commit_msg>stricter searching of files to avoid counting any extra uncompressed data sets in the dir caused by idiots like me<commit_after>=pod

=head1 LICENSE

  Copyright (c) 1999-2013 The European Bioinformatics Institute and
  Genome Research Limited.  All rights reserved.

  This software is distributed under a modified Apache license.
  For license details, please see

    http://www.ensembl.org/info/about/code_licence.html

=head1 CONTACT

  Please email comments or questions to the public Ensembl
  developers list at <<EMAIL>>.

  Questions may also be sent to the Ensembl help desk at
  <<EMAIL>>.

=head1 NAME

Bio::EnsEMBL::Production::Pipeline::EBeye::DumpReleaseNotesFile

=head1 DESCRIPTION

Module responsible for creating the release_note.txt file.

Allowed parameters are:

=over 8

=item release - The current release we are emitting

=item release_date - The current release date we are emitting

=back

=cut

package Bio::EnsEMBL::Production::Pipeline::EBeye::DumpReleaseNotesFile;

use strict;
use warnings;

use Bio::EnsEMBL::Utils::Exception qw/throw/;
use Bio::EnsEMBL::Utils::IO qw/work_with_file/;

use base qw/Bio::EnsEMBL::Production::Pipeline::EBeye::Base/;

sub fetch_input {
  my ($self) = @_;
  
  throw "Need a release" unless $self->param('release');
  throw "Need a release date" unless $self->param('release_date');

  $self->assert_executable('zgrep');
  
  return;
}

sub run {
  my ($self) = @_;

  my $dir = $self->data_path();
  $self->info('Analysing directory %s', $dir);

  opendir(my $dh, $dir) or die "Cannot open directory $dir";
  my @files = sort { $a cmp $b } readdir($dh);
  closedir($dh) or die "Cannot close directory $dir";

  my $release_notes = 
    {
     'release' => $self->param('release'),
     'release_date' => $self->param('release_date'),
     'entry_count' => 0
    };

  foreach my $file (@files) {
    next unless $file =~ /\.xml\.gz/;
    
    my $path = File::Spec->catfile($dir, $file);
{'fraction_non_alphanumeric': 0.1290492494074269, 'fraction_numerical': 0.007374242823281538, 'mean_word_length': 4.1603260869565215, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6817234', 'n_tokens_mistral': 1312, 'n_tokens_neox': 1224, 'n_words': 388}