utils 0.31.0 → 0.32.0
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 +2 -2
- data/lib/utils/irb.rb +15 -1
- data/lib/utils/version.rb +1 -1
- data/utils.gemspec +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d17880a737efe4faa70793a2494ff4eb36f9d937bc7980a53c50146f06d5b0c
|
4
|
+
data.tar.gz: 69f0c24ad275b489b6aa9bd20280261f8ed0de54f49517b192a73cf7f8d87e4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18ce35eb3ad249b5d214e6573e76824c91037c3929702ef9363737248aef6f45b0674939bf00dadcfeb6ee0b747614decc617b049d92504e584c2d44293d4942
|
7
|
+
data.tar.gz: aaaa14b75fd266bc0b7296019549df949363094559968fcfe6a0416aa6e8c08cfb0db60685ae7fbcbb1141d24d7008a8aaf01aebbf26c0be12ef8160328758cf
|
data/bin/check-yaml
CHANGED
@@ -12,7 +12,7 @@ format = -> s {
|
|
12
12
|
|
13
13
|
if filename = ARGV.first
|
14
14
|
begin
|
15
|
-
yaml = YAML.
|
15
|
+
yaml = YAML.unsafe_load_file(filename).to_yaml
|
16
16
|
ENV['DEBUG'].to_i == 1 and puts yaml
|
17
17
|
puts 'ok'
|
18
18
|
rescue => e
|
@@ -23,7 +23,7 @@ if filename = ARGV.first
|
|
23
23
|
else
|
24
24
|
string = STDIN.read
|
25
25
|
begin
|
26
|
-
yaml = YAML.
|
26
|
+
yaml = YAML.unsafe_load(string).to_yaml
|
27
27
|
ENV['DEBUG'].to_i == 1 and puts yaml
|
28
28
|
puts 'ok'
|
29
29
|
rescue => e
|
data/lib/utils/irb.rb
CHANGED
@@ -273,6 +273,7 @@ module Utils
|
|
273
273
|
def irb_time_watch(duration = 1)
|
274
274
|
start = Time.now
|
275
275
|
pre = nil
|
276
|
+
avg = Hash.new
|
276
277
|
loop do
|
277
278
|
cur = [ yield ].flatten
|
278
279
|
unless pre
|
@@ -282,7 +283,20 @@ module Utils
|
|
282
283
|
expired = Time.now - start
|
283
284
|
diffs = cur.zip(pre).map { |c, p| c - p }
|
284
285
|
rates = diffs.map { |d| d / duration }
|
285
|
-
|
286
|
+
durs = cur.zip(rates).each_with_index.map { |(c, r), i|
|
287
|
+
if r < 0
|
288
|
+
x = c.to_f / -r
|
289
|
+
a = avg[i].to_f
|
290
|
+
a -= a / 2
|
291
|
+
a += x / 2
|
292
|
+
d = Tins::Duration.new(a)
|
293
|
+
ds = d.to_s
|
294
|
+
ds.singleton_class { define_method(:to_f) { d.to_f } }
|
295
|
+
avg[i] = ds
|
296
|
+
end
|
297
|
+
avg[i]
|
298
|
+
}
|
299
|
+
warn "#{expired} #{cur.zip(diffs, rates, durs).map(&:inspect) * ' '} 𝝙 / per sec."
|
286
300
|
pre = cur.map(&:to_f)
|
287
301
|
sleep duration
|
288
302
|
end
|
data/lib/utils/version.rb
CHANGED
data/utils.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: utils 0.
|
2
|
+
# stub: utils 0.32.0 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.32.0"
|
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-11-04"
|
12
12
|
s.description = "This ruby gem provides some useful command line utilities".freeze
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
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]
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
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.
|
20
|
+
s.rubygems_version = "3.3.22".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.32.0
|
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-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
252
|
- !ruby/object:Gem::Version
|
253
253
|
version: '0'
|
254
254
|
requirements: []
|
255
|
-
rubygems_version: 3.
|
255
|
+
rubygems_version: 3.3.22
|
256
256
|
signing_key:
|
257
257
|
specification_version: 4
|
258
258
|
summary: Some useful command line utilities
|