diskcatalog 1.1.0 → 1.2.0
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 +4 -4
- data/.idea/diskcatalog.iml +173 -0
- data/.idea/inspectionProfiles/Project_Default.xml +17 -0
- data/.idea/misc.xml +1 -3
- data/.idea/modules.xml +8 -0
- data/Gemfile.lock +7 -7
- data/lib/diskcatalog/my_find.rb +48 -48
- data/lib/diskcatalog/utils.rb +23 -0
- data/lib/diskcatalog/version.rb +1 -1
- data/lib/diskcatalog.rb +8 -23
- data/tag +32 -0
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7ddc88277ad9dbe845cd06082fbf2528726a396615f8401a204e05de2b34de7
|
4
|
+
data.tar.gz: 8f4553aa1a3271b5a87c4e8d851dc1387b7b0e05def65574b35528726abdc194
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 544b93da6f793096690c9a234171476debbb5740bf8081ed2563716ebbd92bdf3a54d441d7237094c959adba20e94f3fe17d316a66badcd39192a40049dfccfd
|
7
|
+
data.tar.gz: 64ce3f6c8697fe0df5fb94bce160320ae137ccd67dbd9bc7d6494238c92b0f5d3963d63b073f412b8ea01a99aa93f193a6ed10cb28c4861864afb69ac850b4d1
|
@@ -0,0 +1,173 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
4
|
+
<shared />
|
5
|
+
</component>
|
6
|
+
<component name="NewModuleRootManager">
|
7
|
+
<content url="file://$MODULE_DIR$">
|
8
|
+
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
9
|
+
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
10
|
+
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
11
|
+
</content>
|
12
|
+
<orderEntry type="inheritedJdk" />
|
13
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
14
|
+
<orderEntry type="module-library">
|
15
|
+
<library name="ffi (v1.17.1) [path][gem]" type="rubylib">
|
16
|
+
<properties>
|
17
|
+
<option name="additionalInfo">
|
18
|
+
<AdditionalInfo>
|
19
|
+
<option name="authors" value="該当なし" />
|
20
|
+
<option name="email" value="該当なし" />
|
21
|
+
<option name="homepage" value="該当なし" />
|
22
|
+
<option name="summary" value="該当なし" />
|
23
|
+
</AdditionalInfo>
|
24
|
+
</option>
|
25
|
+
<option name="fromPath" value="true" />
|
26
|
+
<option name="name" value="ffi" />
|
27
|
+
<option name="requirePaths">
|
28
|
+
<list>
|
29
|
+
<option value="lib" />
|
30
|
+
</list>
|
31
|
+
</option>
|
32
|
+
<option name="url" value="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1" />
|
33
|
+
<option name="version" value="1.17.1" />
|
34
|
+
</properties>
|
35
|
+
<CLASSES>
|
36
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/ext" />
|
37
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/lib" />
|
38
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/sig" />
|
39
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/rakelib" />
|
40
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/samples" />
|
41
|
+
</CLASSES>
|
42
|
+
<JAVADOC />
|
43
|
+
<SOURCES>
|
44
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/ext" />
|
45
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/lib" />
|
46
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/sig" />
|
47
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/rakelib" />
|
48
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/samples" />
|
49
|
+
</SOURCES>
|
50
|
+
<excluded>
|
51
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/ext" />
|
52
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/rakelib" />
|
53
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/ffi-1.17.1/samples" />
|
54
|
+
</excluded>
|
55
|
+
</library>
|
56
|
+
</orderEntry>
|
57
|
+
<orderEntry type="module-library">
|
58
|
+
<library name="minitest (v5.25.4) [path][gem]" type="rubylib">
|
59
|
+
<properties>
|
60
|
+
<option name="additionalInfo">
|
61
|
+
<AdditionalInfo>
|
62
|
+
<option name="authors" value="該当なし" />
|
63
|
+
<option name="email" value="該当なし" />
|
64
|
+
<option name="homepage" value="該当なし" />
|
65
|
+
<option name="summary" value="該当なし" />
|
66
|
+
</AdditionalInfo>
|
67
|
+
</option>
|
68
|
+
<option name="fromPath" value="true" />
|
69
|
+
<option name="name" value="minitest" />
|
70
|
+
<option name="requirePaths">
|
71
|
+
<list>
|
72
|
+
<option value="lib" />
|
73
|
+
</list>
|
74
|
+
</option>
|
75
|
+
<option name="url" value="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4" />
|
76
|
+
<option name="version" value="5.25.4" />
|
77
|
+
</properties>
|
78
|
+
<CLASSES>
|
79
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4/lib" />
|
80
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4/test" />
|
81
|
+
</CLASSES>
|
82
|
+
<JAVADOC />
|
83
|
+
<SOURCES>
|
84
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4/lib" />
|
85
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4/test" />
|
86
|
+
</SOURCES>
|
87
|
+
<excluded>
|
88
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4/test" />
|
89
|
+
</excluded>
|
90
|
+
</library>
|
91
|
+
</orderEntry>
|
92
|
+
<orderEntry type="module-library">
|
93
|
+
<library name="rake (v13.2.1) [path][gem]" type="rubylib">
|
94
|
+
<properties>
|
95
|
+
<option name="additionalInfo">
|
96
|
+
<AdditionalInfo>
|
97
|
+
<option name="authors" value="該当なし" />
|
98
|
+
<option name="email" value="該当なし" />
|
99
|
+
<option name="homepage" value="該当なし" />
|
100
|
+
<option name="summary" value="該当なし" />
|
101
|
+
</AdditionalInfo>
|
102
|
+
</option>
|
103
|
+
<option name="fromPath" value="true" />
|
104
|
+
<option name="name" value="rake" />
|
105
|
+
<option name="requirePaths">
|
106
|
+
<list>
|
107
|
+
<option value="lib" />
|
108
|
+
</list>
|
109
|
+
</option>
|
110
|
+
<option name="url" value="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1" />
|
111
|
+
<option name="version" value="13.2.1" />
|
112
|
+
</properties>
|
113
|
+
<CLASSES>
|
114
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/doc" />
|
115
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/exe" />
|
116
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib" />
|
117
|
+
</CLASSES>
|
118
|
+
<JAVADOC />
|
119
|
+
<SOURCES>
|
120
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/doc" />
|
121
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/exe" />
|
122
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib" />
|
123
|
+
</SOURCES>
|
124
|
+
<excluded>
|
125
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/doc" />
|
126
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/exe" />
|
127
|
+
</excluded>
|
128
|
+
</library>
|
129
|
+
</orderEntry>
|
130
|
+
<orderEntry type="module-library">
|
131
|
+
<library name="sys-filesystem (v1.5.3) [path][gem]" type="rubylib">
|
132
|
+
<properties>
|
133
|
+
<option name="additionalInfo">
|
134
|
+
<AdditionalInfo>
|
135
|
+
<option name="authors" value="該当なし" />
|
136
|
+
<option name="email" value="該当なし" />
|
137
|
+
<option name="homepage" value="該当なし" />
|
138
|
+
<option name="summary" value="該当なし" />
|
139
|
+
</AdditionalInfo>
|
140
|
+
</option>
|
141
|
+
<option name="fromPath" value="true" />
|
142
|
+
<option name="name" value="sys-filesystem" />
|
143
|
+
<option name="requirePaths">
|
144
|
+
<list>
|
145
|
+
<option value="lib" />
|
146
|
+
</list>
|
147
|
+
</option>
|
148
|
+
<option name="url" value="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3" />
|
149
|
+
<option name="version" value="1.5.3" />
|
150
|
+
</properties>
|
151
|
+
<CLASSES>
|
152
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/lib" />
|
153
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/spec" />
|
154
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/certs" />
|
155
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/examples" />
|
156
|
+
</CLASSES>
|
157
|
+
<JAVADOC />
|
158
|
+
<SOURCES>
|
159
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/lib" />
|
160
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/spec" />
|
161
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/certs" />
|
162
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/examples" />
|
163
|
+
</SOURCES>
|
164
|
+
<excluded>
|
165
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/spec" />
|
166
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/certs" />
|
167
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/sys-filesystem-1.5.3/examples" />
|
168
|
+
</excluded>
|
169
|
+
</library>
|
170
|
+
</orderEntry>
|
171
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.19, rbenv: 3.2.5) [gem]" level="application" />
|
172
|
+
</component>
|
173
|
+
</module>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
2
|
+
<profile version="1.0">
|
3
|
+
<option name="myName" value="Project Default" />
|
4
|
+
<inspection_tool class="RbsMissingTypeSignature" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
5
|
+
<inspection_tool class="RubyCaseWithoutElseBlockInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
6
|
+
<inspection_tool class="RubyClassVariableUsageInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
7
|
+
<inspection_tool class="RubyMismatchedArgumentType" enabled="false" level="WARNING" enabled_by_default="false" />
|
8
|
+
<inspection_tool class="RubyTooManyInstanceVariablesInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
9
|
+
<inspection_tool class="RubyUnnecessaryReturnStatement" enabled="false" level="WARNING" enabled_by_default="false" />
|
10
|
+
<inspection_tool class="RubyUnusedLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
11
|
+
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
12
|
+
<option name="processCode" value="true" />
|
13
|
+
<option name="processLiterals" value="true" />
|
14
|
+
<option name="processComments" value="true" />
|
15
|
+
</inspection_tool>
|
16
|
+
</profile>
|
17
|
+
</component>
|
data/.idea/misc.xml
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<project version="4">
|
3
|
-
<component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 3.
|
4
|
-
<output url="file://$PROJECT_DIR$/out" />
|
5
|
-
</component>
|
3
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 3.2.5" project-jdk-type="RUBY_SDK" />
|
6
4
|
</project>
|
data/.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/diskcatalog.iml" filepath="$PROJECT_DIR$/.idea/diskcatalog.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
data/Gemfile.lock
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
diskcatalog (1.
|
4
|
+
diskcatalog (1.2.0)
|
5
5
|
sys-filesystem
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
ffi (1.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
sys-filesystem (1.4.3)
|
10
|
+
ffi (1.17.1)
|
11
|
+
minitest (5.25.4)
|
12
|
+
rake (13.2.1)
|
13
|
+
sys-filesystem (1.5.3)
|
15
14
|
ffi (~> 1.1)
|
16
15
|
|
17
16
|
PLATFORMS
|
18
17
|
arm64-darwin-22
|
19
18
|
x64-mingw32
|
20
19
|
x86_64-darwin-22
|
20
|
+
x86_64-darwin-24
|
21
21
|
|
22
22
|
DEPENDENCIES
|
23
23
|
diskcatalog!
|
@@ -25,4 +25,4 @@ DEPENDENCIES
|
|
25
25
|
rake (~> 13.0)
|
26
26
|
|
27
27
|
BUNDLED WITH
|
28
|
-
2.4.
|
28
|
+
2.4.19
|
data/lib/diskcatalog/my_find.rb
CHANGED
@@ -1,61 +1,61 @@
|
|
1
1
|
module MyFind
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
3
|
+
#
|
4
|
+
# Calls the associated block with the name of every file and directory listed
|
5
|
+
# as arguments, then recursively on their subdirectories, and so on.
|
6
|
+
#
|
7
|
+
# Returns an enumerator if no block is given.
|
8
|
+
#
|
9
|
+
# See the +Find+ module documentation for an example.
|
10
|
+
#
|
11
|
+
def find(*paths, ignore_error: true) # :yield: path
|
12
|
+
block_given? or return enum_for(__method__, *paths, ignore_error: ignore_error)
|
13
|
+
|
14
|
+
fs_encoding = Encoding.find("filesystem")
|
15
|
+
|
16
|
+
paths.collect!{|d| raise Errno::ENOENT, d unless File.exist?(d); d.dup}.each do |path|
|
17
|
+
path = path.to_path if path.respond_to? :to_path
|
18
|
+
enc = path.encoding == Encoding::US_ASCII ? fs_encoding : path.encoding
|
19
|
+
ps = [path]
|
20
|
+
while file = ps.shift
|
21
|
+
catch(:prune) do
|
22
|
+
yield file.dup
|
23
|
+
begin
|
24
|
+
s = File.lstat(file)
|
25
|
+
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EPERM
|
26
|
+
raise unless ignore_error
|
27
|
+
next
|
28
|
+
end
|
29
|
+
if s.directory? then
|
23
30
|
begin
|
24
|
-
|
31
|
+
fs = Dir.children(file, encoding: enc)
|
25
32
|
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EPERM
|
26
33
|
raise unless ignore_error
|
27
34
|
next
|
28
35
|
end
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
next
|
35
|
-
end
|
36
|
-
fs.sort!
|
37
|
-
fs.reverse_each {|f|
|
38
|
-
f = File.join(file, f)
|
39
|
-
ps.unshift f
|
40
|
-
}
|
41
|
-
end
|
36
|
+
fs.sort!
|
37
|
+
fs.reverse_each {|f|
|
38
|
+
f = File.join(file, f)
|
39
|
+
ps.unshift f
|
40
|
+
}
|
42
41
|
end
|
43
42
|
end
|
44
43
|
end
|
45
|
-
nil
|
46
44
|
end
|
45
|
+
nil
|
46
|
+
end
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
48
|
+
#
|
49
|
+
# Skips the current file or directory, restarting the loop with the next
|
50
|
+
# entry. If the current file is a directory, that directory will not be
|
51
|
+
# recursively entered. Meaningful only within the block associated with
|
52
|
+
# Find::find.
|
53
|
+
#
|
54
|
+
# See the +Find+ module documentation for an example.
|
55
|
+
#
|
56
|
+
def prune
|
57
|
+
throw :prune
|
58
|
+
end
|
59
59
|
|
60
|
-
|
61
|
-
|
60
|
+
module_function :find, :prune
|
61
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Diskcatalog
|
2
|
+
class Utils
|
3
|
+
def self.number_to_human_size(size)
|
4
|
+
kb = 1024
|
5
|
+
mb = 1024**2
|
6
|
+
gb = 1024**3
|
7
|
+
tb = 1024**4
|
8
|
+
case
|
9
|
+
when size < 1024
|
10
|
+
'%d Bytes' % size
|
11
|
+
when size < kb
|
12
|
+
'%.1f KB' % (size / kb)
|
13
|
+
when size < mb
|
14
|
+
'%.1f MB' % (size / mb)
|
15
|
+
when size < 1024**4
|
16
|
+
'%.1f GB' % (size / gb)
|
17
|
+
else
|
18
|
+
'%.1f TB' % (size / tb)
|
19
|
+
end.sub('.0', '')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
data/lib/diskcatalog/version.rb
CHANGED
data/lib/diskcatalog.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require "diskcatalog/version"
|
4
|
+
require "diskcatalog/my_find"
|
5
|
+
require "diskcatalog/utils"
|
6
|
+
|
5
7
|
|
6
8
|
require 'optparse'
|
7
9
|
require 'fileutils'
|
@@ -200,9 +202,11 @@ module Diskcatalog
|
|
200
202
|
end
|
201
203
|
|
202
204
|
stat = Sys::Filesystem.stat(@opt.dir)
|
203
|
-
free_bytes = number_to_human_size(stat.blocks_available * stat.block_size)
|
205
|
+
free_bytes = Utils::number_to_human_size(stat.blocks_available * stat.block_size)
|
204
206
|
# puts number_to_human_size(free_bytes)
|
205
|
-
|
207
|
+
puts "total=#{stat.blocks * stat.block_size}"
|
208
|
+
total_bytes = Utils::number_to_human_size(stat.blocks * stat.block_size)
|
209
|
+
puts "total_bytes=#{total_bytes}"
|
206
210
|
#puts number_to_human_size(total_bytes)
|
207
211
|
|
208
212
|
out = File.open(@opt.output_info, "w:utf-8")
|
@@ -213,25 +217,6 @@ module Diskcatalog
|
|
213
217
|
out.puts "Free: #{free_bytes}"
|
214
218
|
out.close if out
|
215
219
|
end
|
216
|
-
|
217
|
-
def number_to_human_size(size)
|
218
|
-
kb = 1024
|
219
|
-
mb = 1024**2
|
220
|
-
gb = 1024**3
|
221
|
-
tb = 1024**4
|
222
|
-
case
|
223
|
-
when size < 1024
|
224
|
-
'%d Bytes' % size
|
225
|
-
when size < kb
|
226
|
-
'%.1f KB' % (size / kb)
|
227
|
-
when size < mb
|
228
|
-
'%.1f MB' % (size / mb)
|
229
|
-
when size < 1024**4
|
230
|
-
'%.1f GB' % (size / gb)
|
231
|
-
else
|
232
|
-
'%.1f TB' % (size / tb)
|
233
|
-
end.sub('.0', '')
|
234
|
-
end
|
235
220
|
end
|
236
221
|
|
237
222
|
class SearchCommand < Command
|
data/tag
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
def find_version
|
4
|
+
file = File.expand_path(File.dirname(__FILE__) + '/lib/diskcatalog/version.rb')
|
5
|
+
File.readlines(file).each do |line|
|
6
|
+
# puts line
|
7
|
+
if line =~ /VERSION\s*=\s*['"]([^'"]+)['"]/
|
8
|
+
return $1
|
9
|
+
end
|
10
|
+
end
|
11
|
+
return nil
|
12
|
+
end
|
13
|
+
|
14
|
+
def run_cmd(cmd)
|
15
|
+
puts cmd
|
16
|
+
system(cmd)
|
17
|
+
end
|
18
|
+
|
19
|
+
version = find_version
|
20
|
+
if version.nil?
|
21
|
+
puts "Version not found"
|
22
|
+
exit(1)
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
tagname = "v#{version}"
|
27
|
+
cmd = "git tag #{tagname}"
|
28
|
+
run_cmd(cmd)
|
29
|
+
cmd = "git push origin #{tagname}"
|
30
|
+
run_cmd(cmd)
|
31
|
+
|
32
|
+
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diskcatalog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- src
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sys-filesystem
|
@@ -35,7 +35,10 @@ extensions: []
|
|
35
35
|
extra_rdoc_files: []
|
36
36
|
files:
|
37
37
|
- ".idea/.gitignore"
|
38
|
+
- ".idea/diskcatalog.iml"
|
39
|
+
- ".idea/inspectionProfiles/Project_Default.xml"
|
38
40
|
- ".idea/misc.xml"
|
41
|
+
- ".idea/modules.xml"
|
39
42
|
- ".idea/vcs.xml"
|
40
43
|
- CODE_OF_CONDUCT.md
|
41
44
|
- Gemfile
|
@@ -55,6 +58,7 @@ files:
|
|
55
58
|
- exe/dcats
|
56
59
|
- lib/diskcatalog.rb
|
57
60
|
- lib/diskcatalog/my_find.rb
|
61
|
+
- lib/diskcatalog/utils.rb
|
58
62
|
- lib/diskcatalog/version.rb
|
59
63
|
- pkg/diskcatalog-0.1.0.gem
|
60
64
|
- pkg/diskcatalog-0.2.0.gem
|
@@ -64,6 +68,7 @@ files:
|
|
64
68
|
- run_dcats.cmd
|
65
69
|
- run_dcats.sh
|
66
70
|
- sig/diskcatalog.rbs
|
71
|
+
- tag
|
67
72
|
- test_diskcatalog.cmd
|
68
73
|
homepage: https://github.com/src256
|
69
74
|
licenses:
|
@@ -87,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
92
|
- !ruby/object:Gem::Version
|
88
93
|
version: '0'
|
89
94
|
requirements: []
|
90
|
-
rubygems_version: 3.
|
95
|
+
rubygems_version: 3.4.19
|
91
96
|
signing_key:
|
92
97
|
specification_version: 4
|
93
98
|
summary: Create disk catalog.
|