murakumo 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cli/mrkmctl.rb CHANGED
@@ -74,6 +74,11 @@ IP address TTL Priority Activity Hostname
74
74
  is_success, errmsg = there.set_attr(*arg)
75
75
  is_success or raise(errmsg)
76
76
 
77
+ # デッドリストのクリア
78
+ when :clear_dead_list
79
+ n = there.clear_dead_list
80
+ puts "#{n} nodes were deleted"
81
+
77
82
  # 設定の出力
78
83
  when :yaml
79
84
  puts there.to_hash.to_yaml
@@ -63,7 +63,10 @@ def mrkmctl_parse_args
63
63
  end
64
64
  end
65
65
 
66
- desc ' configuration file is outputted by yaml'
66
+ desc 'clears a dead list'
67
+ option :clear_dead_list, '-c', '--clear-dead-list'
68
+
69
+ desc 'outputs a configuration as yaml'
67
70
  option :yaml, '-y', '--yaml'
68
71
 
69
72
  desc 'path of a socket file'
@@ -110,11 +113,11 @@ def mrkmctl_parse_args
110
113
  end
111
114
 
112
115
  # command
113
- commands = [:list, :add, :delete, :add_node, :delete_node, :get, :set, :yaml].map {|k|
116
+ commands = [:list, :add, :delete, :add_node, :delete_node, :get, :set, :clear_dead_list, :yaml].map {|k|
114
117
  [k, options[k]]
115
118
  }.select {|i| not i[1].nil? }
116
119
 
117
- opt_keys = %w(-L -A -D --add-node --delete-node --get --set --yaml)
120
+ opt_keys = %w(-L -A -D --add-node --delete-node --get --set --clear-dead-list --yaml)
118
121
 
119
122
  if commands.length < 1
120
123
  parse_error('command is not specified', *opt_keys)
@@ -1,5 +1,5 @@
1
1
  module Murakumo
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
 
4
4
  # Priority
5
5
  MASTER = 1
@@ -81,7 +81,7 @@ module Murakumo
81
81
  end
82
82
 
83
83
  # Control of service
84
- def_delegators :@gossip, :stop
84
+ def_delegators :@gossip, :stop, :clear_dead_list
85
85
 
86
86
  def start
87
87
  # デーモン化すると子プロセスはすぐ死ぬので
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: murakumo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - winebarrel
@@ -41,12 +41,12 @@ dependencies:
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- hash: 23
44
+ hash: 21
45
45
  segments:
46
46
  - 0
47
47
  - 1
48
- - 6
49
- version: 0.1.6
48
+ - 7
49
+ version: 0.1.7
50
50
  type: :runtime
51
51
  version_requirements: *id002
52
52
  - !ruby/object:Gem::Dependency