utils 0.31.1 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d7f609e660eeda7da1508e1b1afddd1a3b01e7232153f59ba4ca4cc1b11b052
4
- data.tar.gz: ba8ef55413f9b3890f4cfd239864c67e10fb81ac5314197932c451b2f69bdd7d
3
+ metadata.gz: 6d17880a737efe4faa70793a2494ff4eb36f9d937bc7980a53c50146f06d5b0c
4
+ data.tar.gz: 69f0c24ad275b489b6aa9bd20280261f8ed0de54f49517b192a73cf7f8d87e4f
5
5
  SHA512:
6
- metadata.gz: 8ab8ae0a58b32aa3c78b6002bf6a4bde18cbaa99070a4dabeb198aabf2d1bc1a4b33856adb77fe0ac812220335ace5d8d802df267576b6e629c3b23524e670df
7
- data.tar.gz: adcf4e93e2a3f6b507c4eea3ec2ab65c9d02054be2db6ed8ae9ca18803e39b33bb14e5578a2fb342124a5c300c8c7484740e63e4bea8a7b441a2b83fa03cea9f
6
+ metadata.gz: 18ce35eb3ad249b5d214e6573e76824c91037c3929702ef9363737248aef6f45b0674939bf00dadcfeb6ee0b747614decc617b049d92504e584c2d44293d4942
7
+ data.tar.gz: aaaa14b75fd266bc0b7296019549df949363094559968fcfe6a0416aa6e8c08cfb0db60685ae7fbcbb1141d24d7008a8aaf01aebbf26c0be12ef8160328758cf
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
- warn "#{expired} #{cur.zip(diffs, rates).map(&:inspect) * ' '} 𝝙 / per sec."
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
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.31.1'
3
+ VERSION = '0.32.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/utils.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: utils 0.31.1 ruby lib
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.31.1"
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-08-04"
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.2.33".freeze
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.31.1
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-08-04 00:00:00.000000000 Z
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.2.33
255
+ rubygems_version: 3.3.22
256
256
  signing_key:
257
257
  specification_version: 4
258
258
  summary: Some useful command line utilities