redis-stat 0.4.11 → 0.4.12

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: 9fd5c0f47669aa7c59d323fbd0a4c467addf50cb
4
- data.tar.gz: 2588731df8268eeecb90bf7ad601089f692fb7d3
3
+ metadata.gz: 620b88df3da7dcfd956b3145547b9fc45dd71063
4
+ data.tar.gz: e63968613471cd7cbeb6bead4fc394393f625a26
5
5
  SHA512:
6
- metadata.gz: c7c580d506402e6de59c31c62f08ed1714f38fff0abe6729ac0242a271cb3b7396413b7a9b8356d48c1bae55ed66ad1ddaa8619b756915c3fda553eab194ab1e
7
- data.tar.gz: 372783bcd10c91e17dca8dfe819e61e605f455ecf2a112049ee9b947afc9cb4217a6ad4f8dcd65abeac6064a6ed4583c20d36719bc147e5aa590ede0b3c905a8
6
+ metadata.gz: 16693f8340f90aff4f055be91472e54dd430db0e180106f24a46526e1a58ac73c66e4c7a8b8fdc17427138135147ee8bb8689e50e3c06805db89feb762759bed
7
+ data.tar.gz: eb7769fd2ab7768ecd54ddab4c6242c51ed0a7ea9ff004e95c8de1e42566bf362a6fceae62f639bc99e2da40579fb75cb88fb51b1c9d64628f602684085746e5
@@ -258,8 +258,18 @@ private
258
258
  end
259
259
  end
260
260
 
261
- @term_width = (`tput cols` rescue DEFAULT_TERM_WIDTH).to_i
262
- @term_height = (`tput lines` rescue DEFAULT_TERM_HEIGHT).to_i - 4
261
+ @term_width, @term_height = tput_term_size
262
+ end
263
+
264
+ def tput_term_size
265
+ return [DEFAULT_TERM_WIDTH, DEFAULT_TERM_HEIGHT - 4] if @term_fixed
266
+
267
+ dim = %w[cols lines].map { |attr| (`tput #{attr}` || nil).to_i }
268
+ if dim.index(0)
269
+ @term_fixed = true
270
+ return tput_term_size
271
+ end
272
+ [dim.first, dim.last - 4]
263
273
  end
264
274
 
265
275
  def move! lines
@@ -1,3 +1,3 @@
1
1
  class RedisStat
2
- VERSION = '0.4.11'
2
+ VERSION = '0.4.12'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-stat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.11
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Junegunn Choi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-18 00:00:00.000000000 Z
11
+ date: 2015-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi256