diskman 1.0.1 → 1.0.2

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
  SHA256:
3
- metadata.gz: 5f495782abb13ab1f2378141a37adccc8795754376bceb7b431424f72773bf0b
4
- data.tar.gz: a858344c43c168dc352e3ee6e68b9009ba607e89a8ca20f3cc92ba6085ad964a
3
+ metadata.gz: 60a56cc84faf0b324ccd66b0839aae9b647fd2ce580bfb0b699f42eba3ad136a
4
+ data.tar.gz: 49689697c2d6ad593fad02dbee1fc10283bcd97d43a350f8c8c8924ea96e9ede
5
5
  SHA512:
6
- metadata.gz: adee8c52252440fd704dac86884cae71c63b4fd476f316ecd70029e324b9fe5b75679f80f996edd8b6675abd2dee6044c03b3ba99b8aba477630ea76dadcfea3
7
- data.tar.gz: '09ed132b747d2b505e822f96c399df95302c5ac152260489d64fb496cc64e68e11211b33e2f69859e6f89dca959a88d4c511af85fbb38b0907d1841859fcecb9'
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['/usr/bin/mkfs.*'].map do |path|
5
- path.gsub(%r[^/usr/bin/mkfs.], '')
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!(cmd)
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!(cmd)
17
+ System.exec! cmd
20
18
  end
21
19
  end
22
20
  end
@@ -1,5 +1,6 @@
1
1
  module Diskman
2
2
  class Device
3
+ attr_reader :name
3
4
  attr_reader :path
4
5
 
5
6
  def initialize(name)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Diskman
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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-09 00:00:00.000000000 Z
11
+ date: 2019-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: require_all