utils 0.28.0 → 0.30.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/check-yaml +34 -0
- data/bin/search +2 -1
- data/lib/utils/grepper.rb +3 -2
- data/lib/utils/irb.rb +1 -1
- data/lib/utils/version.rb +1 -1
- data/utils.gemspec +6 -6
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cb494f8d8e61c44944eb494f3fe04545262c3001bf4f8dde73e44176697c0da
|
4
|
+
data.tar.gz: 0da8fdfe0bfdc1deeecfef01b65d9e93e7dcaf8cf4ac5c6f809192cc775b30ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 218f59ae66bdd4de4e645d50349c60cddb403be89a43d2a0f2f57956183a805543597af25a93775e2452dab17c90dfdcd9070331fb03e2572a05376ed979226b
|
7
|
+
data.tar.gz: 1a1b4f562220e13dfc6e003f47b033d7b9399dfee9fc97db06301baeca979a3b74283a223704f0e7474a7001445f29c532e66c511644b86560a5c53b460d9586
|
data/bin/check-yaml
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
format = -> s {
|
6
|
+
if /^\((?<f>[^)]+)\):\ (?<m>.*?) at line (?<l>\d+) column (?<c>\d+)/ =~ s
|
7
|
+
[ f, l, c, m ] * ?:
|
8
|
+
else
|
9
|
+
s
|
10
|
+
end
|
11
|
+
}
|
12
|
+
|
13
|
+
if filename = ARGV.first
|
14
|
+
begin
|
15
|
+
yaml = YAML.load_file(filename).to_yaml
|
16
|
+
ENV['DEBUG'].to_i == 1 and puts yaml
|
17
|
+
puts 'ok'
|
18
|
+
rescue => e
|
19
|
+
STDERR.puts format.(e.message)
|
20
|
+
puts 'nak'
|
21
|
+
exit 1
|
22
|
+
end
|
23
|
+
else
|
24
|
+
string = STDIN.read
|
25
|
+
begin
|
26
|
+
yaml = YAML.load(string).to_yaml
|
27
|
+
ENV['DEBUG'].to_i == 1 and puts yaml
|
28
|
+
puts 'ok'
|
29
|
+
rescue => e
|
30
|
+
STDERR.puts format.(e.message)
|
31
|
+
puts 'nak'
|
32
|
+
exit 1
|
33
|
+
end
|
34
|
+
end
|
data/bin/search
CHANGED
@@ -116,6 +116,7 @@ Options are
|
|
116
116
|
-B NUMBER displays NUMBER lines of context before the match
|
117
117
|
-C NUMBER displays NUMBER lines of context around the match
|
118
118
|
-f just list the paths of the files that would be searched
|
119
|
+
-F just consider real files when searching
|
119
120
|
-l just list the paths of the files with matches
|
120
121
|
-L list only the path:linenumber of the files with matches
|
121
122
|
-pX interpret PATTERN argument as X=f fuzzy or X=r for regexp
|
@@ -136,7 +137,7 @@ Version is #{File.basename($0)} #{Utils::VERSION}.
|
|
136
137
|
exit 1
|
137
138
|
end
|
138
139
|
|
139
|
-
args = go 'r:p:I:A:B:C:s:S:n:N:a:i:
|
140
|
+
args = go 'r:p:I:A:B:C:s:S:n:N:a:i:cfFlLeEvbgh'
|
140
141
|
args[?h] and usage
|
141
142
|
pattern = ARGV.shift or usage
|
142
143
|
roots = (ARGV.empty? ? [ Dir.pwd ] : ARGV).map { |f| File.expand_path(f) }
|
data/lib/utils/grepper.rb
CHANGED
@@ -156,11 +156,12 @@ class Utils::Grepper
|
|
156
156
|
def search
|
157
157
|
suffixes = Array(@args[?I])
|
158
158
|
visit = -> filename {
|
159
|
-
s = filename.
|
159
|
+
s = filename.lstat
|
160
160
|
bn = filename.pathname.basename
|
161
161
|
if !s ||
|
162
162
|
s.directory? && @config.search.prune?(bn) ||
|
163
|
-
s.file? && @config.search.skip?(bn)
|
163
|
+
(s.file? || s.symlink?) && @config.search.skip?(bn) ||
|
164
|
+
@args[?F] && s.symlink?
|
164
165
|
then
|
165
166
|
@args[?v] and warn "Pruning #{filename.inspect}."
|
166
167
|
prune
|
data/lib/utils/irb.rb
CHANGED
@@ -276,7 +276,7 @@ module Utils
|
|
276
276
|
expired = Time.now - start
|
277
277
|
diffs = cur.zip(pre).map { |c, p| c - p }
|
278
278
|
rates = diffs.map { |d| d / duration }
|
279
|
-
warn "#{expired} #{cur.zip(
|
279
|
+
warn "#{expired} #{cur.zip(diffs, rates).map(&:inspect) * ' '} 𝝙 / per sec."
|
280
280
|
pre = cur.map(&:to_f)
|
281
281
|
sleep duration
|
282
282
|
end
|
data/lib/utils/version.rb
CHANGED
data/utils.gemspec
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: utils 0.
|
2
|
+
# stub: utils 0.30.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "utils".freeze
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.30.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Florian Frank".freeze]
|
11
|
-
s.date = "2022-
|
11
|
+
s.date = "2022-07-07"
|
12
12
|
s.description = "This ruby gem provides some useful command line utilities".freeze
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
|
-
s.executables = ["ascii7".freeze, "blameline".freeze, "classify".freeze, "create_cstags".freeze, "create_tags".freeze, "discover".freeze, "edit".freeze, "edit_wait".freeze, "enum".freeze, "fix-brew".freeze, "git-empty".freeze, "git-versions".freeze, "irb_connect".freeze, "json_check".freeze, "long_lines".freeze, "myex".freeze, "number_files".freeze, "on_change".freeze, "path".freeze, "probe".freeze, "rd2md".freeze, "search".freeze, "sedit".freeze, "serve".freeze, "ssh-tunnel".freeze, "ssl_cert_info".freeze, "strip_spaces".freeze, "untest".freeze, "utils-utilsrc".freeze, "vcf2alias".freeze]
|
14
|
+
s.executables = ["ascii7".freeze, "blameline".freeze, "check-yaml".freeze, "classify".freeze, "create_cstags".freeze, "create_tags".freeze, "discover".freeze, "edit".freeze, "edit_wait".freeze, "enum".freeze, "fix-brew".freeze, "git-empty".freeze, "git-versions".freeze, "irb_connect".freeze, "json_check".freeze, "long_lines".freeze, "myex".freeze, "number_files".freeze, "on_change".freeze, "path".freeze, "probe".freeze, "rd2md".freeze, "search".freeze, "sedit".freeze, "serve".freeze, "ssh-tunnel".freeze, "ssl_cert_info".freeze, "strip_spaces".freeze, "untest".freeze, "utils-utilsrc".freeze, "vcf2alias".freeze]
|
15
15
|
s.extra_rdoc_files = ["README.md".freeze, "lib/utils.rb".freeze, "lib/utils/config_file.rb".freeze, "lib/utils/editor.rb".freeze, "lib/utils/file_xt.rb".freeze, "lib/utils/finder.rb".freeze, "lib/utils/grepper.rb".freeze, "lib/utils/irb.rb".freeze, "lib/utils/irb/service.rb".freeze, "lib/utils/line_blamer.rb".freeze, "lib/utils/line_formatter.rb".freeze, "lib/utils/md5.rb".freeze, "lib/utils/patterns.rb".freeze, "lib/utils/probe_server.rb".freeze, "lib/utils/ssh_tunnel_specification.rb".freeze, "lib/utils/version.rb".freeze, "lib/utils/xt/source_location_extension.rb".freeze]
|
16
|
-
s.files = [".github/workflows/codeql-analysis.yml".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ascii7".freeze, "bin/blameline".freeze, "bin/classify".freeze, "bin/create_cstags".freeze, "bin/create_tags".freeze, "bin/discover".freeze, "bin/edit".freeze, "bin/edit_wait".freeze, "bin/enum".freeze, "bin/fix-brew".freeze, "bin/git-empty".freeze, "bin/git-versions".freeze, "bin/irb_connect".freeze, "bin/json_check".freeze, "bin/long_lines".freeze, "bin/myex".freeze, "bin/number_files".freeze, "bin/on_change".freeze, "bin/path".freeze, "bin/probe".freeze, "bin/rd2md".freeze, "bin/search".freeze, "bin/sedit".freeze, "bin/serve".freeze, "bin/ssh-tunnel".freeze, "bin/ssl_cert_info".freeze, "bin/strip_spaces".freeze, "bin/untest".freeze, "bin/utils-utilsrc".freeze, "bin/vcf2alias".freeze, "lib/utils.rb".freeze, "lib/utils/config_file.rb".freeze, "lib/utils/editor.rb".freeze, "lib/utils/file_xt.rb".freeze, "lib/utils/finder.rb".freeze, "lib/utils/grepper.rb".freeze, "lib/utils/irb.rb".freeze, "lib/utils/irb/service.rb".freeze, "lib/utils/line_blamer.rb".freeze, "lib/utils/line_formatter.rb".freeze, "lib/utils/md5.rb".freeze, "lib/utils/patterns.rb".freeze, "lib/utils/probe_server.rb".freeze, "lib/utils/ssh_tunnel_specification.rb".freeze, "lib/utils/version.rb".freeze, "lib/utils/xt/source_location_extension.rb".freeze, "utils.gemspec".freeze]
|
16
|
+
s.files = [".github/workflows/codeql-analysis.yml".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ascii7".freeze, "bin/blameline".freeze, "bin/check-yaml".freeze, "bin/classify".freeze, "bin/create_cstags".freeze, "bin/create_tags".freeze, "bin/discover".freeze, "bin/edit".freeze, "bin/edit_wait".freeze, "bin/enum".freeze, "bin/fix-brew".freeze, "bin/git-empty".freeze, "bin/git-versions".freeze, "bin/irb_connect".freeze, "bin/json_check".freeze, "bin/long_lines".freeze, "bin/myex".freeze, "bin/number_files".freeze, "bin/on_change".freeze, "bin/path".freeze, "bin/probe".freeze, "bin/rd2md".freeze, "bin/search".freeze, "bin/sedit".freeze, "bin/serve".freeze, "bin/ssh-tunnel".freeze, "bin/ssl_cert_info".freeze, "bin/strip_spaces".freeze, "bin/untest".freeze, "bin/utils-utilsrc".freeze, "bin/vcf2alias".freeze, "lib/utils.rb".freeze, "lib/utils/config_file.rb".freeze, "lib/utils/editor.rb".freeze, "lib/utils/file_xt.rb".freeze, "lib/utils/finder.rb".freeze, "lib/utils/grepper.rb".freeze, "lib/utils/irb.rb".freeze, "lib/utils/irb/service.rb".freeze, "lib/utils/line_blamer.rb".freeze, "lib/utils/line_formatter.rb".freeze, "lib/utils/md5.rb".freeze, "lib/utils/patterns.rb".freeze, "lib/utils/probe_server.rb".freeze, "lib/utils/ssh_tunnel_specification.rb".freeze, "lib/utils/version.rb".freeze, "lib/utils/xt/source_location_extension.rb".freeze, "utils.gemspec".freeze]
|
17
17
|
s.homepage = "http://github.com/flori/utils".freeze
|
18
18
|
s.licenses = ["GPL-2.0".freeze]
|
19
19
|
s.rdoc_options = ["--title".freeze, "Utils - Some useful command line utilities".freeze, "--main".freeze, "README.md".freeze]
|
20
|
-
s.rubygems_version = "3.3.
|
20
|
+
s.rubygems_version = "3.3.14".freeze
|
21
21
|
s.summary = "Some useful command line utilities".freeze
|
22
22
|
|
23
23
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -127,6 +127,7 @@ email: flori@ping.de
|
|
127
127
|
executables:
|
128
128
|
- ascii7
|
129
129
|
- blameline
|
130
|
+
- check-yaml
|
130
131
|
- classify
|
131
132
|
- create_cstags
|
132
133
|
- create_tags
|
@@ -182,6 +183,7 @@ files:
|
|
182
183
|
- Rakefile
|
183
184
|
- bin/ascii7
|
184
185
|
- bin/blameline
|
186
|
+
- bin/check-yaml
|
185
187
|
- bin/classify
|
186
188
|
- bin/create_cstags
|
187
189
|
- bin/create_tags
|
@@ -250,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
252
|
- !ruby/object:Gem::Version
|
251
253
|
version: '0'
|
252
254
|
requirements: []
|
253
|
-
rubygems_version: 3.3.
|
255
|
+
rubygems_version: 3.3.14
|
254
256
|
signing_key:
|
255
257
|
specification_version: 4
|
256
258
|
summary: Some useful command line utilities
|