virtop 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/virtop +13 -2
  2. data/lib/virtop.rb +1 -1
  3. metadata +1 -1
data/bin/virtop CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'ncursesw'
4
4
  require 'uri'
5
+ require 'yaml'
5
6
 
6
7
  # Require and include virtop module. It will require libvirt.
7
8
  $:.unshift(File.dirname(__FILE__) + '/../lib')
@@ -24,10 +25,20 @@ EOF
24
25
  exit 1
25
26
  end
26
27
 
28
+ config = {
29
+ 'urls' => ['qemu:///system'],
30
+ 'sort_by' => 0
31
+ }
32
+
33
+ begin
34
+ config.merge!(YAML.load_file(File.expand_path('~/.virtop.yaml')))
35
+ rescue Errno::ENOENT
36
+ end
37
+
27
38
  # Connection URL will be qemu:///system if nothing else is given as the first
28
39
  # parameter.
29
40
  if ARGV.size < 1
30
- urls = ['qemu:///system']
41
+ urls = config['urls']
31
42
  else
32
43
  urls = []
33
44
 
@@ -69,7 +80,7 @@ begin
69
80
  Ncurses.halfdelay 10
70
81
 
71
82
  # Default sorting by first column (domain name).
72
- sortBy = 0
83
+ sortBy = config['sort_by']
73
84
 
74
85
  while true
75
86
  Ncurses.clear
data/lib/virtop.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'libvirt'
2
2
 
3
3
  module Virtop
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
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.3
5
+ version: 0.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - henning mueller