From 79fb61a9916a597ca47b3ad045487bf341d31e06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20Kusalananda=20K=C3=A4h=C3=A4ri?=
 <ak4@sanger.ac.uk>
Date: Thu, 12 Aug 2010 13:50:35 +0000
Subject: [PATCH] Make the registry use the new ApiVersion module.

---
 modules/Bio/EnsEMBL/Registry.pm | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

diff --git a/modules/Bio/EnsEMBL/Registry.pm b/modules/Bio/EnsEMBL/Registry.pm
index 086d252e6b..57128abe53 100644
--- a/modules/Bio/EnsEMBL/Registry.pm
+++ b/modules/Bio/EnsEMBL/Registry.pm
@@ -32,7 +32,6 @@ Bio::EnsEMBL::Registry
 
   $gene_adaptor = $registry->get_adaptor( 'Human', 'Core', 'Gene' );
 
-
 =head1 DESCRIPTION
 
 All Adaptors are stored/registered using this module. This module should
@@ -125,12 +124,12 @@ use Bio::EnsEMBL::DBSQL::DBAdaptor;
 use Bio::EnsEMBL::Utils::Exception qw( deprecate throw warning );
 use Bio::EnsEMBL::Utils::Argument qw(rearrange);
 use Bio::EnsEMBL::Utils::ConfigRegistry;
+use Bio::EnsEMBL::ApiVersion;
+
 use DBI;
 
 use vars qw(%registry_register);
 
-my $API_VERSION = 59;
-
 # This is a map from group names to Ensembl DB adaptors.  Used by
 # load_all() and reset_DBAdaptor().
 my %group2adaptor = (
@@ -1426,7 +1425,7 @@ sub load_registry_from_db {
   my @dbnames = map { $_->[0] } @$res;
 
   my %temp;
-  my $software_version = $self->software_version();
+  my $software_version = software_version();
 
   if ( defined($db_version) ) {
     $software_version = $db_version;
@@ -2298,21 +2297,6 @@ sub add_new_tracks{
 
 }
 
-=head2 software_version
-  
-  get the software version.
-  
-  Args       : none
-  ReturnType : int
-  Status     : At Risk
-  
-=cut
-  
-sub software_version{
-  my ($self) = @_;
-  return $API_VERSION;
-}
-  
 =head2 no_version_check
   
   getter/setter for whether to run the version checking
@@ -2397,7 +2381,7 @@ sub version_check {
     }
   } ## end if ( $database_version...
 
-  if ( $database_version != $API_VERSION ) {
+  if ( $database_version != software_version() ) {
     warn(
       sprintf(
         "For %s there is a difference in the software release (%s) "
@@ -2405,7 +2389,7 @@ sub version_check {
           . "You should update one of these to ensure that your script "
           . "does not crash.\n",
         $dba->dbc()->dbname(),
-        $API_VERSION, $database_version
+        software_version(), $database_version
       ) );
     return 0;
   }
-- 
GitLab