فهرست منبع

Updated regex to get disk temperature to look for two different lines that could contain temp
Corrected get_disk_attributes() to return hash correctly on Perl < 5.14

Paul Trost 11 سال پیش
والد
کامیت
188dc2f235
5فایلهای تغییر یافته به همراه18 افزوده شده و 8 حذف شده
  1. 4 0
      Changes
  2. 9 5
      Makefile.PL
  3. BIN
      dist/Disk-SMART-0.10.tar.gz
  4. 2 2
      lib/Disk/SMART.pm
  5. 3 1
      t/01-function_tests.t

+ 4 - 0
Changes

@@ -1,5 +1,9 @@
 Revision history for Disk-SMART
 
+0.10	2014-10-18
+	Updated regex to get disk temperature to look for two different lines that could contain temp
+	Corrected get_disk_attributes() to return hash correctly on Perl < 5.14
+
 0.09    2014-10-17 
         Minor changes to get unit tests to pass on smokers
         Added testing of env parameter for smartctl path, which will enable multi OS support

+ 9 - 5
Makefile.PL

@@ -10,9 +10,11 @@ WriteMakefile(
     MIN_PERL_VERSION => '5.010',
     ABSTRACT_FROM    => 'lib/Disk/SMART.pm',
     PL_FILES         => {},
-    TEST_REQUIRES    => {
-        'Test::More'  => 0,
-        'Test::Fatal' => 0,
+    TEST_REQUIRES => {
+        'Test::More'          => 0,
+        'Test::Fatal'         => 0,
+        'Test::Pod'           => 0,
+        'Test::Pod::Coverage' => 0,
     },
     PREREQ_PM => {
         'Math::Round' => 0,
@@ -40,8 +42,10 @@ WriteMakefile(
             },
             test => {
                 requires => {
-                    'Test::More'  => 0,
-                    'Test::Fatal' => 0,
+                    'Test::More'          => 0,
+                    'Test::Fatal'         => 0,
+                    'Test::Pod'           => 0,
+                    'Test::Pod::Coverage' => 0,
                 }
             }
         }

BIN
dist/Disk-SMART-0.10.tar.gz


+ 2 - 2
lib/Disk/SMART.pm

@@ -6,7 +6,7 @@ use Carp;
 use Math::Round;
 
 {
-    $Disk::SMART::VERSION = '0.09'
+    $Disk::SMART::VERSION = '0.10'
 }
 
 our $smartctl = qx(which smartctl);
@@ -71,7 +71,7 @@ sub get_disk_attributes {
     my ( $self, $device ) = @_;
     $self->_validate_param($device);
 
-    return $self->{'devices'}->{$device}->{'attributes'};
+    return %{ $self->{'devices'}->{$device}->{'attributes'} };
 }
 
 

+ 3 - 1
t/01-function_tests.t

@@ -108,7 +108,9 @@ is( $smart->get_disk_temp($disk), 2, 'get_disk_temp() returns device temperature
 is( $smart->get_disk_health($disk), 'PASSED', 'get_disk_health() returns health status' );
 is( $smart->get_disk_model($disk), 'ST3250410AS', 'get_disk_model() returns device model' );
 is( $smart->get_disk_errors($disk), 'No Errors Logged', 'get_disk_errors() returns proper string' );
-is( scalar( keys $smart->get_disk_attributes($disk) ), 18, 'get_disk_attributes() returns hash of device attributes' );
+
+my %attribs = $smart->get_disk_attributes($disk);
+is( keys %attribs, 18, 'get_disk_attributes() returns hash of device attributes' );
 is( $smart->run_short_test($disk), 'Completed without error', 'run_short_test() returns proper string' );
 
 $ENV{'MOCK_TEST_DATA'} =~ s/ST3250410AS//;