vete 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vete.rb +8 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06504dd7c0db745520749c6870bce211b8b49c93be264805d99f27576db1b203
4
- data.tar.gz: 57e594abef634594f5dda56cfadf8bd00796de916ad5ea35eb9aed59b6997254
3
+ metadata.gz: 47c29a5b0f4ba59dbec76ce9db29421b38c6ac0a5988c69618d6358ed2f9c734
4
+ data.tar.gz: 4e48c009025a3a1220a8d60b4bf21013c08a19774d0fb8a4ab7d8e89f6e1c612
5
5
  SHA512:
6
- metadata.gz: 7c677308c467a8ac0e22edf3e2cbc5400743188922597b835c81435eb363b10cf424f36559c668bb167ac2e0f8a2ffdc3aa4ebce69e2c3f2ea8d450a16ab30ec
7
- data.tar.gz: 396cf9aa6fb29aa7bcbfd3be204dd5507f895d9cfe89b42e424a3d76c12dac87471f5836f80f29a2a1165d4e040a2959be5d6714d506b3529bbdb6331e03fbcd
6
+ metadata.gz: 8b629bc286b28c43bbab39b4f37ba3f9cdbc116d5283940200093fd86e5bd56ae1735910e2e805aa487a1a9cdd4030b67b480a0a32833723b1891e3cf104618b
7
+ data.tar.gz: de593f3ebf64ee5f8013c7a6031ed54c2edf7065f20eea8fb3c202ca32286fac561e9921c15df6903da81e0227bf19cb2343fd95f6c3736ba2ba7f57242d0911
data/lib/vete.rb CHANGED
@@ -19,7 +19,7 @@ trap("INT" ) { print clear + go; abort "\n" }
19
19
  trap("WINCH") { print clear or draw if @pid == Process.pid }
20
20
 
21
21
  OptionParser.new.instance_eval do
22
- @version = "1.0.2"
22
+ @version = "1.0.4"
23
23
  @banner = "usage: #{program_name} [options] [filename]"
24
24
 
25
25
  on "-b", "--bar <width>" , "Progress bar width, in characters", Integer
@@ -110,12 +110,12 @@ def bg(rgb=nil); rgb ? "\e[48;2;#{hex(rgb)}m" : "\e[49m"; end
110
110
 
111
111
  def draw(live=0, done=0, died=0, jobs=0, info=nil)
112
112
 
113
- # outer box
113
+ # outer box # # ╰╯╭╮─└┘┌┐
114
114
  unless info
115
115
  print [
116
116
  clear,
117
- go(2 + @work, @len + 3) + "" + "─" * (@wide + 2) + "┘\n",
118
- go(1 , @len + 3) + "" + "─" * (@wide + 2) + "┐\n",
117
+ go(2 + @work, @len + 3) + "" + "─" * (@wide + 2) + "╯\n",
118
+ go(1 , @len + 3) + "" + "─" * (@wide + 2) + "╮\n",
119
119
  ].join
120
120
  @work.times {|i| print " %*d │ %*s │\n" % [@len, i + 1, @wide, ""] }
121
121
  return
@@ -127,7 +127,7 @@ def draw(live=0, done=0, died=0, jobs=0, info=nil)
127
127
  info.each do |slot, this|
128
128
  tpct = this.to_f / most
129
129
  cols = ppct * tpct * @wide
130
- print go(slot + 1, @len + 5) + bg("5383ec") + @char * cols # fg("fff")
130
+ print go(slot + 1, @len + 5) + bg("5383ec") + @char * cols + bg
131
131
  end
132
132
 
133
133
  # summary bar
@@ -145,10 +145,7 @@ def draw(live=0, done=0, died=0, jobs=0, info=nil)
145
145
  bg("5383ec") + " %.1f%% " % [ppct * 100], # blue (done + died)
146
146
  done > 0 ? (bg + " " + bg("58a65c") + " #{done}/#{jobs} done ") : nil,
147
147
  died > 0 ? (bg + " " + bg("d85140") + " #{died} died ") : nil,
148
- ].join
149
-
150
- # clear colors
151
- print fg + bg
148
+ ].join + fg + bg
152
149
  end
153
150
 
154
151
  # ==[ Let 'er rip! ]==========================================================
@@ -197,6 +194,8 @@ defined?(perform) and list = Dir[File.join(@todo, "*")] and !list.empty? and beg
197
194
  when "task" then sleep task
198
195
  when Numeric then sleep task * @wait
199
196
  end if task < @work
197
+ @slot = slot + 1
198
+ @task = path
200
199
  perform(path)
201
200
  exit
202
201
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vete
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-01 00:00:00.000000000 Z
11
+ date: 2023-07-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby CLI to spawn processes to get work done
14
14
  email: steve.shreeve@gmail.com