virtop 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/virtop +7 -1
  2. data/lib/virtop/table.rb +5 -1
  3. data/lib/virtop.rb +1 -1
  4. metadata +2 -2
data/bin/virtop CHANGED
@@ -123,7 +123,13 @@ begin
123
123
  end
124
124
 
125
125
  # Sort table by chosen column.
126
- t.sort_by sortBy
126
+ t.sort_by sortBy do |y|
127
+ if [2, 3].include? sortBy
128
+ y.to_i
129
+ else
130
+ y
131
+ end
132
+ end
127
133
 
128
134
  # Convert table to array of padded strings and add them to ncurses
129
135
  # screen.
data/lib/virtop/table.rb CHANGED
@@ -27,7 +27,11 @@ class Virtop::Table
27
27
  end
28
28
 
29
29
  @rows = @rows.sort_by do |row|
30
- row[index]
30
+ if block_given?
31
+ yield row[index]
32
+ else
33
+ row[index]
34
+ end
31
35
  end
32
36
  end
33
37
 
data/lib/virtop.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'libvirt'
2
2
 
3
3
  module Virtop
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
6
6
 
7
7
  $:.unshift File.dirname(__FILE__)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: virtop
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - henning mueller
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-11 00:00:00 +02:00
13
+ date: 2011-08-12 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency