diskman 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/diskman/commands/mkfs.rb +3 -5
- data/lib/diskman/commands/write.rb +1 -3
- data/lib/diskman/device.rb +1 -0
- data/lib/diskman/root_device.rb +5 -1
- data/lib/diskman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60a56cc84faf0b324ccd66b0839aae9b647fd2ce580bfb0b699f42eba3ad136a
|
4
|
+
data.tar.gz: 49689697c2d6ad593fad02dbee1fc10283bcd97d43a350f8c8c8924ea96e9ede
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b40ccefcd84a1adfe607029800ecb2107b64ad2cb4022d3507d8c105e40e531d82e7fecc04bcad6f1bb5b3f299119d3c0668c4a2150d87a3c5c07da18c638627
|
7
|
+
data.tar.gz: c6c571cada30b6228851b2e61a564ae01fa3fac63ea04e94615bb8501b0d466599df6afb2bda0d06be34ed90f387f42d5e593507041a3cea8d101464c37847a4
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Command
|
2
2
|
class Mkfs
|
3
3
|
def get_list
|
4
|
-
Dir['/
|
5
|
-
path.gsub(%r[^/
|
4
|
+
Dir['/sbin/mkfs.*'].map do |path|
|
5
|
+
path.gsub(%r[^/sbin/mkfs.], '')
|
6
6
|
end.sort
|
7
7
|
end
|
8
8
|
|
@@ -13,8 +13,6 @@ module Command
|
|
13
13
|
end
|
14
14
|
|
15
15
|
device = RootDevice.choose
|
16
|
-
device.ensure_not_mounted!
|
17
|
-
|
18
16
|
device = device.choose_with_partitions
|
19
17
|
|
20
18
|
fs = Chooser.new(get_list, item: 'filesystem').select
|
@@ -24,7 +22,7 @@ module Command
|
|
24
22
|
puts "Device: #{device.to_s.yellow}"
|
25
23
|
puts "Command: #{cmd.yellow}"
|
26
24
|
|
27
|
-
System.exec!
|
25
|
+
System.exec! cmd
|
28
26
|
end
|
29
27
|
end
|
30
28
|
end
|
@@ -7,8 +7,6 @@ module Command
|
|
7
7
|
end
|
8
8
|
|
9
9
|
device = RootDevice.choose
|
10
|
-
device.ensure_not_mounted!
|
11
|
-
|
12
10
|
size = File.size(file)
|
13
11
|
cmd = device.get_write_command(file, size)
|
14
12
|
|
@@ -16,7 +14,7 @@ module Command
|
|
16
14
|
puts "Device: #{device.to_s.yellow}"
|
17
15
|
puts "Command: #{cmd.yellow}"
|
18
16
|
|
19
|
-
System.exec!
|
17
|
+
System.exec! cmd
|
20
18
|
end
|
21
19
|
end
|
22
20
|
end
|
data/lib/diskman/device.rb
CHANGED
data/lib/diskman/root_device.rb
CHANGED
@@ -5,11 +5,15 @@ module Diskman
|
|
5
5
|
File.read(file).strip == '1'
|
6
6
|
end.map do |path|
|
7
7
|
path =~ %r[^/sys/block/(.*)/removable$]x && RootDevice.new($1)
|
8
|
+
end.reject do |device|
|
9
|
+
device.name =~ /sr\d+/
|
8
10
|
end.sort
|
9
11
|
end
|
10
12
|
|
11
13
|
def self.choose
|
12
|
-
Chooser.new(RootDevice.get_removable, item: 'removable device').select
|
14
|
+
selection = Chooser.new(RootDevice.get_removable, item: 'removable device').select
|
15
|
+
selection.ensure_not_mounted!
|
16
|
+
selection
|
13
17
|
end
|
14
18
|
|
15
19
|
def choose_with_partitions
|
data/lib/diskman/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diskman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- crdx
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: require_all
|