rbfind 2.7 → 2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rbfind +5 -0
  3. data/lib/rbfind.rb +6 -8
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b57d2e44d4df6453083635d22ab01c92ea5b54fed8c121a313ac351048f16b51
4
- data.tar.gz: 20518a97f6e446de75b6397a0e725a9f1c93d5c61f93743072a2b60e322c75a5
3
+ metadata.gz: 530e1d61cf675c858a06f62e62cbfe5cfa7b1492ec1ef9c77e293f7f0bb0b83d
4
+ data.tar.gz: '004834c6e324c296e0b4185910c8a1a70179ef90fbaeee0b262a8816d8e762af'
5
5
  SHA512:
6
- metadata.gz: 6ad6d7f05ad3de24d717dc7d274ea5dc75fd5ee81640c1de03bef875727a5f33ed80846ad7445a990ac925734a1dbed66312bac0686bcbb7d16bd1d33ae2d710
7
- data.tar.gz: 9b97002d3fd98ffd891d5d10b6fc60087a18f2a2b828a0a0099554fa2f50fe0e562a3cd4a062602e9210508d389b733974ddeb9442e0636083cc4e98a8740777
6
+ metadata.gz: e6b7d8ce6bd4d81824705b4dd311383888ff6fa02dc0a6fc94c7b307432fd7cc1b17643b75a53e7917796def4c91fd6f7243424778c64ab9d1932b5575852e04
7
+ data.tar.gz: eb837f165e31d40ed2323bbcdf2344adf32a113d1520d6dbb83c844d17f4487b44adfe997189e17734b413c368a93a71e6053a0ae697212652bd2ab578e1a620
data/bin/rbfind CHANGED
@@ -32,6 +32,7 @@ module RbFind
32
32
  [ %w(--colored -c), nil, "force color on -p or default output"],
33
33
  [ %w(--depth -d), nil, "yield directory after its contents"],
34
34
  [ %w(--maxdepth -m), :num, "maxium step depth"],
35
+ [ %w(--anydepth -M), nil, "no maxium step depth"],
35
36
  [ %w(--follow -y), nil, "follow symbolic links"],
36
37
  [ %w(--nosort -U), nil, "unsorted"],
37
38
  [ %w(--sort-by -s), :str, "sort expression"],
@@ -85,6 +86,7 @@ module RbFind
85
86
  when '--colored' then @color = true
86
87
  when '--depth' then @params[ :depth_first] = true
87
88
  when '--maxdepth' then @params[ :max_depth] = arg.to_i
89
+ when '--anydepth' then @params[ :max_depth] = nil
88
90
  when '--follow' then @params[ :follow] = true
89
91
  when '--nosort' then @params[ :sort] = false
90
92
  when '--sort-by' then @params[ :sort] = instance_eval "proc { #{arg} }"
@@ -356,6 +358,9 @@ module RbFind
356
358
  error_handle do
357
359
  eval @blkbegin if @blkbegin
358
360
  b = @block
361
+ if not @args.empty? and @params[ :max_depth] then
362
+ @params[ :max_depth] -= 1
363
+ end
359
364
  Walk.run *@args, **@params do instance_eval b end
360
365
  eval @blkend if @blkend
361
366
  end
data/lib/rbfind.rb CHANGED
@@ -8,7 +8,7 @@ require "rbfind/csv"
8
8
 
9
9
  module RbFind
10
10
 
11
- VERSION = "2.7".freeze
11
+ VERSION = "2.8".freeze
12
12
 
13
13
  =begin rdoc
14
14
 
@@ -275,7 +275,7 @@ Sort without case sensitivity and preceding dot:
275
275
 
276
276
  def initialize max_depth: nil, depth_first: nil, follow: nil,
277
277
  sort: true, dirs: false, reverse: false, error: nil, &block
278
- @params = Params.new max_depth&.nonzero?, depth_first, follow,
278
+ @params = Params.new max_depth, depth_first, follow,
279
279
  (sort_parser sort), dirs, reverse, error, block
280
280
  @start = Time.instance_eval { @start = Time.now }
281
281
  Time.instance_eval { @start = Time.now }
@@ -299,12 +299,10 @@ Sort without case sensitivity and preceding dot:
299
299
  if args.empty? then
300
300
  visit_dir Dir::CUR_DIR
301
301
  else
302
- step_depth do
303
- args.each { |base|
304
- e = Entry.new base, self
305
- enter e if handle_error do e.stat end
306
- }
307
- end
302
+ args.each { |base|
303
+ e = Entry.new base, self
304
+ enter e if handle_error do e.stat end
305
+ }
308
306
  end
309
307
  end
310
308
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbfind
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.7'
4
+ version: '2.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bertram Scharpf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-10 00:00:00.000000000 Z
11
+ date: 2021-03-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  A replacement for the standard UNIX command find.