rbfind 2.14 → 2.14.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rbfind +16 -9
  3. data/lib/rbfind.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2f219a0e17b31db93bb38ec0425b37cc0a5921cdbd89638bab4de5d4303e161
4
- data.tar.gz: 0d470ef4ceac6aa088aea20c4ae7804341fbb5a84d23108bf5342acb6ad5e0e7
3
+ metadata.gz: 6d750bcaf97eb7cb1c8bdf3d5da1fd091504914e513b0ca1f078e319786a8741
4
+ data.tar.gz: 600367ca7afd454f9f7389b5e070e1049092b54111701e608277a80ace4f0cb1
5
5
  SHA512:
6
- metadata.gz: d67aae93c618f927f4b3c8ffad8916c0e526be0a59c9567538b90ac5de8d70f317799119347aa370088aae5a77ca95b30eec90f18fd269006d0ec886247f1ecf
7
- data.tar.gz: 56c9ba35469ac5b677b2aa3c6e7b9ee5977e0abcf65c563704aa768b29fc6afdf92ff92931c317c8a273af69b3ed2344cf25ee6e8d10d9782fb30043b438c956
6
+ metadata.gz: a888f1f8c8d4637e2bb010d2b1d43bdae5f6ff2a466bff266736a23051fea02168369dc182f8b7c27067727181f5a6c45ac6d4c09550d571846dd3a3f74e6b00
7
+ data.tar.gz: 1542a6f350f2c5687ef2fb4f2a07dac150c9811c62adea5abbb95afa649a095d4007c5260e0e87f83031970febcf7e46ce874427295ebd4b3f2a50da6e7c4623
data/bin/rbfind CHANGED
@@ -62,7 +62,7 @@ module RbFind
62
62
  option %w(N nodirs ), "skip directories" do @nodirs = true ; end
63
63
  option %w(B begin ), "eval block before begin" do |blk| @blkbegin = blk ; end
64
64
  option %w(E end ), "eval block after end" do |blk| @blkend = blk ; end
65
- option %w(f file ), "read block expression from file" do |nam| @block = File.open nam do |f| f.each { |l| l.chomp! } end ; end
65
+ option %w(f file ), "read block expression from file" do |nam| @block = File.read nam ; end
66
66
  option %w(K encoding ), "encoding extern[:intern] (same as ruby -E)" do |str| e, i = str.split ":", 2 ; set_encoding e, i ; end
67
67
  option %w( width-user), "width of user field" do |num| @wdu = num.to_i.nonzero? ; end
68
68
  option %w( width-size), "width of size field" do |num| @wds = num.to_i.nonzero? ; end
@@ -126,12 +126,18 @@ module RbFind
126
126
  end
127
127
 
128
128
  def join_code a, ind = 0
129
- case a
130
- when Array then
131
- a.map { |e| join_code e, ind + 1 }.join "\n"
132
- else
133
- INDENT * ind + a.to_s
134
- end
129
+ r = a.map { |e|
130
+ q = case e
131
+ when Array then
132
+ join_code e, ind + 1
133
+ else
134
+ INDENT * ind + e.to_s
135
+ end
136
+ q.rstrip!
137
+ q unless q.empty?
138
+ }
139
+ r.compact!
140
+ r.join "\n"
135
141
  end
136
142
 
137
143
  def build_block
@@ -148,7 +154,7 @@ module RbFind
148
154
  when :grep then
149
155
  ic = Regexp::IGNORECASE if @icase
150
156
  color = ", true" if co
151
- @block = [ "grep %r#{build_re @block, ic}#{color}"]
157
+ @block = [ "grep %r#{build_re @block.to_s, ic}#{color}"]
152
158
  @block.push "$stdout.flush" unless $stdout.tty?
153
159
  @binary or @block = [ "unless binary? then", @block, "end"]
154
160
 
@@ -161,6 +167,7 @@ module RbFind
161
167
  @block = @args.pop
162
168
  end
163
169
  end
170
+ @block = [ @block]
164
171
  output = case @puts
165
172
  when :ls then long_fmt false, false, "mtime.lsish", opath, co
166
173
  when :alt then long_fmt true, true, "mtime.long", opath, co
@@ -168,7 +175,7 @@ module RbFind
168
175
  when :ino then [ "spcsep ino.w8, nlink.w2, #{opath}"]
169
176
  when :plain then [ "puts #{opath}"]
170
177
  end
171
- output and @block = [ "if (", [ @block], ") then", output, "end"]
178
+ output and @block = [ "if (", @block, ") then", output, "end"]
172
179
 
173
180
  end
174
181
 
data/lib/rbfind.rb CHANGED
@@ -8,7 +8,7 @@ require "rbfind/csv"
8
8
 
9
9
  module RbFind
10
10
 
11
- VERSION = "2.14".freeze
11
+ VERSION = "2.14.1".freeze
12
12
 
13
13
  =begin rdoc
14
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbfind
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.14'
4
+ version: 2.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bertram Scharpf
@@ -33,7 +33,7 @@ files:
33
33
  - lib/rbfind/table.rb
34
34
  homepage: http://www.bertram-scharpf.de/software/rbfind
35
35
  licenses:
36
- - BSD-2-Clause
36
+ - BSD-2-Clause+
37
37
  metadata: {}
38
38
  rdoc_options: []
39
39
  require_paths: