grenache-ruby-base 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4011080d2a236d66ee315d3ba95209527a61c66
4
- data.tar.gz: e032d4dc097df849303dfa4f5b0ae74a0433e531
3
+ metadata.gz: 8e1328d30d0bcdaf82f9284189fad8d3fa421677
4
+ data.tar.gz: d0ca3f6002e055f723588ee1105d777a10e64b81
5
5
  SHA512:
6
- metadata.gz: d6f85a67f46e3b1917fdce5b08c05ab10ac0f7b4784a3868ed00e69d520bab3de44714475fe4b0f81366d55fad095e1cfe4fadec515625caa6645478756ac61f
7
- data.tar.gz: 7f7b6dd65148464c829d9fe1ed93d0970a1c1a146b860c862c4041b104c8f154b28e102b31e9f239cf3857fdcaa6b152aa50c507567063d9e0004dd5e1ad0881
6
+ metadata.gz: 4a52c4c939d04a236f1180748b60c8cebf2c33754c36ebc9a149c0a16521ffbe6f8289e1434b46b67727ecab577f0e1f3ffd6911a9b89187afc56e8f9f8e719a
7
+ data.tar.gz: 002d0f740fd56696a5e25d14641c0f27550f897ddbd69b82bbae54ed012f1df0b5ff1ad9e69de17c41c3e9d25a13f369cbf9454f35643632db0b29e93af7226c
data/lib/grenache/base.rb CHANGED
@@ -28,7 +28,7 @@ module Grenache
28
28
  payload = [key,port]
29
29
  link.send 'announce', payload, opts, &block
30
30
  if config.auto_announce
31
- periodically(1) do
31
+ periodically(config.auto_announce_interval) do
32
32
  link.send 'announce', payload, opts, &block
33
33
  end
34
34
  end
@@ -2,18 +2,14 @@ module Grenache
2
2
 
3
3
  # Encapsulate Configuration parameters
4
4
  class Configuration
5
- attr_accessor :grape_address, :auto_announce, :timeout
5
+ attr_accessor :grape_address, :auto_announce, :timeout, :auto_announce_interval
6
6
 
7
7
  # Initialize default values
8
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
9
+ self.grape_address = params[:grape_address] ? params[:grape_address] : "ws://127.0.0.1:30001"
10
+ self.auto_announce = params[:auto_announce].nil? ? true : params[:auto_announce]
11
+ self.auto_announce_interval = params[:auto_announce_interval] ? params[:auto_announce_interval] : 5
12
+ self.timeout = params[:timeout] ? params[:timeout] : 5
17
13
  end
18
14
  end
19
15
 
@@ -1,3 +1,3 @@
1
1
  module Grenache
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
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.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bitfinex
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-15 00:00:00.000000000 Z
11
+ date: 2017-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  requirements: []
123
123
  rubyforge_project:
124
- rubygems_version: 2.4.5.1
124
+ rubygems_version: 2.6.11
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: Grenache Base Client implementation.