grenache-ruby-base 0.1.6 → 0.1.7
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/grenache-ruby-base.gemspec +2 -0
- data/lib/grenache/base.rb +5 -0
- data/lib/grenache/configurable.rb +10 -5
- data/lib/grenache/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fde38f2403443ee0694dd2986a9e58c5c8f19c4
|
4
|
+
data.tar.gz: d2dd46cbc7cc16beef92ef95e6896674e03c5370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 961aa4b062da637af00c8a499edb30878d25e4d645fc0d51e9ffd56a734a8fbd82323d5ffa9b236c84e450807bd87d2aeb0b418862574e52f9ed92510917edbc
|
7
|
+
data.tar.gz: 3dbfab84b517bb22a5a2db9f02b1b742b675f120d5a450b0b6b7e5b32c96a6ce4ffcd704fa7945790b0087781fdb4d2f42fb9f6c0fe9828f7bb210f88bb7b13a
|
data/grenache-ruby-base.gemspec
CHANGED
data/lib/grenache/base.rb
CHANGED
@@ -2,6 +2,11 @@ module Grenache
|
|
2
2
|
class Base
|
3
3
|
include Grenache::Configurable
|
4
4
|
|
5
|
+
# Initialize can accept custom configuration parameters
|
6
|
+
def initialize(params = {})
|
7
|
+
@configuration = Configuration.new(params)
|
8
|
+
end
|
9
|
+
|
5
10
|
# Lookup for a specific service `key`
|
6
11
|
# passed block is called with the result values
|
7
12
|
# in case of `http` backend it return the result directly
|
@@ -5,10 +5,15 @@ module Grenache
|
|
5
5
|
attr_accessor :grape_address, :auto_announce, :timeout
|
6
6
|
|
7
7
|
# Initialize default values
|
8
|
-
def initialize
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
def initialize(params = {})
|
9
|
+
if params
|
10
|
+
self.grape_address = params[:grape_address]
|
11
|
+
self.auto_announce = params[:auto_announce]
|
12
|
+
self.timeout = params[:timeout]
|
13
|
+
end
|
14
|
+
self.grape_address ||= "ws://127.0.0.1:30001"
|
15
|
+
self.auto_announce ||= true
|
16
|
+
self.timeout ||= 5
|
12
17
|
end
|
13
18
|
end
|
14
19
|
|
@@ -19,7 +24,7 @@ module Grenache
|
|
19
24
|
end
|
20
25
|
|
21
26
|
def config
|
22
|
-
self.class.config
|
27
|
+
@configuration || self.class.config
|
23
28
|
end
|
24
29
|
|
25
30
|
module ClassMethods
|
data/lib/grenache/version.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.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bitfinex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.14.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 3.5.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 3.5.0
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- info@bitfinex.com
|