villein 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/villein/agent.rb +7 -5
- data/lib/villein/tags.rb +4 -0
- data/lib/villein/version.rb +1 -1
- data/spec/tags_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5c615e2b141f002aed95140b94e8df47c7d05f1
|
4
|
+
data.tar.gz: e1a88330fa171bf6d9e906f3d6d39eaf4c133fc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad2473ae38e77bdd1b748ab2a6ee2bec54cb36ca0bbc41121cdd47eddeaadd77abb1b9e328375f8d811843e6e35e3aa2e156dd98533bf819dcfe7e0a637e59bb
|
7
|
+
data.tar.gz: d58a938b086694e1f005c9485301328388a07b5ca2a7b7e0897beb6103cf147bb167ae0ac75ac15d5654752138a314902894bd1b8d764ab4fb06a449dbaa8fdf
|
data/lib/villein/agent.rb
CHANGED
@@ -62,9 +62,9 @@ module Villein
|
|
62
62
|
|
63
63
|
# Start the serf agent.
|
64
64
|
def start!
|
65
|
-
raise AlreadyStarted if running?
|
66
|
-
|
67
65
|
@pid_lock.synchronize do
|
66
|
+
raise AlreadyStarted if running?
|
67
|
+
|
68
68
|
start_listening_events
|
69
69
|
start_process
|
70
70
|
start_watchdog
|
@@ -75,9 +75,9 @@ module Villein
|
|
75
75
|
# Stop the serf agent.
|
76
76
|
# After +timeout_sec+ seconds elapsed, it will attempt to KILL if the agent is still running.
|
77
77
|
def stop!(timeout_sec = 10)
|
78
|
-
raise NotRunning unless running?
|
79
|
-
|
80
78
|
@pid_lock.synchronize do
|
79
|
+
raise NotRunning unless running?
|
80
|
+
|
81
81
|
Process.kill(:INT, @pid)
|
82
82
|
|
83
83
|
stop_watchdog
|
@@ -99,13 +99,15 @@ module Villein
|
|
99
99
|
end
|
100
100
|
|
101
101
|
%w(member_join member_leave member_failed member_update member_reap
|
102
|
-
|
102
|
+
user query stop event).each do |event|
|
103
103
|
|
104
104
|
define_method(:"on_#{event}") do |&block|
|
105
105
|
add_hook(event, block)
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
|
+
alias_method :on_user_event, :on_user
|
110
|
+
|
109
111
|
##
|
110
112
|
# Command line arguments to start serf-agent.
|
111
113
|
def command
|
data/lib/villein/tags.rb
CHANGED
data/lib/villein/version.rb
CHANGED
data/spec/tags_spec.rb
CHANGED
@@ -42,10 +42,10 @@ describe Villein::Tags do
|
|
42
42
|
|
43
43
|
describe "#update(hash)" do
|
44
44
|
it "sets multiple tags at once" do
|
45
|
-
expect(parent).to receive(:set_tag).with('a', '
|
46
|
-
expect(parent).to receive(:set_tag).with('b', '
|
45
|
+
expect(parent).to receive(:set_tag).with('a', '0').and_return('1')
|
46
|
+
expect(parent).to receive(:set_tag).with('b', '1').and_return('2')
|
47
47
|
|
48
|
-
tags.update(a:
|
48
|
+
tags.update(a: 0, b: 1)
|
49
49
|
end
|
50
50
|
|
51
51
|
context "with nil" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: villein
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Fukumori (sora_h)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|