zookeeper 1.5.3 → 1.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b98186b48e9c47529ac6e321dde55dc4a911b46b8ebfbbd9e8889f2808019cfc
4
- data.tar.gz: '099a5d5a645518f173f06a9d6d340fd48d3117f20bfab11780c87bc0027b7bde'
3
+ metadata.gz: c62ad7f2a9f95282d970313d90b627ebcf8d289c59f08a00ed3a44e787d27040
4
+ data.tar.gz: af6af88a8bc969ffdad9889a7fa7167158dbb9bff5cf114d0dcadbf07ce0a63a
5
5
  SHA512:
6
- metadata.gz: b2458ab8902282ae69d7f173aebbd19e0488c3c99896ac99d1ba75bab086af003b967b6ab11ac8adf305a26e21f24a7617ade4f5e5ecdc5f78f14452abff1619
7
- data.tar.gz: d1fd0124565f9e62b783c7448c24422ebf615b370308e9e46d72930ba431a56b42b171e7dbfdc47ca61530eee421358f8e722bead38dfe7129d5ae47e4077d7c
6
+ metadata.gz: 43fd7c61e195c54e5fab825685c2e8470b529e374a72c5f47da5efb48ae863dfe2385e48dd4c2d165f10b953169b405807612876523b6845cc3cd00e27ec51b3
7
+ data.tar.gz: 73afb9f450c1bcd38b4b998d919ca309606d12167adfd5369ff08d4912b73cc88aaabdd5e1cd1afbce049eaa2ac46fe7b33fdb159985881d51579dfd28eead21
@@ -15,6 +15,7 @@ jobs:
15
15
  matrix:
16
16
  os:
17
17
  - ubuntu-latest
18
+ - ubuntu-20.04
18
19
  - macos-latest
19
20
  ruby:
20
21
  - '2.5'
@@ -22,6 +23,7 @@ jobs:
22
23
  - '2.7'
23
24
  - '3.0'
24
25
  - '3.1'
26
+ - '3.2'
25
27
  - 'jruby'
26
28
  gcc:
27
29
  - 7
@@ -29,6 +31,10 @@ jobs:
29
31
  exclude:
30
32
  - os: macos-latest
31
33
  gcc: 7
34
+ - os: ubuntu-latest
35
+ gcc: 7
36
+ - os: ubuntu-20.04
37
+ gcc: latest
32
38
 
33
39
  steps:
34
40
  - uses: actions/checkout@v2
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v1.5.4
2
+ * Ruby 3.2 compatibility (h/t: @cheister & @EricRoos)
3
+
1
4
  v1.5.3
2
5
  * Ruby 3.1 compatibility (h/t: @casperisfine)
3
6
 
data/Gemfile CHANGED
@@ -2,10 +2,10 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rake', '~> 0.9.0'
5
+ gem 'rake', '>= 13.0'
6
6
 
7
7
  group :test do
8
- gem "rspec" , "~> 2.11"
8
+ gem "rspec" , "~> 3.0"
9
9
  gem 'eventmachine', '1.0.4'
10
10
  gem 'evented-spec', '~> 0.9.0'
11
11
  gem 'zk-server', '~> 1.0', :git => 'https://github.com/zk-ruby/zk-server.git'
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ release_ops_path = File.expand_path('../releaseops/lib', __FILE__)
4
4
  # we use a submodule because it doesn't depend on anything else (*cough* bundler)
5
5
  # and can be shared across projects
6
6
  #
7
- if File.exists?(release_ops_path)
7
+ if File.exist?(release_ops_path)
8
8
  require File.join(release_ops_path, 'releaseops')
9
9
 
10
10
  # sets up the multi-ruby zk:test_all rake tasks
@@ -17,7 +17,7 @@ if File.exists?(release_ops_path)
17
17
  # Define a task to run code coverage tests
18
18
  ReleaseOps::TestTasks.define_simplecov_tasks
19
19
 
20
- # set up yard:server, yard:gems, and yard:clean tasks
20
+ # set up yard:server, yard:gems, and yard:clean tasks
21
21
  # for doing documentation stuff
22
22
  ReleaseOps::YardTasks.define
23
23
 
data/ext/Rakefile CHANGED
@@ -4,9 +4,9 @@ ZKRB_WRAPPER = %w[zkrb_wrapper.c zkrb_wrapper.h]
4
4
 
5
5
  namespace :zkrb do
6
6
  task :clean do
7
- if File.exists?('Makefile')
7
+ if File.exist?('Makefile')
8
8
  sh 'make clean'
9
- rm 'Makefile' # yep, regenerate this
9
+ FileUtils.rm('Makefile') # yep, regenerate this
10
10
  else
11
11
  $stderr.puts "nothing to clean, no Makefile"
12
12
  end
data/ext/extconf.rb CHANGED
@@ -58,7 +58,7 @@ Dir.chdir(HERE) do
58
58
  else
59
59
  puts "Building zkc."
60
60
 
61
- unless File.exists?('c')
61
+ unless File.exist?('c')
62
62
  safe_sh "tar xzf #{BUNDLE} 2>&1"
63
63
  PATCHES.each do |patch|
64
64
  safe_sh "patch -p0 < #{patch} 2>&1"
@@ -87,7 +87,7 @@ Dir.chdir("#{HERE}/lib") do
87
87
  %w[a la dylib].each do |ext|
88
88
  origin_lib_name = "libzookeeper_#{stmt}.#{ext}"
89
89
  dest_lib_name = "libzookeeper_#{stmt}_gem.#{ext}"
90
- system("cp -f #{origin_lib_name} #{dest_lib_name}") if File.exists?(origin_lib_name)
90
+ system("cp -f #{origin_lib_name} #{dest_lib_name}") if File.exist?(origin_lib_name)
91
91
  end
92
92
  end
93
93
  end
@@ -1,4 +1,4 @@
1
1
  module Zookeeper
2
- VERSION = '1.5.3'
2
+ VERSION = '1.5.4'
3
3
  DRIVER_VERSION = '3.4.5'
4
4
  end
@@ -29,20 +29,20 @@ unless defined?(::JRUBY_VERSION)
29
29
  end
30
30
 
31
31
  it %[should be in connected state within a reasonable amount of time] do
32
- wait_until_connected.should be_true
32
+ expect(wait_until_connected).to be_truthy
33
33
  end
34
34
 
35
35
  describe :after_connected do
36
36
  before do
37
- wait_until_connected.should be_true
37
+ expect(wait_until_connected).to be_truthy
38
38
  end
39
39
 
40
40
  it %[should have a connection event after being connected] do
41
41
  event = wait_until(10) { @event_queue.pop }
42
- event.should be
43
- event[:req_id].should == Zookeeper::Constants::ZKRB_GLOBAL_CB_REQ
44
- event[:type].should == Zookeeper::Constants::ZOO_SESSION_EVENT
45
- event[:state].should == Zookeeper::Constants::ZOO_CONNECTED_STATE
42
+ expect(event).to be
43
+ expect(event[:req_id]).to eq(Zookeeper::Constants::ZKRB_GLOBAL_CB_REQ)
44
+ expect(event[:type]).to eq(Zookeeper::Constants::ZOO_SESSION_EVENT)
45
+ expect(event[:state]).to eq(Zookeeper::Constants::ZOO_CONNECTED_STATE)
46
46
  end
47
47
  end
48
48
  end
@@ -3,7 +3,7 @@ require 'shared/connection_examples'
3
3
 
4
4
  describe 'Zookeeper chrooted' do
5
5
  let(:path) { "/_zkchroottest_" }
6
- let(:data) { "underpants" }
6
+ let(:data) { "underpants" }
7
7
  let(:chroot_path) { '/slyphon-zookeeper-chroot' }
8
8
 
9
9
  let(:connection_string) { "#{Zookeeper.default_cnx_str}#{chroot_path}" }
@@ -35,8 +35,8 @@ describe 'Zookeeper chrooted' do
35
35
 
36
36
  it %[should successfully create the path] do
37
37
  rv = zk.create(:path => '/', :data => '')
38
- rv[:rc].should be_zero
39
- rv[:path].should == ''
38
+ expect(rv[:rc]).to be_zero
39
+ expect(rv[:path]).to eq('')
40
40
  end
41
41
  end
42
42
  end
@@ -53,8 +53,8 @@ describe 'Zookeeper chrooted' do
53
53
 
54
54
  it %[should return ZNONODE] do
55
55
  rv = zk.create(:path => '/', :data => '')
56
- rv[:rc].should_not be_zero
57
- rv[:rc].should == Zookeeper::Exceptions::ZNONODE
56
+ expect(rv[:rc]).not_to be_zero
57
+ expect(rv[:rc]).to eq(Zookeeper::Exceptions::ZNONODE)
58
58
  end
59
59
  end
60
60
  end
@@ -62,15 +62,15 @@ describe 'Zookeeper chrooted' do
62
62
 
63
63
 
64
64
  describe do
65
- before :all do
66
- logger.warn "running before :all"
65
+ before :each do
66
+ logger.warn "running before :each"
67
67
 
68
68
  with_open_zk do |z|
69
69
  z.create(:path => chroot_path, :data => '')
70
70
  end
71
71
  end
72
72
 
73
- after :all do
73
+ after :each do
74
74
  with_open_zk do |z|
75
75
  rm_rf(z, chroot_path)
76
76
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe 'Compatibiliy layer' do
4
4
  it %[should raise the correct error when a const is missing] do
5
- lambda { Zookeeper::THISISANINVALIDCONST }.should raise_error(NameError)
5
+ expect { Zookeeper::THISISANINVALIDCONST }.to raise_error(NameError)
6
6
  end
7
7
  end
8
8
 
@@ -4,7 +4,7 @@ describe Zookeeper do
4
4
  describe :initialize, 'with watcher block' do
5
5
  before do
6
6
  @events = []
7
- @watch_block = lambda do |hash|
7
+ @watch_block = lambda do |hash|
8
8
  logger.debug "watch_block: #{hash.inspect}"
9
9
  @events << hash
10
10
  end
@@ -12,7 +12,7 @@ describe Zookeeper do
12
12
  @zk = Zookeeper.new(Zookeeper.default_cnx_str, 10, @watch_block)
13
13
 
14
14
  wait_until(2) { @zk.connected? }
15
- @zk.should be_connected
15
+ expect(@zk).to be_connected
16
16
  logger.debug "connected!"
17
17
 
18
18
  wait_until(2) { !@events.empty? }
@@ -24,9 +24,9 @@ describe Zookeeper do
24
24
  end
25
25
 
26
26
  it %[should receive initial connection state events] do
27
- @events.should_not be_empty
28
- @events.length.should == 1
29
- @events.first[:state].should == Zookeeper::ZOO_CONNECTED_STATE
27
+ expect(@events).not_to be_empty
28
+ expect(@events.length).to eq(1)
29
+ expect(@events.first[:state]).to eq(Zookeeper::ZOO_CONNECTED_STATE)
30
30
  end
31
31
 
32
32
  it %[should receive disconnection events] do
@@ -34,7 +34,7 @@ describe Zookeeper do
34
34
  @events.clear
35
35
  @zk.close
36
36
  wait_until(2) { !@events.empty? }
37
- @events.should_not be_empty
37
+ expect(@events).not_to be_empty
38
38
  end
39
39
  end
40
40
  end
data/spec/em_spec.rb CHANGED
@@ -20,7 +20,7 @@ describe 'ZookeeperEM' do
20
20
  end
21
21
 
22
22
  def teardown_and_done
23
- @zk.close do
23
+ @zk.close do
24
24
  logger.debug { "TEST: about to call done" }
25
25
  EM.next_tick do
26
26
  done
@@ -31,7 +31,7 @@ describe 'ZookeeperEM' do
31
31
  describe 'callbacks' do
32
32
  it %[should be called on the reactor thread] do
33
33
  cb = lambda do |h|
34
- EM.reactor_thread?.should be_true
34
+ expect(EM.reactor_thread?).to be_truthy
35
35
  logger.debug { "called back on the reactor thread? #{EM.reactor_thread?}" }
36
36
  teardown_and_done
37
37
  end
@@ -39,7 +39,7 @@ describe 'ZookeeperEM' do
39
39
  setup_zk do
40
40
  @zk.on_attached do |*|
41
41
  logger.debug { "on_attached called" }
42
- rv = @zk.get(:path => '/', :callback => cb)
42
+ rv = @zk.get(:path => '/', :callback => cb)
43
43
  logger.debug { "rv from @zk.get: #{rv.inspect}" }
44
44
  end
45
45
  end
@@ -11,7 +11,7 @@ unless defined?(::JRUBY_VERSION)
11
11
  end
12
12
 
13
13
  it %[should have an original_pid assigned] do
14
- @zk.original_pid.should == Process.pid
14
+ expect(@zk.original_pid).to eq(Process.pid)
15
15
  end
16
16
  end
17
17
  end
@@ -112,11 +112,11 @@ unless defined?(::JRUBY_VERSION)
112
112
  status = wait_for_child_safely(@pid)
113
113
  raise "Child process did not exit, likely hung" unless status
114
114
 
115
- status.should_not be_signaled
116
- status.should be_success
115
+ expect(status).not_to be_signaled
116
+ expect(status).to be_success
117
117
 
118
- event_waiter_th.join(5).should == event_waiter_th
119
- @event.should_not be_nil
118
+ expect(event_waiter_th.join(5)).to eq(event_waiter_th)
119
+ expect(@event).not_to be_nil
120
120
  end
121
121
  end
122
122
  end
data/spec/latch_spec.rb CHANGED
@@ -16,7 +16,7 @@ describe Zookeeper::Latch do
16
16
  end
17
17
 
18
18
  other_latch.await
19
- th.join(1).should == th
19
+ expect(th.join(1)).to eq(th)
20
20
  end
21
21
  end
22
22
  end
@@ -1,10 +1,10 @@
1
1
  shared_examples_for "all success return values" do
2
2
  it %[should have a return code of Zookeeper::ZOK] do
3
- @rv[:rc].should == Zookeeper::ZOK
3
+ expect(@rv[:rc]).to eq(Zookeeper::ZOK)
4
4
  end
5
5
 
6
6
  it %[should have a req_id integer] do
7
- @rv[:req_id].should be_kind_of(Integer)
7
+ expect(@rv[:req_id]).to be_kind_of(Integer)
8
8
  end
9
9
  end
10
10