Skip to content

Commit

Permalink
Merge pull request #176 from hathitrust/173_dedicated_version_module
Browse files Browse the repository at this point in the history
Addresses #173 Move our $VERSION from cgi/CRMS.pm to a dedicated file
  • Loading branch information
moseshll authored Apr 29, 2024
2 parents ed0f462 + b1ce867 commit c361576
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ my ($mm) = $ExtUtils::MakeMaker::VERSION =~ /^([^_]+)/;

WriteMakefile(
NAME => 'CRMS',
VERSION_FROM => 'cgi/CRMS.pm',
VERSION_FROM => 'lib/CRMS/Version.pm',
test => {RECURSIVE_TEST_FILES => 1}
);
7 changes: 3 additions & 4 deletions cgi/CRMS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use Unicode::Normalize;
use XML::LibXML;

use CRMS::Config;
use CRMS::Version;
use Utilities;

binmode(STDOUT, ':encoding(UTF-8)');
Expand Down Expand Up @@ -66,10 +67,8 @@ sub new
return $self;
}

our $VERSION = '8.6.4';
sub Version
{
return $VERSION;
sub Version {
return $CRMS::Version::VERSION;
}

# First, try to establish the identity of the user as represented in the users table.
Expand Down
8 changes: 8 additions & 0 deletions lib/CRMS/Version.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package CRMS::Version;

use strict;
use warnings;

our $VERSION = '8.6.4';

1;
4 changes: 4 additions & 0 deletions t/CRMS.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ my $cgi = CGI->new();
my $crms = CRMS->new('cgi' => $cgi, 'verbose' => 0);
ok(defined $crms, 'CRMS object created');

subtest '#Version' => sub {
ok($crms->Version);
};

subtest 'CRMS::MoveToHathitrustFiles' => sub {
my $tempdir = File::Temp::tempdir(CLEANUP => 1);
my $save_hathitrust_files_directory = $ENV{'CRMS_HATHITRUST_FILES_DIRECTORY'};
Expand Down

0 comments on commit c361576

Please sign in to comment.