kanrisuru 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e165b21ec0ad68281ccbb6dd27277d5fe77833d9c27382f8c5233dc93c128ba8
4
- data.tar.gz: 2ab686965334402864a17586c1e45724d3163a4ed84833f4b904dc0834e1bb68
3
+ metadata.gz: 3cf097324010e600d653651749e4269d4befe7e2b6ccc1b17cc2b31ee53d1991
4
+ data.tar.gz: febb4bc33e7a1a1810c00d1deddd5c39a30ae961f74204245277984274b2d2b7
5
5
  SHA512:
6
- metadata.gz: 88820369f4d9f10dbe9d4200cecc4804aff4ddb29322cd4c7dd399c1739b2f2736ac6e2346666717e5949a3bbac0cbcf12a2e681706f591c93d9da4144b4c035
7
- data.tar.gz: 6f1eadc3de432097d35dbf5f42b3fc3a9d9b6eabf3cc697551ea71f9b6547875f36407d821e61ec9bfc257d76f96f4e7dcd2d0ae2c65baab03b32f34f2618411
6
+ metadata.gz: bccf90abb47b07d52bcf2e791830e38380e009ef19fad30f896d979325f6133c5531676b3d3e79555c9090624f15794ec8884d9c889e57c1a150258107b39e3a
7
+ data.tar.gz: d5f17fc9c9a6f80257d5bf54ee1d2e28aa48d9de0859b7abda2f8ed695b1003aff98c3f2ee75b3dc5317eb7b9d8c947b205133b9b92f0d8af727f9d827ed4b45
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## Kanrisuru 0.8.6 (August 21, 2021) ##
2
+ * Add `minimum_io_size`, `physical_sector_size`, and `logical_sector_size` to the blkid low level disk probe for devices.
3
+
1
4
  ## Kanrisuru 0.8.5 (August 20, 2021) ##
2
5
  * Add `summarize` option to `du` command. This will only output a total disk usage size for the entire directory versus disk usage for each file individually.
3
6
 
@@ -22,7 +22,8 @@ module Kanrisuru
22
22
  BlkidDevice = Struct.new(
23
23
  :name, :label, :uuid, :type, :uuid_sub, :label_fatboot, :version, :usage,
24
24
  :part_uuid, :part_entry_scheme, :part_entry_uuid, :part_entry_type,
25
- :part_entry_number, :part_entry_offset, :part_entry_size, :part_entry_disk
25
+ :part_entry_number, :part_entry_offset, :part_entry_size, :part_entry_disk,
26
+ :minimum_io_size, :physical_sector_size, :logical_sector_size,
26
27
  )
27
28
 
28
29
  def du(opts = {})
@@ -32,9 +33,7 @@ module Kanrisuru
32
33
 
33
34
  command = Kanrisuru::Command.new('du')
34
35
  command.append_flag('-s', summarize)
35
-
36
36
  command << path if Kanrisuru::Util.present?(path)
37
-
38
37
  command | "awk '{print \\$1, \\$2}'"
39
38
 
40
39
  execute_shell(command)
@@ -101,7 +100,7 @@ module Kanrisuru
101
100
  command.append_arg('-U', opts[:uuid])
102
101
  elsif Kanrisuru::Util.present?(device)
103
102
  mode = 'device'
104
- command.append_arg('-po', 'export')
103
+ command.append_arg('-pio', 'export')
105
104
  command << device
106
105
  else
107
106
  mode = 'list'
@@ -116,10 +115,7 @@ module Kanrisuru
116
115
  cmd.to_s
117
116
  when 'device'
118
117
  lines = cmd.to_a
119
-
120
- ## Only gets 1 device
121
- devices = blkid_devices(lines)
122
- devices[0]
118
+ blkid_devices(lines)
123
119
  else
124
120
  lines = cmd.to_a
125
121
  blkid_devices(lines)
@@ -191,6 +187,12 @@ module Kanrisuru
191
187
  current_device.usage = value
192
188
  elsif line =~ /^VERSION=/
193
189
  current_device.version = value.to_f
190
+ elsif line =~ /^MINIMUM_IO_SIZE=/
191
+ current_device.minimum_io_size = value.to_i
192
+ elsif line =~ /^PHYSICAL_SECTOR_SIZE=/
193
+ current_device.physical_sector_size = value.to_i
194
+ elsif line =~ /^LOGICAL_SECTOR_SIZE=/
195
+ current_device.logical_sector_size = value.to_i
194
196
  elsif line =~ /^PART_ENTRY_SCHEME=/
195
197
  current_device.part_entry_scheme = value
196
198
  elsif line =~ /^PART_ENTRY_UUID=/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kanrisuru
4
- VERSION = '0.8.5'
4
+ VERSION = '0.8.6'
5
5
  end
@@ -37,10 +37,11 @@ RSpec.describe Kanrisuru::Core::Disk do
37
37
  # puts device.name
38
38
  # puts result.inspect
39
39
  expect(result.success?).to eq(true)
40
- expect(result.data).to respond_to(
40
+ expect(result.data[0]).to respond_to(
41
41
  :name, :label, :uuid, :type, :uuid_sub, :label_fatboot, :version, :usage,
42
42
  :part_uuid, :part_entry_scheme, :part_entry_uuid, :part_entry_type,
43
- :part_entry_number, :part_entry_offset, :part_entry_size, :part_entry_disk
43
+ :part_entry_number, :part_entry_offset, :part_entry_size, :part_entry_disk,
44
+ :minimum_io_size, :physical_sector_size, :logical_sector_size,
44
45
  )
45
46
  end
46
47
 
@@ -15,7 +15,8 @@ RSpec.describe Kanrisuru::Core::Disk do
15
15
  expect(Kanrisuru::Core::Disk::BlkidDevice.new).to respond_to(
16
16
  :name, :label, :uuid, :type, :uuid_sub, :label_fatboot, :version, :usage,
17
17
  :part_uuid, :part_entry_scheme, :part_entry_uuid, :part_entry_type,
18
- :part_entry_number, :part_entry_offset, :part_entry_size, :part_entry_disk
18
+ :part_entry_number, :part_entry_offset, :part_entry_size, :part_entry_disk,
19
+ :minimum_io_size, :physical_sector_size, :logical_sector_size
19
20
  )
20
21
  end
21
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanrisuru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mammina
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-20 00:00:00.000000000 Z
11
+ date: 2021-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec