infopark-politics 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTk3MGVhMDFjZDY5ZjUxOTdmOTUxYmVlZWFkNmEwMzRkNTRkNWQwOA==
4
+ OGYyMmNhMjBlZDFiMTIzZTJjZWU0ODg2NjgyYmM4ZTE2NTdiNDZhNw==
5
5
  data.tar.gz: !binary |-
6
- Y2FhMGQ3MDIyMzNiNTM0N2Y0NDc4NjVkYzA4MDg1NjcwODhiNmJkYw==
6
+ ZTU5ZGU0MDI2YjRiM2FiNjlmNWJlNDU1YzA1NDYxZGQ5NDU1MTg5OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTI5MzQ3MjY5NTcwMmM2YjdlMTMxZTlhNDBkYTM5NWJjNDRkZjExMzYyOTUx
10
- NzhjMTlkMDM1ZWYyMTI5NzFlN2NiYTBkMDFjNWMyMDJjNzNjY2RhYjVjMzM5
11
- MmIwNDdiZmE1NjFlYjgwM2I3M2ZhMjdmNDkzMjgwMjc1YzJkMjc=
9
+ NzYzZjk0MWVmYzZhNzhmZTFkYjQzM2I2NTViMGUzMWFlN2ZlZTFmNDdlMTQ2
10
+ Y2RlMTc5ZmU4YzAxNTAxOGNkYjc4N2I0NDM0MDhmYTEzZTg4YmYzYTY5YWZm
11
+ NjJmMzFjYTkzYzVjMTE0NTZkNTY0NzE1NTZhNzM1MjAzYjk2NTA=
12
12
  data.tar.gz: !binary |-
13
- YzAyODE3MjBjMGFlOGUxNTllZjY0YzdkNTAxYTIzZWIwZTA4NTZjNDViMWRl
14
- MWMwNzdhZjZkYjVjNTM5NWNhODc5OTBhMzcyM2E4ODJiNTA2NjVhZGM4NWJk
15
- NjVlZWE0MzY0NjM1MjZiMTZjZjMzOGIwMDNlYzUwZWZiYWQwYzk=
13
+ YTEwM2MyOGEwMjIxNGI1ZmJlMThjY2MxNWJlNzYyZjQ4ZDEwNmVkM2I2NDE5
14
+ MDQ3OWUxNTUzNzgwZTJjYmVkYTMyNmJjZGU3ZTM2Yzk4NGI4MWMwYWUyYWRl
15
+ ZDJhM2JlZmY1NzhhOWI0YTI2OWFmMDFiMDMzMTJkZDkyYTFmOGE=
@@ -6,7 +6,7 @@ end
6
6
 
7
7
  Gem::Specification.new do |gem|
8
8
  gem.name = "infopark-politics"
9
- gem.version = "0.6.0"
9
+ gem.version = "0.7.0"
10
10
  gem.summary = "Algorithms and Tools for Distributed Computing in Ruby."
11
11
  gem.description = ""
12
12
  gem.authors = ["Mike Perham", "Tilo Prütz"]
@@ -93,6 +93,7 @@ module Politics
93
93
  end
94
94
 
95
95
  def perform_leader_duties
96
+ before_perform_leader_duties
96
97
  # Drb thread handles requests to leader
97
98
  as_dictator do
98
99
  initialize_buckets
@@ -172,6 +173,9 @@ module Politics
172
173
 
173
174
  private
174
175
 
176
+ def before_perform_leader_duties
177
+ end
178
+
175
179
  def restart_wanted?
176
180
  @memcache_client.get(restart_flag)
177
181
  end
@@ -249,6 +249,16 @@ describe Worker do
249
249
  worker.stub(:dictatorship_length).and_return 666
250
250
  worker.stub(:iteration_length).and_return 5
251
251
  worker.stub(:find_workers).and_return []
252
+ worker.stub(:initialize_buckets)
253
+ end
254
+
255
+ it "performs before_perform_leader_duties callback" do
256
+ worker.should_receive(:before_perform_leader_duties)
257
+ worker.perform_leader_duties
258
+ end
259
+
260
+ it "has a before_perform_leader_duties callback" do
261
+ worker.send(:before_perform_leader_duties)
252
262
  end
253
263
 
254
264
  it "should initialize buckets as dictator" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infopark-politics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-30 00:00:00.000000000 Z
12
+ date: 2014-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec