disk_reporter 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46e6a848d52fd83d6115049b5ceb1036341e54e2
4
- data.tar.gz: faf3fcacc35c0b0895f4699439de044f9d2cb6e8
3
+ metadata.gz: 484e9f328a461f60e60b428851f13775d04a341d
4
+ data.tar.gz: f34d5dfaedcef95d0cc44e89d21760b95a076751
5
5
  SHA512:
6
- metadata.gz: a0432029dacf0b61c754db5d948d22d8172d9cde6ea3658c089e3b54ecbf0e277c75f5fd6ae15d04586a8fb8e598e3b7d6bbde184750e792dc3d5017effd2ed5
7
- data.tar.gz: 23bd86d8e133c4c8aa0cb93719a6d416a09254978063730245bc944efdf287423c8c48d8f8211f43054e4d948ea5a4058b17d6428e7356a3317f77977a363092
6
+ metadata.gz: 29481770822b3a2e1d2ff067237a5c5de45ea30c8b60fd026481cb4455498ee87446d3412e182323b62b7660408aee5814c9c61fcaa6f1f0300d6b06212c25ad
7
+ data.tar.gz: a33a32a173207b3d754406fab1247ab0a7c97ebd7ef15a3566e79f249eade770c861e8196044334dd847e830cb8135aae6614d2886b29d237e79f7ac4a00680f
@@ -3,7 +3,7 @@ require 'json'
3
3
  module DiskHandler
4
4
  class Disk
5
5
  attr_accessor :name, :type, :size, :model, :state, :id, :number, :version, :partitions
6
-
6
+
7
7
  def device_path
8
8
  "/dev/#{name}"
9
9
  end
@@ -13,7 +13,7 @@ class Disk
13
13
  end
14
14
 
15
15
  def wnn
16
- id.delete(' ')
16
+ id.delete(' ') unless id.nil?
17
17
  end
18
18
 
19
19
  def initialize lsblk_line
@@ -48,14 +48,14 @@ class Disk
48
48
  @smart_healthy = !output.scan(/PASSED/).empty?
49
49
  @health_output = output
50
50
  end
51
-
51
+
52
52
  # Parses SMART drive info
53
53
  #
54
54
  def parse_smart_info
55
55
  %w{Id Number Version}.each do |key|
56
56
  matches = @capability_output.match(/#{key}:\s+([^\n]*)\n/)
57
57
  self.send("#{key.downcase}=", matches[1]) if matches
58
- end
58
+ end
59
59
  end
60
60
  # Checks if disk is capable
61
61
  #
@@ -67,7 +67,7 @@ class Disk
67
67
  end
68
68
 
69
69
  def to_h
70
- { name: name, size: size, model: model, smart_available: @smart_available, smart_enabled: @smart_enabled, wnn: wnn, serial: serial_number, version: version
70
+ { name: name, size: size, model: model, smart_available: @smart_available, smart_enabled: @smart_enabled, wnn: wnn, serial: serial_number, version: version
71
71
  }
72
72
  end
73
73
 
@@ -1,3 +1,3 @@
1
1
  module DiskReporter
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disk_reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Harland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2017-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize