vete 0.6.0 → 0.6.2

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 +9 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e19484c6c02cd403365def0a14367e2c31f302edd7b56842e863162d0178730
4
- data.tar.gz: 303793b8c478fe08733f2da221a325d66e68b2d3ab54c89105482ef612866953
3
+ metadata.gz: ed49e57cfc742410d72465e306317b8710b4442ac76e96f076a946c0772fa3a6
4
+ data.tar.gz: 6401087237fe0105ccf98035553a034fa28a87e72d2d7dca22fc097c61f37ff7
5
5
  SHA512:
6
- metadata.gz: 59e65ecb548ffa4ccc95f4928f83cb036cefaae98e447801c03616627557614f871f24442b331fd1f6d1211beaf8559f7b98870ea3e31a316ab22af6041d438f
7
- data.tar.gz: 03aef3e49b3ee52dbd6867adee656d67fb6124f3eabc027732d35be04e46b0db0139a59abfc00d64079d2f4ce95b6d2cb24cb7e1f752283168196f965e028adb
6
+ metadata.gz: 9eae490b4b8b0dc6237cb12f32a8f66354b6c034723481db5238f4b93fa2ef012e8c2168f2b0184567d267434d118a405a0a7f0c769c602ee3a58a6574948883
7
+ data.tar.gz: 9e28550582a169c9d00acbfca55eecf802ee0ea989a2e1ae1077e735aad173561a1566ba8ab7242684861c3bdddb6c5c1a2d8c483d90d472e66c27fcb642e920
data/lib/vete.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # vete - Ruby CLI to spawn processes to get work done
3
3
  #
4
4
  # Author: Steve Shreeve (steve.shreeve@gmail.com)
5
- # Date: Mar 21, 2023
5
+ # Date: Mar 22, 2023
6
6
  # ============================================================================
7
7
 
8
8
  STDOUT.sync = true
@@ -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 = "0.6.0"
22
+ @version = "0.6.2"
23
23
  @banner = "usage: #{program_name} [options]"
24
24
 
25
25
  on "-b", "--bar <width>" , "Progress bar width, in characters", Integer
@@ -82,8 +82,9 @@ def vete_retry
82
82
  move(list, @todo)
83
83
  end
84
84
 
85
- def vete_todo(path)
86
- FileUtils.touch(File.join(@todo, path.to_s))
85
+ def vete_todo(path, data=nil)
86
+ path = File.join(@todo, path.to_s)
87
+ data ? File.write(path, data) : FileUtils.touch(path)
87
88
  end
88
89
 
89
90
  # ==[ Drawing ]===============================================================
@@ -132,10 +133,10 @@ def draw(live=0, done=0, died=0, jobs=0, info=nil)
132
133
  print [
133
134
  go(@work + 3, @len + 5),
134
135
  fg("fff"),
135
- bg("58a65c") + @char * ( gcol ) , # green (done)
136
- bg("f1bf42") + @char * ( ycol) , # yellow (live)
136
+ bg("58a65c") + @char * ( gcol ), # green (done)
137
+ bg("f1bf42") + @char * ( ycol), # yellow (live)
137
138
  bg("d85140") + " " * (@wide - gcol - ycol).ceil, # red (rest)
138
- go(@work + 3, @len + 5 + @wide + 3) , # scoot over...
139
+ go(@work + 3, @len + 5 + @wide + 3),
139
140
  bg("5383ec") + " %.1f%% " % [ppct * 100], # blue (done + died)
140
141
  done > 0 ? (bg + " " + bg("58a65c") + " #{done} done ") : nil,
141
142
  died > 0 ? (bg + " " + bg("d85140") + " #{died} died ") : nil,
@@ -197,7 +198,7 @@ begin
197
198
  end
198
199
  end
199
200
  while @que.size != @work
200
- sleep 1
201
+ sleep 0.3
201
202
  draw(live, done, died, jobs, info.dup)
202
203
  end
203
204
  end.join
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve