zookeeper 1.0.6 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/spec_helper.rb CHANGED
@@ -32,8 +32,8 @@ end
32
32
 
33
33
  RSpec.configure do |config|
34
34
  config.mock_with :rspec
35
- config.include Zookeeper::SpecHeleprs
36
- config.extend Zookeeper::SpecHeleprs
35
+ config.include Zookeeper::SpecHelpers
36
+ config.extend Zookeeper::SpecHelpers
37
37
 
38
38
  if Zookeeper.spawn_zookeeper?
39
39
  require 'zk-server'
@@ -1,5 +1,5 @@
1
1
  module Zookeeper
2
- module SpecHeleprs
2
+ module SpecHelpers
3
3
  class TimeoutError < StandardError; end
4
4
  include Zookeeper::Constants
5
5
  include Zookeeper::Logger
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zookeeper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
+ - 1
8
9
  - 0
9
- - 6
10
- version: 1.0.6
10
+ version: 1.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Phillip Pearson
@@ -20,7 +20,7 @@ autorequire:
20
20
  bindir: bin
21
21
  cert_chain: []
22
22
 
23
- date: 2012-05-11 00:00:00 Z
23
+ date: 2012-05-14 00:00:00 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: backports
@@ -61,26 +61,29 @@ files:
61
61
  - .travis.yml
62
62
  - CHANGELOG
63
63
  - Gemfile
64
+ - Guardfile
64
65
  - LICENSE
65
66
  - Manifest
66
67
  - README.markdown
67
68
  - Rakefile
69
+ - cause-abort.rb
68
70
  - ext/.gitignore
69
71
  - ext/Rakefile
70
72
  - ext/c_zookeeper.rb
73
+ - ext/common.h
71
74
  - ext/dbg.h
72
75
  - ext/depend
76
+ - ext/event_lib.c
77
+ - ext/event_lib.h
73
78
  - ext/extconf.rb
74
79
  - ext/generate_gvl_code.rb
75
80
  - ext/zkc-3.3.5.tar.gz
81
+ - ext/zkrb.c
76
82
  - ext/zkrb_wrapper.c
77
83
  - ext/zkrb_wrapper.h
78
84
  - ext/zkrb_wrapper_compat.c
79
85
  - ext/zkrb_wrapper_compat.h
80
86
  - ext/zookeeper_base.rb
81
- - ext/zookeeper_c.c
82
- - ext/zookeeper_lib.c
83
- - ext/zookeeper_lib.h
84
87
  - java/java_base.rb
85
88
  - lib/zookeeper.rb
86
89
  - lib/zookeeper/acls.rb
@@ -91,12 +94,14 @@ files:
91
94
  - lib/zookeeper/common/queue_with_pipe.rb
92
95
  - lib/zookeeper/compatibility.rb
93
96
  - lib/zookeeper/constants.rb
97
+ - lib/zookeeper/continuation.rb
94
98
  - lib/zookeeper/core_ext.rb
95
99
  - lib/zookeeper/em_client.rb
96
100
  - lib/zookeeper/exceptions.rb
97
101
  - lib/zookeeper/forked.rb
98
102
  - lib/zookeeper/latch.rb
99
103
  - lib/zookeeper/logger.rb
104
+ - lib/zookeeper/monitor.rb
100
105
  - lib/zookeeper/rake_tasks.rb
101
106
  - lib/zookeeper/stat.rb
102
107
  - lib/zookeeper/version.rb
@@ -108,7 +113,6 @@ files:
108
113
  - spec/default_watcher_spec.rb
109
114
  - spec/em_spec.rb
110
115
  - spec/ext/zookeeper_base_spec.rb
111
- - spec/fork_hook_specs.rb
112
116
  - spec/forked_connection_spec.rb
113
117
  - spec/latch_spec.rb
114
118
  - spec/log4j.properties
@@ -161,7 +165,6 @@ test_files:
161
165
  - spec/default_watcher_spec.rb
162
166
  - spec/em_spec.rb
163
167
  - spec/ext/zookeeper_base_spec.rb
164
- - spec/fork_hook_specs.rb
165
168
  - spec/forked_connection_spec.rb
166
169
  - spec/latch_spec.rb
167
170
  - spec/log4j.properties
@@ -1,53 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'fork hooks' do
4
- def safe_kill_process(signal, pid)
5
- Process.kill(signal, pid)
6
- rescue Errno::ESRCH
7
- nil
8
- end
9
-
10
- after do
11
- Zookeeper::Forked.clear!
12
-
13
- if @pid
14
- safe_kill_process('KILL', @pid)
15
- end
16
- end
17
-
18
- describe 'fork with a block' do
19
- it %[should call the after_fork_in_child hooks in the child] do
20
- child_hook_called = false
21
-
22
- hook_order = []
23
-
24
- Zookeeper.prepare_for_fork { hook_order << :prepare }
25
- Zookeeper.after_fork_in_parent { hook_order << :parent }
26
- Zookeeper.after_fork_in_child { hook_order << :child }
27
-
28
- @pid = fork do
29
- unless hook_order.first == :prepare
30
- $stderr.puts "hook order wrong! #{hook_order.inspect}"
31
- exit! 2
32
- end
33
-
34
- unless hook_order.last == :child
35
- $stderr.puts "hook order wrong! #{hook_order.inspect}"
36
- exit! 3
37
- end
38
-
39
- exit! 0
40
- end
41
-
42
- hook_order.first.should == :prepare
43
- hook_order.last.should == :parent
44
-
45
- _, st = Process.wait2(@pid)
46
- st.exitstatus.should == 0
47
-
48
- st.should be_exited
49
- st.should be_success
50
- end
51
- end
52
- end
53
-