tvd-tvdinner 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.25
1
+ 0.0.26
@@ -4,6 +4,7 @@
4
4
  if [[ "$__meat__" != 'x' ]]; then
5
5
  return 0
6
6
  fi
7
+
7
8
  __meat__='y'
8
9
 
9
10
  if [[ -z "${shome:-}" ]]; then
@@ -132,6 +133,52 @@ function runmany {
132
133
  fi | xargs -P $cpu -n $args -- bash -c "$*" ""
133
134
  }
134
135
 
136
+ function mark_log {
137
+ local nm_mark="$1"; shift
138
+ touch "$tmp_switch/wait-$nm_mark"
139
+ echo $tmp_switch $nm_mark
140
+ while [[ -f "$tmp_switch/wait-$nm_mark" ]]; do
141
+ sleep 1
142
+ done
143
+ }
144
+
145
+ function marked_logger {
146
+ local nm_switch=""
147
+ while read -r a b; do
148
+ if [[ "$a" = "$tmp_switch" ]]; then
149
+ nm_switch="$b"
150
+ rm "$tmp_switch/wait-$nm_switch"
151
+ else
152
+ if [[ -z "$nm_switch" ]]; then
153
+ echo "$a $b"
154
+ else
155
+ echo "$nm_switch: $a $b"
156
+ fi
157
+ fi
158
+ done
159
+ }
160
+
161
+ function mark_stdout {
162
+ if [[ -z "${tmp_switch:-}" ]]; then
163
+ tmp_switch="$(mktemp -d -t XXXXXXXXX)"
164
+ fi
165
+ exec 1> >(marked_logger)
166
+ }
167
+
168
+ function mark_stderr {
169
+ if [[ -z "${tmp_switch:-}" ]]; then
170
+ tmp_switch="$(mktemp -d -t XXXXXXXXX)"
171
+ fi
172
+ exec 2> >(marked_logger)
173
+ }
174
+
175
+ function mark_output {
176
+ if [[ -z "${tmp_switch:-}" ]]; then
177
+ tmp_switch="$(mktemp -d -t XXXXXXXXX)"
178
+ fi
179
+ exec 1> >(marked_logger) 2>&1
180
+ }
181
+
135
182
  function _main {
136
183
  if [[ -z "$shome" ]]; then
137
184
  shome="$(unset CDPATH; cd -P -- "$(dirname -- "${BASH_SOURCE}")/.." && pwd -P)"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tvd-tvdinner
3
3
  version: !ruby/object:Gem::Version
4
- hash: 45
4
+ hash: 43
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 25
10
- version: 0.0.25
9
+ - 26
10
+ version: 0.0.26
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tom Bombadil
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-03-12 00:00:00 -07:00
18
+ date: 2013-03-29 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency