diskcatalog 1.2.3 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 924717b99bcbe0a071819b38a67893a99dcdbed0cb0c4fc6f3e48309838f3614
4
- data.tar.gz: e72b0379e4348cf604e285e91f5ee5728855ab15d693302889c6f2524d485798
3
+ metadata.gz: 0a4c33e246e2738c6f822206c8dbb98392aff3534186cb1bde3913c3dacded5e
4
+ data.tar.gz: eaac4cb7ff83a101ddefe3604ff0cdffe71b193bd8d94aa80f8dc897995df8ee
5
5
  SHA512:
6
- metadata.gz: 86112b38aab32e6cfce76f94d1e9a737fdaf0915d40b2693c4198d05f5d813c98303bd9f44fa7b71229862ceb8ba9d8ad3f19370f9b434198842c61d8e4aa8b4
7
- data.tar.gz: 10b5729e36cfb3f3317b909d892e66dc39a2da63e6600778923218e8c211b374b2e9defb511fd92c50f78f7ff27e5bf629210e360d3c8b58cfea949013f23a5f
6
+ metadata.gz: b26d641ce336e2e7b9c9652969df0786945e77204879c0b638650592a8c46a2e72c417bf736e6f4c9b2c3818f0f14bb77255edbb16e602bf35ec149d5ecd832a
7
+ data.tar.gz: 858ade4f1d4bcbd5772dc442c09ac9dbaa38a628d49ba5b82e7cda66c5f1c7dfeb34271f530d8f955d9bc6903403109a1efc3f71b6209fc9762742173aeb5056
@@ -56,7 +56,7 @@
56
56
  </library>
57
57
  </orderEntry>
58
58
  <orderEntry type="module-library">
59
- <library name="minitest (v5.25.4) [path][gem]" type="rubylib">
59
+ <library name="minitest (v5.25.5) [path][gem]" type="rubylib">
60
60
  <properties>
61
61
  <option name="additionalInfo">
62
62
  <AdditionalInfo>
@@ -73,20 +73,20 @@
73
73
  <option value="lib" />
74
74
  </list>
75
75
  </option>
76
- <option name="url" value="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4" />
77
- <option name="version" value="5.25.4" />
76
+ <option name="url" value="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.5" />
77
+ <option name="version" value="5.25.5" />
78
78
  </properties>
79
79
  <CLASSES>
80
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4/lib" />
81
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4/test" />
80
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.5/lib" />
81
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.5/test" />
82
82
  </CLASSES>
83
83
  <JAVADOC />
84
84
  <SOURCES>
85
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4/lib" />
86
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4/test" />
85
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.5/lib" />
86
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.5/test" />
87
87
  </SOURCES>
88
88
  <excluded>
89
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.4/test" />
89
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/minitest-5.25.5/test" />
90
90
  </excluded>
91
91
  </library>
92
92
  </orderEntry>
@@ -169,6 +169,41 @@
169
169
  </excluded>
170
170
  </library>
171
171
  </orderEntry>
172
+ <orderEntry type="module-library">
173
+ <library name="zlib (v3.2.1) [path][gem]" type="rubylib">
174
+ <properties>
175
+ <option name="additionalInfo">
176
+ <AdditionalInfo>
177
+ <option name="authors" value="該当なし" />
178
+ <option name="email" value="該当なし" />
179
+ <option name="homepage" value="該当なし" />
180
+ <option name="summary" value="該当なし" />
181
+ </AdditionalInfo>
182
+ </option>
183
+ <option name="fromPath" value="true" />
184
+ <option name="name" value="zlib" />
185
+ <option name="requirePaths">
186
+ <list>
187
+ <option value="lib" />
188
+ </list>
189
+ </option>
190
+ <option name="url" value="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/zlib-3.2.1" />
191
+ <option name="version" value="3.2.1" />
192
+ </properties>
193
+ <CLASSES>
194
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/zlib-3.2.1/ext" />
195
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/zlib-3.2.1/lib" />
196
+ </CLASSES>
197
+ <JAVADOC />
198
+ <SOURCES>
199
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/zlib-3.2.1/ext" />
200
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/zlib-3.2.1/lib" />
201
+ </SOURCES>
202
+ <excluded>
203
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/gems/zlib-3.2.1/ext" />
204
+ </excluded>
205
+ </library>
206
+ </orderEntry>
172
207
  <orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.19, rbenv: 3.2.5) [gem]" level="application" />
