rbfind 2.11 → 2.13
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/bin/rbfind +52 -48
- data/lib/rbfind.rb +12 -2
- metadata +5 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98488c856ff5755a635ef73c4c25fa7dfba6f84dbe4ee41546ffb22e4ec82fb1
|
4
|
+
data.tar.gz: f48565d71eedeef67f1cc93008c185df4637f26ba2ca1d409dc0887b44ff48e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee7b581d587bb0730b2aad2a502bc7ef3ce54a1bfe5742ca4bc92995aaba06db6400e30c9d23a2f8ae04c62d0b608cccf2a11cdd64f13bc23ab39f6c6af1e6b9
|
7
|
+
data.tar.gz: bfdb28913be3435781c52c630fbff63d29965908cafee6494a6c6a267a8da1ce568a71424687d8298f655aa66a5998e74d391934689c2d31fa33f9df364c8dc0
|
data/bin/rbfind
CHANGED
@@ -66,62 +66,66 @@ module RbFind
|
|
66
66
|
[ %w(--end -E), :blk, "eval block after end"],
|
67
67
|
[ %w(--file -f), :nam, "read block expression from file"],
|
68
68
|
[ %w(--encoding -K), :str, "encoding extern[:intern] (same as ruby -E)"],
|
69
|
+
[ %w(--width-user ), :num, "width of user field"],
|
70
|
+
[ %w(--width-size ), :num, "width of size field"],
|
69
71
|
]
|
70
72
|
|
71
73
|
def initialize
|
72
74
|
@params = {}
|
73
75
|
envopts = ENV[ "RBFIND_OPTIONS"]
|
74
76
|
$*.unshift *envopts.split if envopts
|
75
|
-
opts = GetoptLong.new *OPTIONS.map { |
|
76
|
-
[
|
77
|
+
opts = GetoptLong.new *OPTIONS.map { |names,arg,|
|
78
|
+
[*names,(arg ? GetoptLong::REQUIRED_ARGUMENT : GetoptLong::NO_ARGUMENT)]
|
77
79
|
}
|
78
80
|
opts.ordering = GetoptLong::PERMUTE
|
79
81
|
opts.quiet = true
|
80
82
|
opts.each do |opt,arg|
|
81
83
|
case opt
|
82
|
-
when '--help'
|
83
|
-
when '--version'
|
84
|
-
when '--examples'
|
85
|
-
when '--verbose'
|
86
|
-
when '--show'
|
87
|
-
when '--bw'
|
88
|
-
when '--colored'
|
89
|
-
when '--depth'
|
90
|
-
when '--maxdepth'
|
91
|
-
when '--argsdepth'
|
92
|
-
when '--follow'
|
93
|
-
when '--nosort'
|
94
|
-
when '--sort-by'
|
95
|
-
when '--time'
|
96
|
-
when '--size'
|
97
|
-
when '--dirs'
|
98
|
-
when '--reverse'
|
99
|
-
when '--require'
|
100
|
-
when '--puts-path'
|
101
|
-
when '--ls-l'
|
102
|
-
when '--long'
|
103
|
-
when '--humanage'
|
104
|
-
when '--ino'
|
105
|
-
when '--wider'
|
106
|
-
when '--slash'
|
107
|
-
when '--lines'
|
108
|
-
when '--reallines'
|
109
|
-
when '--grep'
|
110
|
-
when '--igrep'
|
111
|
-
when '--binary'
|
112
|
-
when '--no-vcs'
|
113
|
-
when '--no-swap'
|
114
|
-
when '--skip'
|
115
|
-
when '--demand'
|
116
|
-
when '--ext'
|
117
|
-
when '--visible'
|
118
|
-
when '--all'
|
119
|
-
when '--icase'
|
120
|
-
when '--nodirs'
|
121
|
-
when '--begin'
|
122
|
-
when '--end'
|
123
|
-
when '--file'
|
124
|
-
when '--encoding'
|
84
|
+
when '--help' then usage ; exit
|
85
|
+
when '--version' then puts PROGRAM ; exit
|
86
|
+
when '--examples' then usage_examples ; exit
|
87
|
+
when '--verbose' then @verbose = true
|
88
|
+
when '--show' then @show = true
|
89
|
+
when '--bw' then @color = false
|
90
|
+
when '--colored' then @color = true
|
91
|
+
when '--depth' then @params[ :depth_first] = true
|
92
|
+
when '--maxdepth' then @params[ :max_depth] = arg.to_i.nonzero?
|
93
|
+
when '--argsdepth' then @params[ :args_depth] = true
|
94
|
+
when '--follow' then @params[ :follow] = true
|
95
|
+
when '--nosort' then @params[ :sort] = false
|
96
|
+
when '--sort-by' then @params[ :sort] = instance_eval "proc { #{arg} }"
|
97
|
+
when '--time' then @params[ :sort] = proc { mtime } ; @params[ :reverse] = true
|
98
|
+
when '--size' then @params[ :sort] = proc { size } ; @params[ :reverse] = true
|
99
|
+
when '--dirs' then @params[ :dirs] = true
|
100
|
+
when '--reverse' then @params[ :reverse] = !@params[ :reverse]
|
101
|
+
when '--require' then require arg
|
102
|
+
when '--puts-path' then @puts = true
|
103
|
+
when '--ls-l' then @puts = :ls ; @wds ||= 6 ; @wdu ||= 6
|
104
|
+
when '--long' then @puts = :alt ; @wds ||= 7 ; @wdu ||= 4
|
105
|
+
when '--humanage' then @puts = :hum ; @wds ||= 7 ; @wdu ||= 4
|
106
|
+
when '--ino' then @puts = :ino ; @wds ||= 8 ; @wdu ||= 2
|
107
|
+
when '--wider' then @wdu and @wdu += 2 ; @wds and @wds += @puts != :ls ? 4 : 3
|
108
|
+
when '--slash' then @slash = true
|
109
|
+
when '--lines' then @lines = :plain ; @block = arg
|
110
|
+
when '--reallines' then @lines = :plain ; @real = true ; @block = arg
|
111
|
+
when '--grep' then @lines = :grep ; @block = arg
|
112
|
+
when '--igrep' then @lines = :grep ; @icase = true ; @block = arg
|
113
|
+
when '--binary' then @binary = true
|
114
|
+
when '--no-vcs' then @vcs = true
|
115
|
+
when '--no-swap' then @vim = true
|
116
|
+
when '--skip' then @skip = arg
|
117
|
+
when '--demand' then @demand = arg
|
118
|
+
when '--ext' then @ext = arg
|
119
|
+
when '--visible' then @visible = true
|
120
|
+
when '--all' then @visible = false
|
121
|
+
when '--icase' then @icase = true
|
122
|
+
when '--nodirs' then @nodirs = true
|
123
|
+
when '--begin' then @blkbegin = arg
|
124
|
+
when '--end' then @blkend = arg
|
125
|
+
when '--file' then @block = File.open arg do |f| f.each { |l| l.chomp! } end
|
126
|
+
when '--encoding' then e, i = arg.split ":" ; set_encoding e, i
|
127
|
+
when '--width-user' then @wdu = arg.to_i.nonzero?
|
128
|
+
when '--width-size' then @wds = arg.to_i.nonzero?
|
125
129
|
end
|
126
130
|
end
|
127
131
|
@args = $*.dup
|
@@ -160,7 +164,7 @@ module RbFind
|
|
160
164
|
[
|
161
165
|
"spcsep stype+modes,",
|
162
166
|
[
|
163
|
-
"user#{b}.w#@
|
167
|
+
"user#{b}.w#@wdu, group#{b}.w#@wdu,",
|
164
168
|
"size.w#{g}#@wds, #{time},",
|
165
169
|
"#{opath} + #{co ? 'carrow' : 'arrow'}.to_s",
|
166
170
|
]
|
@@ -234,7 +238,7 @@ module RbFind
|
|
234
238
|
when :ls then long_fmt false, false, "mtime.lsish", opath, co
|
235
239
|
when :alt then long_fmt true, true, "mtime.long", opath, co
|
236
240
|
when :hum then long_fmt true, true, "mage.t.r4", opath, co
|
237
|
-
when :ino then [ "spcsep ino.
|
241
|
+
when :ino then [ "spcsep ino.w8, nlink.w2, #{opath}"]
|
238
242
|
else [ "puts #{opath}"]
|
239
243
|
end
|
240
244
|
@block = [ "if (", [ cond], ") then", @block, "end"] if cond
|
@@ -486,7 +490,7 @@ class Time
|
|
486
490
|
# autoload several formating methods
|
487
491
|
def method_missing sym, *args, &block
|
488
492
|
super
|
489
|
-
rescue NoMethodError
|
493
|
+
rescue NoMethodError, NameError
|
490
494
|
send sym, *args, &block if require "time"
|
491
495
|
end
|
492
496
|
|
data/lib/rbfind.rb
CHANGED
@@ -8,7 +8,7 @@ require "rbfind/csv"
|
|
8
8
|
|
9
9
|
module RbFind
|
10
10
|
|
11
|
-
VERSION = "2.
|
11
|
+
VERSION = "2.13".freeze
|
12
12
|
|
13
13
|
=begin rdoc
|
14
14
|
|
@@ -490,8 +490,18 @@ Sort without case sensitivity and preceding dot:
|
|
490
490
|
|
491
491
|
def aage ; @walk.start - stat.atime ; end
|
492
492
|
def mage ; @walk.start - stat.mtime ; end
|
493
|
-
def cage ; @walk.start - stat.ctime ; end
|
494
493
|
alias age mage
|
494
|
+
def cage ; @walk.start - stat.ctime ; end
|
495
|
+
|
496
|
+
# Please consider thoroughly whether you really need this.
|
497
|
+
# https://bugs.ruby-lang.org/issues/21205#change-112494
|
498
|
+
def birthtime
|
499
|
+
stat.birthtime
|
500
|
+
rescue NotImplementedError
|
501
|
+
File.birthtime @path
|
502
|
+
end
|
503
|
+
def birthage ; @walk.start - birthtime ; end
|
504
|
+
alias bage birthage
|
495
505
|
|
496
506
|
# :call-seq:
|
497
507
|
# filesize => nil or int
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbfind
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '2.
|
4
|
+
version: '2.13'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bertram Scharpf
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-31 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: |
|
14
13
|
A replacement for the standard UNIX command find.
|
@@ -34,7 +33,6 @@ homepage: http://www.bertram-scharpf.de/software/rbfind
|
|
34
33
|
licenses:
|
35
34
|
- BSD-2-Clause
|
36
35
|
metadata: {}
|
37
|
-
post_install_message:
|
38
36
|
rdoc_options:
|
39
37
|
- "--charset"
|
40
38
|
- utf-8
|
@@ -46,16 +44,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
46
44
|
requirements:
|
47
45
|
- - ">="
|
48
46
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
47
|
+
version: 3.1.0
|
50
48
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
49
|
requirements:
|
52
50
|
- - ">="
|
53
51
|
- !ruby/object:Gem::Version
|
54
52
|
version: '0'
|
55
53
|
requirements:
|
56
|
-
-
|
57
|
-
rubygems_version: 3.
|
58
|
-
signing_key:
|
54
|
+
- Just Ruby
|
55
|
+
rubygems_version: 3.6.6
|
59
56
|
specification_version: 4
|
60
57
|
summary: Ruby replacement for the standard Unix find tool
|
61
58
|
test_files: []
|