cellect-client 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/cellect/client/railtie.rb +10 -5
- data/lib/cellect/client.rb +4 -0
- data/lib/cellect/testing.rb +3 -13
- data/lib/cellect/version.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- 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: d7f53935b9eef4548e6e3887e48350be43f639be
|
|
4
|
+
data.tar.gz: 8e397e85876ea09b375aff057656dcb4ef78ef41
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e98b91839414e7bdc54ad16b5feaf3788d0bc0d5a3701977b20bdcb4cf55260a024d33f9c77e58d2bcf21a2b44506cdaf1a881fb694e1fbe5a87e793aeba76a2
|
|
7
|
+
data.tar.gz: a5243534696310ee3618c4168ca929eecc3e7d5ee307b01ff26334b32d2ffef58abace65a23e3e009d0e0240697cb77f7ac8b9c5d8c0a2e3959309f7881317f6
|
data/README.md
CHANGED
|
@@ -4,9 +4,9 @@ This is a work in progress
|
|
|
4
4
|
|
|
5
5
|
## Building
|
|
6
6
|
|
|
7
|
-
1. Install [Boost](http://www.boost.org/): OS X: `brew update && brew install boost`, Ubuntu: `sudo apt-get update && sudo apt-get install libboost-all-dev`
|
|
7
|
+
1. Install [Boost V1.55](http://www.boost.org/): OS X: `brew update && brew install boost`, Ubuntu: `sudo apt-get update && sudo apt-get install libboost-all-dev`
|
|
8
8
|
2. Install gem dependencies: `bundle` (See Note)
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
|
|
11
11
|
### Note
|
|
12
12
|
To install rice your Ruby must be compiled with shared libraries enabled, from the rice docs:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module Cellect
|
|
2
|
-
module Client
|
|
2
|
+
module Client
|
|
3
3
|
class ConfigurationError < StandardError; end;
|
|
4
4
|
|
|
5
5
|
class CellectRailtie < Rails::Railtie
|
|
@@ -9,18 +9,18 @@ module Cellect
|
|
|
9
9
|
ensure_config_environment config
|
|
10
10
|
config = config[Rails.env].symbolize_keys
|
|
11
11
|
ensure_config_url config
|
|
12
|
-
|
|
13
|
-
Client.node_set config[:zk_url]
|
|
14
|
-
Client.connection = Connection.pool size: config.fetch(:pool_size, 100)
|
|
12
|
+
connect_zookeeper config if Client.mock_zookeeper?
|
|
15
13
|
end
|
|
16
14
|
|
|
15
|
+
private
|
|
16
|
+
|
|
17
17
|
def config_file
|
|
18
18
|
Rails.root.join 'config/cellect.yml'
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def ensure_config_file
|
|
22
22
|
return if File.exists?(config_file)
|
|
23
|
-
raise ConfigurationError.new
|
|
23
|
+
raise ConfigurationError.new 'No configuration file found. Create config/cellect.yml first'
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def ensure_config_environment(yaml)
|
|
@@ -32,6 +32,11 @@ module Cellect
|
|
|
32
32
|
return if hash[:zk_url].present?
|
|
33
33
|
raise ConfigurationError.new "No Zookeeper URL provided for #{ Rails.env } environment"
|
|
34
34
|
end
|
|
35
|
+
|
|
36
|
+
def connect_zookeeper(config)
|
|
37
|
+
Client.node_set config[:zk_url]
|
|
38
|
+
Client.connection = Connection.pool size: config.fetch(:pool_size, 100)
|
|
39
|
+
end
|
|
35
40
|
end
|
|
36
41
|
end
|
|
37
42
|
end
|
data/lib/cellect/client.rb
CHANGED
data/lib/cellect/testing.rb
CHANGED
data/lib/cellect/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cellect-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Parrish
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-07-
|
|
11
|
+
date: 2014-07-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|