grenache-ruby-base 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grenache/configurable.rb +42 -6
- data/lib/grenache/ssl_verify.rb +5 -0
- data/lib/grenache/version.rb +1 -1
- data/lib/grenache-ruby-base.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1c96976e6746b09a052fdf4016a9371a9616aa3
|
4
|
+
data.tar.gz: 5c5e291069a1d7556f9025ea3fe952f9ee905bec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9570db0b3a42fd6704e6b317d5c596ca67700fb8a44d0489f1b098e0d2c79acea73b6d9674b084d0cc4584f8d9ad3df940a7e687099ee2ffd4bc5f7f7660f55
|
7
|
+
data.tar.gz: f9f50b6b02fcc263a15624469eb14768040cb426db551cbb8681cfcd9c548f71873be909ac4804b0899a7bcd910000290f737ee40f6b40213c35cf652a81c403
|
@@ -2,14 +2,50 @@ module Grenache
|
|
2
2
|
|
3
3
|
# Encapsulate Configuration parameters
|
4
4
|
class Configuration
|
5
|
-
|
5
|
+
# grape configuration
|
6
|
+
attr_accessor :grape_address, :timeout
|
7
|
+
|
8
|
+
# service configuration parameters
|
9
|
+
attr_accessor :service_timeout, :auto_announce_interval, :auto_announce, :service_host
|
10
|
+
|
11
|
+
# service SSL specific configuration
|
12
|
+
# Cert is supposed to be PKCS12
|
13
|
+
attr_accessor :key, :cert_pem, :ca, :reject_unauthorized, :verify_mode
|
6
14
|
|
7
15
|
# Initialize default values
|
8
16
|
def initialize(params = {})
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
17
|
+
set_val :grape_address, params, "ws://127.0.0.1:30001"
|
18
|
+
set_val :timeout, params, 5
|
19
|
+
|
20
|
+
set_val :auto_announce_interval, params, 5
|
21
|
+
set_bool :auto_announce, params, true
|
22
|
+
set_val :service_timeout, params, 5
|
23
|
+
set_val :service_host, params, "0.0.0.0"
|
24
|
+
|
25
|
+
set_val :key, params, nil
|
26
|
+
set_val :cert_pem, params, nil
|
27
|
+
set_val :ca, params, nil
|
28
|
+
set_val :reject_unauthorized, params, nil
|
29
|
+
set_val :verify_mode, params, Grenache::SSL_VERIFY_PEER
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def set_bool(name, params, default)
|
34
|
+
method = "#{name}=".to_sym
|
35
|
+
if params[name].nil?
|
36
|
+
send(method, default)
|
37
|
+
else
|
38
|
+
send(method, params[name])
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def set_val(name, params, default)
|
43
|
+
method = "#{name}=".to_sym
|
44
|
+
if params[name]
|
45
|
+
send(method, params[name])
|
46
|
+
else
|
47
|
+
send(method, default)
|
48
|
+
end
|
13
49
|
end
|
14
50
|
end
|
15
51
|
|
@@ -20,7 +56,7 @@ module Grenache
|
|
20
56
|
end
|
21
57
|
|
22
58
|
def config
|
23
|
-
|
59
|
+
self.class.config
|
24
60
|
end
|
25
61
|
|
26
62
|
module ClassMethods
|
data/lib/grenache/version.rb
CHANGED
data/lib/grenache-ruby-base.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grenache-ruby-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bitfinex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/grenache/grape_message.rb
|
101
101
|
- lib/grenache/link.rb
|
102
102
|
- lib/grenache/service_message.rb
|
103
|
+
- lib/grenache/ssl_verify.rb
|
103
104
|
- lib/grenache/version.rb
|
104
105
|
homepage: https://github.com/bitfinexcom/grenache-ruby-base
|
105
106
|
licenses:
|
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
122
|
version: '0'
|
122
123
|
requirements: []
|
123
124
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.4.5.1
|
125
126
|
signing_key:
|
126
127
|
specification_version: 4
|
127
128
|
summary: Grenache Base Client implementation.
|