casseo 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -239,15 +239,25 @@ module Casseo
239
239
  Curses.refresh
240
240
  end
241
241
 
242
+ def format_period(seconds)
243
+ case true
244
+ when seconds < 60 then "#{seconds}s"
245
+ when seconds < 3600 then "#{seconds / 60}m"
246
+ when seconds < 86400 then "#{seconds / 3600}h"
247
+ else "#{seconds / 86400}d"
248
+ end
249
+ end
250
+
242
251
  def show_status
243
252
  Curses.setpos(num_lines, 0)
244
253
  Curses.attron(Curses::color_pair(STATUS) | Curses::A_NORMAL) do
245
- str = "Casseo: =#{@name} (#{@period}m) " +
246
- "[Metrics:#{@num_metrics} Page:#{@page}/#{num_pages} " +
247
- "Interval:#{Config.interval.to_i}s]"
254
+ str = "Casseo: =%s (%s) [Metrics:%s Interval:%ss]" %
255
+ [@name, format_period(@period * 60), @num_metrics, Config.interval.to_i]
256
+ page_str = "--- %s/%s ---" % [@page, num_pages]
257
+
258
+ # right align the page number
259
+ str += "%#{Curses.cols - str.length}s" % page_str
248
260
 
249
- # pad until the end of the line so we get the background
250
- str += " " * (Curses.cols - str.length)
251
261
  Curses.addstr(str)
252
262
  end
253
263
  end
@@ -1,3 +1,3 @@
1
1
  module Casseo
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: casseo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: