zookeeper 1.2.10 → 1.2.11

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ v1.2.11 remove dependency on backports gem
2
+
3
+ * Somewhat naively we were requiring the backports gem to provide
4
+ Kernel#require_relative. This release implements similar functionlity
5
+ inside the Zookeeper module and doesn't affect the global namespace.
6
+
7
+ We apologise for the inconvenience.
8
+
1
9
  v1.2.10 minor bug fix in java code
2
10
 
3
11
  * Don't obscure a legitimate exception because of an unexpected nil
data/README.markdown CHANGED
@@ -28,6 +28,20 @@ Portions contributed to the open source community by HPDC, L.P.
28
28
 
29
29
  sudo gem install zookeeper
30
30
 
31
+ ### rbenv is awesome
32
+
33
+ Let me start out by saying I prefer rvm, and that I really don't know a whole lot about linking on OS X. Or Linux. Any suggestions or constructive insults would be greatly appreciated if you have insight into what i'm doing wrong here.
34
+
35
+ So, it seems that [ruby-build][] doesn't use `--enable-shared` by default. I'm told this is for speed.
36
+
37
+ If you run into problems with installing this gem (specifically with linking ex. `Undefined symbols for architecture x86_64`) and you're using rbenv, for now you need to ensure that your ruby was built with `--enable-shared`. I'm sorry for the inconvenience. (no, really)
38
+
39
+ ```shell
40
+ ~ $ CONFIGURE_OPTS='--enable-shared --disable-install-doc' rbenv install 1.9.3-p194
41
+ ```
42
+
43
+ [ruby-build]: https://github.com/sstephenson/ruby-build
44
+
31
45
  ## Usage
32
46
 
33
47
  Connect to a server:
data/ext/c_zookeeper.rb CHANGED
@@ -1,8 +1,11 @@
1
- require_relative '../lib/zookeeper/logger'
2
- require_relative '../lib/zookeeper/common'
3
- require_relative '../lib/zookeeper/constants'
4
- require_relative '../lib/zookeeper/exceptions' # zookeeper_c depends on exceptions defined in here
5
- require_relative 'zookeeper_c'
1
+ Zookeeper.require_lib(
2
+ 'zookeeper/logger',
3
+ 'zookeeper/common',
4
+ 'zookeeper/constants',
5
+ 'zookeeper/exceptions' # zookeeper_c depends on exceptions defined in here
6
+ )
7
+
8
+ Zookeeper.require_root 'ext/zookeeper_c'
6
9
 
7
10
  # require File.expand_path('../zookeeper_c', __FILE__)
8
11
 
@@ -1,6 +1,7 @@
1
- require_relative 'c_zookeeper'
2
1
  require 'forwardable'
3
2
 
3
+ Zookeeper.require_root 'ext/c_zookeeper'
4
+
4
5
  # The low-level wrapper-specific methods for the C lib
5
6
  # subclassed by the top-level Zookeeper class
6
7
  module Zookeeper
data/lib/zookeeper.rb CHANGED
@@ -8,29 +8,45 @@ require 'benchmark'
8
8
  require 'logging'
9
9
 
10
10
  module Zookeeper
11
- # establishes the namespace
12
- end
11
+ ZOOKEEPER_ROOT = File.expand_path('../..', __FILE__)
13
12
 
14
- require File.expand_path('../zookeeper/core_ext', __FILE__)
13
+ # require a path relative to the lib directory
14
+ # this is to avoid monkeying explicitly with $LOAD_PATH
15
+ #
16
+ # @private
17
+ def self.require_lib(*relpaths)
18
+ relpaths.each do |relpath|
19
+ require File.join(ZOOKEEPER_ROOT, 'lib', relpath)
20
+ end
21
+ end
15
22
 
16
- require 'backports' if RUBY_VERSION =~ /\A1\.8\./
23
+ # require a path that's relative to ZOOKEEPER_ROOT
24
+ # @private
25
+ def self.require_root(*relpaths)
26
+ relpaths.each do |relpath|
27
+ require File.join(ZOOKEEPER_ROOT, relpath)
28
+ end
29
+ end
30
+ end
17
31
 
