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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1387c90c7d1b469409501f758b509242302e74b1
4
- data.tar.gz: 8a8c064c4bb2d8ef569c6d6caa23804cec847f81
3
+ metadata.gz: e1abbd56b35b1634d8c938f2546caaa9c1e5a0cb
4
+ data.tar.gz: 356c77c59b70e8d20416a9dff4a99e9d61bab588
5
5
  SHA512:
6
- metadata.gz: 0beeca3f823da88c8cfc94cbc8eefd30692a736eff13ac648a7592985ca4585dc4b7ba72ca2ce990e915b8ee5307e87b920b6bc835bd469807654a0b41b710d5
7
- data.tar.gz: 851277c016a171d1db79e3f16d33ef8f967fff05eaba1c33d70d73c7851a3a19153de0ae01902d9d4903ef0e93ecf57c7ddd920ca1a60516aca84e066aa2f21e
6
+ metadata.gz: d11225414f26e825220f381e7912ee483cadb1c83d9e403049b16c03de5e982080d9c93b473d425b45b225c5dac3c9d910bfc5e6a59b6fc9c3d4e3c6e63dc639
7
+ data.tar.gz: 70e20be0981b91d2aba8f593bc6f57881425cb7e95c9fb84e0a21b4a0deb749847576a21df42cd1c630f3ce733bf43f036e53ed56d1358f56c4b33cd1c0b83a3
data/lib/rbbt/util/log.rb CHANGED
@@ -133,6 +133,14 @@ module Log
133
133
  end
134
134
  end
135
135
 
136
+ def self.up_lines(num = 0)
137
+ "\033[#{num+1}F\033[2K"
138
+ end
139
+
140
+ def self.down_lines(num = 0)
141
+ "\n\033[#{num+2}E"
142
+ end
143
+
136
144
  def self.return_line
137
145
  nocolor ? "" : "\033[1A"
138
146
  end
@@ -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
@@ -4,6 +4,7 @@ module SOPT
4
4
  values = {}
5
5
  while i < args.length do
6
6
  current = args[i]
7
+ break if current == "--"
7
8
  if m = current.match(/--?(.+?)(?:=(.+))?$/)
8
9
  key = $1
9
10
  value = $2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.23.1
4
+ version: 5.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez