nerve-easy 0.1.3 → 0.1.4

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: b011a5249e3b224e83f15bc25e8ca7dfa9f97361
4
- data.tar.gz: e861ca5689ad132a76f06166ae09cd81f31d0fbb
3
+ metadata.gz: 80a8e9c96769c518d552aba5a345a3124681e3f3
4
+ data.tar.gz: f1dc8112969e209586d348a216a9c077b1aa03f1
5
5
  SHA512:
6
- metadata.gz: 1a70eeb103e5e7decb72e84303c53666313b81da6a59f16d98496a7306019b8aa3fec46e10b81955a76ff10e3867b2aabb928091acce8fa2edb34ab5de69aeb6
7
- data.tar.gz: 2b0d1d06543a77b860710ca6286173120def25d05da8bdb8cda7953d0fea42250de33cad0caabd9bb055c505ec01b10827602bb98fda453f6ef35f6e35c80396
6
+ metadata.gz: a4aefa4f5e9c669c67b2cac2df0957428a8e4a6b95bfa7d8e03b46bf1c92b2e5253b00da18cb799a0620f6ffef410043c0ac234e8cae4ff7f2b347dc9811d055
7
+ data.tar.gz: d79a5ea004f11178d547cfe716a3656ab91d29ba7597cabfa315ad75d97a9333352af7c3cb3b5c86290ffbcd9b35f9f281f46a4d8f8b74b2249cef87cffb4dc2
@@ -1,15 +1,15 @@
1
1
  module Nerve
2
2
  module Easy
3
3
  module FixedInstanceId
4
+ def instance_id size=4
5
+ FixedInstanceId.instance_id @name, size
6
+ end
4
7
  class << self
5
8
  def instance_id klass_name, size
6
9
  @instance_ids ||= {}
7
10
  @instance_ids[klass_name] ||= SecureRandom.hex(size)
8
11
  end
9
12
  end
10
- def instance_id size=4
11
- FixedInstanceId.instance_id @name, size
12
- end
13
13
  end
14
14
  end
15
15
  end
@@ -18,9 +18,6 @@ module Nerve
18
18
  @port ||= 3000
19
19
  @name ||= "publisher"
20
20
  end
21
- def instance_id
22
- self.class.instance_id
23
- end
24
21
  def to_nerve
25
22
  {
26
23
  "zk_hosts" => zk_hosts,
@@ -32,11 +32,8 @@ module Nerve
32
32
  @suffix = params[:suffix]
33
33
  @suffix ||= "services"
34
34
  @name = params[:name]
35
- unless @name
36
- @name = "#{@customer}_#{@application}_#{@function}"
37
- end
38
- @zk_path = Pathname.new("/#{@registry}")
39
- @zk_path = @zk_path.join(@customer,@application,@function,@suffix).to_s
35
+ @name = "#{@customer}_#{@application}_#{@function}" unless @name
36
+ @zk_path ||= Pathname.new("/#{@registry}").join(@customer,@application,@function,@suffix).to_s
40
37
  end
41
38
  def to_nerve
42
39
  super.merge({
@@ -1,5 +1,5 @@
1
1
  module Nerve
2
2
  module Easy
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nerve-easy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Kaufmann