173
208
  </component>
174
209
  </module>
data/Gemfile.lock CHANGED
@@ -1,17 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- diskcatalog (1.2.3)
4
+ diskcatalog (1.3.0)
5
5
  sys-filesystem
6
+ zlib
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
11
  ffi (1.17.1)
11
- minitest (5.25.4)
12
+ minitest (5.25.5)
12
13
  rake (13.2.1)
13
14
  sys-filesystem (1.5.3)
14
15
  ffi (~> 1.1)
16
+ zlib (3.2.1)
15
17
 
16
18
  PLATFORMS
17
19
  arm64-darwin-22
data/diskcatalog.gemspec CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
  spec.add_dependency "sys-filesystem"
33
+ spec.add_dependency "zlib"
33
34
  # Uncomment to register a new dependency of your gem
34
35
  # spec.add_dependency "example-gem", "~> 1.0"
35
36
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Diskcatalog
4
- VERSION = "1.2.3"
4
+ VERSION = "1.3.0"
5
5
  end
data/lib/diskcatalog.rb CHANGED
@@ -9,10 +9,11 @@ require 'optparse'
9
9
  require 'fileutils'
10
10
  require 'yaml'
11
11
  require 'sys/filesystem'
12
+ require 'zlib'
12
13
 
13
14
  module Diskcatalog
14
15
  DEF_CONFIG = File.expand_path("~/.catalogrc")
15
- SEARCH_CMD = "rg"
16
+ SEARCH_CMD = "rg -z"
16
17
 
17
18
  class Error < StandardError; end
18
19
 
@@ -77,13 +78,23 @@ module Diskcatalog
77
78
  @dir = argv[0]
78
79
  end
79
80
 
81
+ @debug = @opts[:d]
82
+ @compress = @opts[:z]
80
83
  @output = @opts[:o]
81
84
  if @output
82
85
  @output_files = File.join(catalogdir, @output + '.files')
83
86
  @output_info = File.join(catalogdir, @output + '.info')
84
87
  end
85
88
  end
86
- attr_reader :dir, :search, :debug, :output, :output_files, :output_info
89
+ attr_reader :dir, :search, :debug, :output, :output_files, :output_info, :compress, :debug
90
+
91
+ def output_files
92
+ if compress
93
+ @output_files + '.gz'
94
+ else
95
+ @output_files
96
+ end
97
+ end
87
98
  end
88
99
 
89
100
  class SearchOption < Option
@@ -133,6 +144,8 @@ module Diskcatalog
133
144
  opt.on('-v', '--verbose', 'verbose message') {|v| opts[:v] = v}
134
145
  opt.on('-o FILENAME', '--output=FILENAME') {|v| opts[:o] = v}
135
146
  opt.on('--config=CONFIGFILE', 'Config file') {|v| opts[:c] = v }
147
+ opt.on('-d', '--debug', 'debug message') {|v| opts[:d] = v}
148
+ opt.on('-z', '--gzip', 'compress with gzip') {|v| opts[:z] = v}
136
149
  opt.on('-l', '--list') {|v| opts[:l] = v}
137
150
  opt.parse!(argv)
138
151
  # if opts[:o].nil?
@@ -175,7 +188,14 @@ module Diskcatalog
175
188
  unless FileTest.directory?(@option.dir)
176
189
  raise RuntimeError
177
190
  end
178
- out = File.open(@option.output_files, "w:utf-8")
191
+
192
+ if @option.compress
193
+ out = File.open(@option.output_files, "w:utf-8")
194
+ out = Zlib::GzipWriter.open(out)
195
+ else
196
+ out = File.open(@option.output_files, "w:utf-8")
197
+ end
198
+
179
199
  begin
180
200
  MyFind.find(@option.dir, ignore_error: true) do |f|
181
201
  if FileTest.file?(f)
@@ -190,8 +210,8 @@ module Diskcatalog
190
210
  puts e.message
191
211
  if option.debug
192
212
  p e.backtrace
213
+ p e.class
193
214
  end
194
- p e.class
195
215
  end
196
216
  out.close if out
197
217
  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.2.3
4
+ version: 1.3.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-02-11 00:00:00.000000000 Z
11
+ date: 2025-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sys-filesystem
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: zlib
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description: Create disk catalog.
28
42
  email:
29
43
  - src@srcw.net