fasten 0.14.4 → 0.16.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: 790a1d8191184aff7cc7db302aa2675d7222321fadc2762f23037f1ee31c4673
4
- data.tar.gz: 19d21a87a855fdcb23a07ffd6ccb5787eaf33dfb1ce9eba8edb2e49ffa06ee62
3
+ metadata.gz: d3ee0cd8e9128821758efe48a22b7a46150383006040c3681a91ec7a90cbce50
4
+ data.tar.gz: d0e85d0f4931e26145d4733a3d9e7f3caff9878fb2e44397b6a95102d0fdfa34
5
5
  SHA512:
6
- metadata.gz: 19539cc0b6f947655a61533020107d8b7e023a3ed69de5aa7b88979f21c2d9ee71a9549c2f1d704880f23f7c666ac57a60ed86724c17c1f34bbe74c9f848b0c5
7
- data.tar.gz: b3b679c630152b39a489748ace2293992ddef25791698599fe8302257898aec2b47d6ebd4e030e3ac1d75829b18d07581aa7e83995db5a7ef7993c9da8b4055b
6
+ metadata.gz: f701744c40a44fe18d352841f3210136f4a16487bacd4e982b772311edceb5c406d9b579a67c4513243a8200a3a82dab7592d6942a113677b43b54cf2a5fd60f
7
+ data.tar.gz: b1ca8984102cdf0223851b62206719eaf369252dfe40c8e3ff10cb0b1fdaa070713f0f83b476fcb2127e61249bb283b6c58fa866338f064d3aecbaa61abc4b2f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fasten (0.14.4)
4
+ fasten (0.16.0)
5
5
  binding_of_caller
6
6
  hirb
7
7
  os
@@ -20,7 +20,7 @@ module Fasten
20
20
  puts <<~FIN
21
21
 
22
22
  = == === ==== ===== ====== ======= ======== ========= ==========
23
- Fasten your seatbelts! #{'💺' * jobs} #{runner.use_threads ? 'threads' : 'processes'}
23
+ Fasten your seatbelts! #{'💺' * jobs} #{jobs} #{runner.use_threads ? 'threads' : 'processes'} #{tasks.count} tasks
24
24
 
25
25
  #{name}
26
26
  FIN
@@ -48,9 +48,29 @@ module Fasten
48
48
  def display_task_message(orig, old, message)
49
49
  return unless old.count != orig.count
50
50
 
51
+ elapsed_str = hformat Time.new - runner.ini
52
+
53
+ time_str = [elapsed_str, eta_str].compact.join(' ')
54
+
51
55
  (orig - old).each do |task|
52
- puts "Time: #{hformat Time.new - runner.ini} #{message} #{hformat task.dif} #{task.worker} Task #{task}"
53
56
  old << task
57
+ puts "#{count_str(old.count, tasks.count)} Time: #{time_str} #{message} #{hformat task.dif} #{task.worker} Task #{task}"
58
+ end
59
+ end
60
+
61
+ def count_str(count, total)
62
+ len = total.to_s.length
63
+ format "%#{len}d/%#{len}d", count, total
64
+ end
65
+
66
+ def eta_str
67
+ @eta_str ||= begin
68
+ @runner_last_avg = runner.last_avg
69
+ if runner.last_avg && runner.last_err
70
+ format 'ETA ≈ %s ± %.2f', hformat(runner.last_avg), runner.last_err
71
+ elsif runner.last_avg
72
+ format 'ETA ≈ %s', hformat(runner.last_avg)
73
+ end
54
74
  end
55
75
  end
56
76
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fasten
4
- VERSION = '0.14.4'
4
+ VERSION = '0.16.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fasten
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.4
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aldrin Martoq
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-07 00:00:00.000000000 Z
11
+ date: 2021-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses