diskcatalog 1.2.0 → 1.2.1

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: c66790a692cd160c66dd12bfc25f6fdba9b4039bccf8ffab53dd488ef450adaf
4
+ data.tar.gz: 8aef14d9eff6091a6b003113a707cf73a6016fcd80ae8a73f2d0115498af0797
5
5
  SHA512:
6
- metadata.gz: 544b93da6f793096690c9a234171476debbb5740bf8081ed2563716ebbd92bdf3a54d441d7237094c959adba20e94f3fe17d316a66badcd39192a40049dfccfd
7
- data.tar.gz: 64ce3f6c8697fe0df5fb94bce160320ae137ccd67dbd9bc7d6494238c92b0f5d3963d63b073f412b8ea01a99aa93f193a6ed10cb28c4861864afb69ac850b4d1
6
+ metadata.gz: 32196c77bf1e17792f6ba06c16578d77cf02d8553719931eba98a27806882c0381f79b0e765e3693cd4f9f8d63e91e48d801f961ea85feab85fa5d9105830834
7
+ data.tar.gz: f099226645be2a1323d7dbe8c27e4cd95e2f7f16b42d367511f5f84cc2e8e95a9eca440443b06c17ad1a8e327606bd86a96a06a2563f1a8c331434f0b183c577
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.1)
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.1"
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
@@ -249,11 +249,11 @@ module Diskcatalog
249
249
  end
250
250
 
251
251
  def initialize(option)
252
- @opt = option
252
+ @option = option
253
253
  end
254
254
 
255
255
  def run
256
- if @opt.list
256
+ if @option.list
257
257
  list
258
258
  else
259
259
  search
@@ -261,7 +261,9 @@ module Diskcatalog
261
261
  end
262
262
 
263
263
  def search
264
- system("#{SEARCH_CMD} #{@opt.search} #{@opt.catalogdir}")
264
+ cmd = "#{SEARCH_CMD} #{@option.search} #{@option.catalogdir}"
265
+ puts cmd if @option.debug
266
+ system(cmd)
265
267
  end
266
268
  end
267
269
  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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - src