diskcatalog 1.2.0 → 1.2.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: a7ddc88277ad9dbe845cd06082fbf2528726a396615f8401a204e05de2b34de7
4
- data.tar.gz: 8f4553aa1a3271b5a87c4e8d851dc1387b7b0e05def65574b35528726abdc194
3
+ metadata.gz: 26a374df61fddd36c051c3267e53b0e3f09a035cbc618dbbbf0e722ff9307cfd
4
+ data.tar.gz: b36e80b8eecae674c36e10fefbd4c06dd8f4b5b5f495fc58294f0c7126385e1f
5
5
  SHA512:
6
- metadata.gz: 544b93da6f793096690c9a234171476debbb5740bf8081ed2563716ebbd92bdf3a54d441d7237094c959adba20e94f3fe17d316a66badcd39192a40049dfccfd
7
- data.tar.gz: 64ce3f6c8697fe0df5fb94bce160320ae137ccd67dbd9bc7d6494238c92b0f5d3963d63b073f412b8ea01a99aa93f193a6ed10cb28c4861864afb69ac850b4d1
6
+ metadata.gz: 86a9b0c5acd35dff29f4a8ca7b9d2ca81663a884d3bfd6ea13aa6565197716c20214890736e27261ac418ba27b8fe69d8293b37b3f7e217a40b7861bb9a4b9d1
7
+ data.tar.gz: 0e215f7367b9f8b3641aa7856bbeaa79e2b2ab2c741ea3fd1d0a26659036fa4ae166bbfae8609d1778a3e473f3b1d0d7d02e30e548cc22fae0bf70d6b06e8951
@@ -8,6 +8,7 @@
8
8
  <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
9
  <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
10
  <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
+ <excludeFolder url="file://$MODULE_DIR$/vendor/bundle/ruby/3.2.0/cache" />
11
12
  </content>
12
13
  <orderEntry type="inheritedJdk" />
13
14
  <orderEntry type="sourceFolder" forTests="false" />
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- diskcatalog (1.2.0)
4
+ diskcatalog (1.2.2)
5
5
  sys-filesystem
6
6
 
7
7
  GEM
data/build.sh CHANGED
@@ -1,18 +1,24 @@
1
1
  #!/bin/sh
2
2
  # rmagick for sierra
3
- export PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig
3
+ #export PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig
4
4
  #export PATH=/usr/local/Cellar/imagemagick@6/6.9.7-5/bin:$PATH
5
5
 
6
6
  bundle_dir=./vendor/bundle
7
- if [ -d "$bundle_dir" ] ; then
8
- /bin/rm -rf "$bundle_dir"
9
- bundle update
10
- else
7
+ bundle config --local path $bundle_dir
8
+
9
+ if [ "$1" = "clean" ]; then
10
+ echo "rm -rf $bundle_dir"
11
11
  /bin/rm -rf "$bundle_dir"
12
- bundle install --path "$bundle_dir"
12
+ /bin/rm Gemfile.lock
13
+ exit 0
13
14
  fi
14
15
 
15
-
16
-
17
-
18
-
16
+ if [ -d "$bundle_dir" ] ; then
17
+ echo "bunlde update"
18
+ bundle update
19
+ bundle clean
20
+ else
21
+ echo "bundle install"
22
+ /bin/rm -rf "$bundle_dir"
23
+ bundle install
24
+ fi
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Diskcatalog
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.2"
5
5
  end
data/lib/diskcatalog.rb CHANGED
@@ -110,8 +110,8 @@ module Diskcatalog
110
110
  end
111
111
 
112
112
  def list
113
- puts "List catalog in #{@opt.catalogdir}"
114
- Dir.glob(File.join(@opt.catalogdir, "*.info")).each do |path|
113
+ puts "List catalog in #{@option.catalogdir}"
114
+ Dir.glob(File.join(@option.catalogdir, "*.info")).each do |path|
115
115
  puts File.basename(path)
116
116
  end
117
117
  end
@@ -153,14 +153,14 @@ module Diskcatalog
153
153
  end
154
154
 
155
155
  def initialize(option)
156
- @opt = option
156
+ @option = option
157
157
  end
158
158
 
159
159
  def run
160
- if @opt.list
160
+ if @option.list
161
161
  list
162
162
  else
163
- unless @opt.dir
163
+ unless @option.dir
164
164
  raise "directory is not specified"
165
165
  end
166
166
  make_files
@@ -170,13 +170,13 @@ module Diskcatalog
170
170
 
171
171
  private
172
172
  def make_files
173
- puts "Create catalog file for #{@opt.dir}: #{@opt.output_files}"
174
- unless FileTest.directory?(@opt.dir)
173
+ puts "Create catalog file for #{@option.dir}: #{@option.output_files}"
174
+ unless FileTest.directory?(@option.dir)
175
175
  raise RuntimeError
176
176
  end
177
- out = File.open(@opt.output_files, "w:utf-8")
177
+ out = File.open(@option.output_files, "w:utf-8")
178
178
  begin
179
- MyFind.find(@opt.dir, ignore_error: true) do |f|
179
+ MyFind.find(@option.dir, ignore_error: true) do |f|
180
180
  if FileTest.file?(f)
181
181
  size = File.size(f)
182
182
  mtime = File.mtime(f).strftime("%Y-%m-%d")
@@ -196,12 +196,12 @@ module Diskcatalog
196
196
  end
197
197
 
198
198
  def make_info
199
- puts "Create info for #{@opt.dir}: #{@opt.output_info}"
200
- unless FileTest.directory?(@opt.dir)
199
+ puts "Create info for #{@option.dir}: #{@option.output_info}"
200
+ unless FileTest.directory?(@option.dir)
201
201
  raise RuntimeError
202
202
  end
203
203
 
204
- stat = Sys::Filesystem.stat(@opt.dir)
204
+ stat = Sys::Filesystem.stat(@option.dir)
205
205
  free_bytes = Utils::number_to_human_size(stat.blocks_available * stat.block_size)
206
206
  # puts number_to_human_size(free_bytes)
207
207
  puts "total=#{stat.blocks * stat.block_size}"
@@ -209,10 +209,10 @@ module Diskcatalog
209
209
  puts "total_bytes=#{total_bytes}"
210
210
  #puts number_to_human_size(total_bytes)
211
211
 
212
- out = File.open(@opt.output_info, "w:utf-8")
212
+ out = File.open(@option.output_info, "w:utf-8")
213
213
  created = Time.now.strftime("%Y-%m-%dT%H:%M:%S")
214
214
  out.puts "Created: #{created}"
215
- out.puts "Volume: #{@opt.dir}"
215
+ out.puts "Volume: #{@option.dir}"
216
216
  out.puts "Total: #{total_bytes}"
217
217
  out.puts "Free: #{free_bytes}"
218
218
  out.close if out
@@ -233,6 +233,7 @@ module Diskcatalog
233
233
  end
234
234
  opt.on('-v', '--verbose', 'verbose message') {|v| opts[:v] = v}
235
235
  opt.on('--config=CONFIGFILE', 'Config file') {|v| opts[:c] = v }
236
+ opt.on('-d', '--debug', 'debug message') {|v| opts[:d] = v}
236
237
  opt.parse!(argv)
237
238
  config = load_yaml(opts[:c])
238
239
  option = SearchOption.new(opts, argv, config)
@@ -249,11 +250,11 @@ module Diskcatalog
249
250
  end
250
251
 
251
252
  def initialize(option)
252
- @opt = option
253
+ @option = option
253
254
  end
254
255
 
255
256
  def run
256
- if @opt.list
257
+ if @option.list
257
258
  list
258
259
  else
259
260
  search
@@ -261,7 +262,9 @@ module Diskcatalog
261
262
  end
262
263
 
263
264
  def search
264
- system("#{SEARCH_CMD} #{@opt.search} #{@opt.catalogdir}")
265
+ cmd = "#{SEARCH_CMD} #{@option.search} #{@option.catalogdir}"
266
+ puts cmd if @option.debug
267
+ system(cmd)
265
268
  end
266
269
  end
267
270
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diskcatalog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - src