diskcatalog 1.3.1 → 1.4.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 +2 -2
- data/Gemfile.lock +4 -3
- data/lib/diskcatalog/version.rb +1 -1
- data/lib/diskcatalog.rb +23 -6
- 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: c7c8ddc1906b8ca79255a5850497c59fbffc2947532aa12789fa98117a61df85
|
4
|
+
data.tar.gz: 352a15b84afa52091fb9ba80c3f842d6f3a31e8d85788445e5c9a4416a06d881
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9bbcc6f4ab0049983f34254cfdcec9e40c2e0897898c6da06d3af70fca9a4d7ef67d304194a7dce9e70a7d106d3bab36e48a1614e9680faf49cf88616a824d3
|
7
|
+
data.tar.gz: a24adb072e08c24748ba38f1540f8aa9e96af383f0cf0f905dceed234adee8e53db09ffc3321ccbd5adec02e6964b68ee41f6e0afcb0623a3e3f6c12adbb38a5
|
data/.idea/diskcatalog.iml
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
11
11
|
<excludeFolder url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/cache" />
|
12
12
|
</content>
|
13
|
-
<orderEntry type="
|
13
|
+
<orderEntry type="jdk" jdkName="rbenv: 3.2.6" jdkType="RUBY_SDK" />
|
14
14
|
<orderEntry type="sourceFolder" forTests="false" />
|
15
15
|
<orderEntry type="module-library">
|
16
16
|
<library name="ffi (v1.17.1) [path][gem]" type="rubylib">
|
@@ -204,6 +204,6 @@
|
|
204
204
|
</excluded>
|
205
205
|
</library>
|
206
206
|
</orderEntry>
|
207
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.19, rbenv: 3.2.
|
207
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.19, rbenv: 3.2.6) [gem]" level="application" />
|
208
208
|
</component>
|
209
209
|
</module>
|
data/Gemfile.lock
CHANGED
@@ -1,22 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
diskcatalog (1.
|
4
|
+
diskcatalog (1.4.0)
|
5
5
|
sys-filesystem
|
6
6
|
zlib
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
ffi (1.17.
|
11
|
+
ffi (1.17.2)
|
12
12
|
minitest (5.25.5)
|
13
|
-
rake (13.
|
13
|
+
rake (13.3.0)
|
14
14
|
sys-filesystem (1.5.3)
|
15
15
|
ffi (~> 1.1)
|
16
16
|
zlib (3.2.1)
|
17
17
|
|
18
18
|
PLATFORMS
|
19
19
|
arm64-darwin-22
|
20
|
+
arm64-darwin-24
|
20
21
|
x64-mingw-ucrt
|
21
22
|
x64-mingw32
|
22
23
|
x86_64-darwin-22
|
data/lib/diskcatalog/version.rb
CHANGED
data/lib/diskcatalog.rb
CHANGED
@@ -88,9 +88,21 @@ module Diskcatalog
|
|
88
88
|
end
|
89
89
|
attr_reader :dir, :search, :debug, :output, :output_files, :output_info, :compress, :debug
|
90
90
|
|
91
|
-
def output_files
|
91
|
+
# def output_files
|
92
|
+
# if compress
|
93
|
+
# @output_files + '.gz'
|
94
|
+
# else
|
95
|
+
# @output_files
|
96
|
+
# end
|
97
|
+
# end
|
98
|
+
|
99
|
+
def compress_output_files
|
100
|
+
@output_files + '.gz'
|
101
|
+
end
|
102
|
+
|
103
|
+
def real_output_files
|
92
104
|
if compress
|
93
|
-
|
105
|
+
compress_output_files
|
94
106
|
else
|
95
107
|
@output_files
|
96
108
|
end
|
@@ -100,13 +112,14 @@ module Diskcatalog
|
|
100
112
|
class SearchOption < Option
|
101
113
|
def initialize(opts, argv, config)
|
102
114
|
super
|
115
|
+
@dcatz = @opts[:dcatz]
|
103
116
|
@search = nil
|
104
117
|
if argv.size > 0
|
105
118
|
@search = argv[0]
|
106
119
|
end
|
107
120
|
raise "SEARCH is not specified" unless @search
|
108
121
|
end
|
109
|
-
attr_reader :search
|
122
|
+
attr_reader :search, :dcatz
|
110
123
|
end
|
111
124
|
|
112
125
|
class Command
|
@@ -184,13 +197,16 @@ module Diskcatalog
|
|
184
197
|
|
185
198
|
private
|
186
199
|
def make_files
|
187
|
-
puts "Create catalog file for #{@option.dir}: #{@option.
|
200
|
+
puts "Create catalog file for #{@option.dir}: #{@option.real_output_files}"
|
188
201
|
unless FileTest.directory?(@option.dir)
|
189
202
|
raise RuntimeError
|
190
203
|
end
|
191
204
|
|
205
|
+
File.unlink(@option.output_files) if FileTest.file?(@option.output_files)
|
206
|
+
File.unlink(@option.compress_output_files) if FileTest.file?(@option.compress_output_files)
|
207
|
+
|
192
208
|
if @option.compress
|
193
|
-
out = File.open(@option.
|
209
|
+
out = File.open(@option.compress_output_files, "w:utf-8")
|
194
210
|
out = Zlib::GzipWriter.open(out)
|
195
211
|
else
|
196
212
|
out = File.open(@option.output_files, "w:utf-8")
|
@@ -254,6 +270,7 @@ module Diskcatalog
|
|
254
270
|
end
|
255
271
|
opt.on('-v', '--verbose', 'verbose message') {|v| opts[:v] = v}
|
256
272
|
opt.on('--config=CONFIGFILE', 'Config file') {|v| opts[:c] = v }
|
273
|
+
opt.on('--dcatz', 'enable dcatz.bat(alternative gzip.exe)') {|v| opts[:dcatz] = v}
|
257
274
|
opt.on('-d', '--debug', 'debug message') {|v| opts[:d] = v}
|
258
275
|
opt.parse!(argv)
|
259
276
|
config = load_yaml(opts[:c])
|
@@ -295,7 +312,7 @@ module Diskcatalog
|
|
295
312
|
|
296
313
|
def search
|
297
314
|
precmd = "-z"
|
298
|
-
if Diskcatalog::Utils.windows?
|
315
|
+
if Diskcatalog::Utils.windows? && @option.dcatz
|
299
316
|
# zcat_path=write_zcat
|
300
317
|
precmd = "--pre=dcatz.bat" # .batを指定しないとエラーとなる。
|
301
318
|
end
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- src
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sys-filesystem
|