rbbt-util 5.23.1 → 5.23.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/util/log.rb +8 -0
- data/lib/rbbt/util/log/progress/report.rb +4 -12
- data/lib/rbbt/util/simpleopt/get.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1abbd56b35b1634d8c938f2546caaa9c1e5a0cb
|
4
|
+
data.tar.gz: 356c77c59b70e8d20416a9dff4a99e9d61bab588
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d11225414f26e825220f381e7912ee483cadb1c83d9e403049b16c03de5e982080d9c93b473d425b45b225c5dac3c9d910bfc5e6a59b6fc9c3d4e3c6e63dc639
|
7
|
+
data.tar.gz: 70e20be0981b91d2aba8f593bc6f57881425cb7e95c9fb84e0a21b4a0deb749847576a21df42cd1c630f3ce733bf43f036e53ed56d1358f56c4b33cd1c0b83a3
|
data/lib/rbbt/util/log.rb
CHANGED
@@ -1,13 +1,5 @@
|
|
1
1
|
module Log
|
2
2
|
class ProgressBar
|
3
|
-
def up_lines(depth)
|
4
|
-
"\033[#{depth + 1}F\033[2K"
|
5
|
-
end
|
6
|
-
|
7
|
-
def down_lines(depth)
|
8
|
-
"\n\033[#{depth + 2}E"
|
9
|
-
end
|
10
|
-
|
11
3
|
def print(io, str)
|
12
4
|
return if ENV["RBBT_NO_PROGRESS"] == "true"
|
13
5
|
LOG_MUTEX.synchronize do
|
@@ -149,8 +141,8 @@ module Log
|
|
149
141
|
bars = BARS
|
150
142
|
end
|
151
143
|
|
152
|
-
print(io, up_lines(bars.length) << Log.color(:yellow, "...Progress\n") << down_lines(bars.length))
|
153
|
-
print(io, up_lines(@depth) << report_msg << down_lines(@depth))
|
144
|
+
print(io, Log.up_lines(bars.length) << Log.color(:yellow, "...Progress\n") << Log.down_lines(bars.length))
|
145
|
+
print(io, Log.up_lines(@depth) << report_msg << Log.down_lines(@depth))
|
154
146
|
@last_time = Time.now
|
155
147
|
@last_count = ticks
|
156
148
|
@last_percent = percent if max and max > 0
|
@@ -169,7 +161,7 @@ module Log
|
|
169
161
|
@last_count = 0
|
170
162
|
@last_time = @start
|
171
163
|
done_msg << " (" << thr_msg << ")"
|
172
|
-
print(io, up_lines(@depth) << done_msg << down_lines(@depth))
|
164
|
+
print(io, Log.up_lines(@depth) << done_msg << Log.down_lines(@depth))
|
173
165
|
Open.rm @file if @file and Open.exists? @file
|
174
166
|
end
|
175
167
|
|
@@ -185,7 +177,7 @@ module Log
|
|
185
177
|
@last_count = 0
|
186
178
|
@last_time = @start
|
187
179
|
done_msg << " (" << thr_msg << ")"
|
188
|
-
print(io, up_lines(@depth) << done_msg << down_lines(@depth))
|
180
|
+
print(io, Log.up_lines(@depth) << done_msg << Log.down_lines(@depth))
|
189
181
|
Open.rm @file if @file and Open.exists? @file
|
190
182
|
end
|
191
183
|
end
|