18
- require_relative 'zookeeper/monitor'
19
- require_relative 'zookeeper/logger'
20
- require_relative 'zookeeper/forked'
21
- require_relative 'zookeeper/latch'
22
- require_relative 'zookeeper/acls'
23
- require_relative 'zookeeper/constants'
24
- require_relative 'zookeeper/exceptions'
25
- require_relative 'zookeeper/continuation'
26
- require_relative 'zookeeper/common'
27
- require_relative 'zookeeper/callbacks'
28
- require_relative 'zookeeper/stat'
29
- require_relative 'zookeeper/client_methods'
32
+ Zookeeper.require_lib(
33
+ 'zookeeper/core_ext',
34
+ 'zookeeper/monitor',
35
+ 'zookeeper/logger',
36
+ 'zookeeper/forked',
37
+ 'zookeeper/latch',
38
+ 'zookeeper/acls',
39
+ 'zookeeper/constants',
40
+ 'zookeeper/exceptions',
41
+ 'zookeeper/continuation',
42
+ 'zookeeper/common',
43
+ 'zookeeper/callbacks',
44
+ 'zookeeper/stat',
45
+ 'zookeeper/client_methods'
46
+ )
30
47
 
31
48
  # ok, now we construct the client
32
-
33
- require_relative 'zookeeper/client'
49
+ Zookeeper.require_lib 'zookeeper/client'
34
50
 
35
51
  module Zookeeper
36
52
  include Constants
@@ -90,7 +106,7 @@ module Zookeeper
90
106
  end
91
107
 
92
108
  # just for first test, get rid of this soon
93
- require_relative 'zookeeper/compatibility'
109
+ Zookeeper.require_lib 'zookeeper/compatibility'
94
110
 
95
111
  if ENV['ZKRB_DEBUG']
96
112
  Zookeeper.debug_level = Zookeeper::Constants::ZOO_LOG_LEVEL_DEBUG
@@ -3,9 +3,9 @@
3
3
  # or which class we're subclassing.
4
4
 
5
5
  if defined?(::JRUBY_VERSION)
6
- require_relative('../../java/java_base')
6
+ Zookeeper.require_root('java/java_base')
7
7
  else
8
- require_relative('../../ext/zookeeper_base')
8
+ Zookeeper.require_root('ext/zookeeper_base')
9
9
  end
10
10
 
11
11
 
@@ -1,4 +1,4 @@
1
1
  module Zookeeper
2
- VERSION = '1.2.10'
2
+ VERSION = '1.2.11'
3
3
  DRIVER_VERSION = '3.3.5'
4
4
  end
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: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 10
10
- version: 1.2.10
9
+ - 11
10
+ version: 1.2.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Phillip Pearson
@@ -20,28 +20,12 @@ autorequire:
20
20
  bindir: bin
21
21
  cert_chain: []
22
22
 
23
- date: 2012-07-02 00:00:00 Z
23
+ date: 2012-07-18 00:00:00 Z
24
24
  dependencies:
25
- - !ruby/object:Gem::Dependency
26
- name: backports
27
- prerelease: false
28
- requirement: &id001 !ruby/object:Gem::Requirement
29
- none: false
30
- requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
33
- hash: 25
34
- segments:
35
- - 2
36
- - 5
37
- - 1
38
- version: 2.5.1
39
- type: :runtime
40
- version_requirements: *id001
41
25
  - !ruby/object:Gem::Dependency
42
26
  name: logging
43
27
  prerelease: false
44
- requirement: &id002 !ruby/object:Gem::Requirement
28
+ requirement: &id001 !ruby/object:Gem::Requirement
45
29
  none: false
46
30
  requirements:
47
31
  - - ~>
@@ -53,7 +37,7 @@ dependencies:
53
37
  - 2
54
38
  version: 1.7.2
55
39
  type: :runtime
56
- version_requirements: *id002
40
+ version_requirements: *id001
57
41
  description: |+
58
42
  A low-level multi-Ruby wrapper around the ZooKeeper API bindings. For a
59
43
  friendlier interface, see http://github.com/slyphon/zk. Currently supported: