dryad-consul 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f90d5b5fad7da7535c53c480e9bfaadb8833ee2d50d7e7eb01f489c75a0e4a93
4
- data.tar.gz: 24035df45576e6aadbaae41716cd3b1e010c952f30c79730a5247c9cb561168d
3
+ metadata.gz: d753817e009be98a773228e8b5fcf6c66636bec0f2e6baa70b1e01ad3ae45482
4
+ data.tar.gz: 856dd2ceb5bfb940b9ccb68153b5bb443e4ad5c2fb1a2163684d632777744511
5
5
  SHA512:
6
- metadata.gz: 53b99aabe4027bb678f3a1cd3201f817cfffebf7b9801279e9c74ee5b0dcd8df154e1f1b2260a7d78d85eca606d03295a8a76feac6b4ff4780e350446b982e4f
7
- data.tar.gz: df04d80075f510e7743ef98de2ae292d85701e9d0fc5bd0af4c6c35495ca6802d6c9cfaf467ae82dfbbabc6ff258efde7d894f9eba7dbb06adb94d15e5f037b9
6
+ metadata.gz: 535f3a338b4022450d2d715759535e7951a3e325a8deb7fd5e061500bc30d74f4bf4c6bc528fe04c4c6a221197ab308bc2786a1d29ff636d29a694076bb05950
7
+ data.tar.gz: 48326d528f01eb302f9fd95570d144844c733a569054aac8c8b33cd3f6ccaa33670e499c9ea098dd6a5fe3fc23342adf907e7672c36e2fb880c5d870523bb75b
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dryad-consul (0.2.6)
4
+ dryad-consul (0.2.7)
5
5
  diplomat (~> 2.2, >= 2.2.4)
6
- dryad-core (= 0.2.6)
6
+ dryad-core (= 0.2.7)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -13,7 +13,7 @@ GEM
13
13
  diplomat (2.2.5)
14
14
  deep_merge (~> 1.0, >= 1.0.1)
15
15
  faraday (~> 0.9)
16
- dryad-core (0.2.6)
16
+ dryad-core (0.2.7)
17
17
  faraday (0.15.4)
18
18
  multipart-post (>= 1.2, < 3)
19
19
  multipart-post (2.1.1)
@@ -2,7 +2,6 @@ require "diplomat"
2
2
  require "dryad/core"
3
3
  require "dryad/consul/railtie" if defined?(Rails)
4
4
  require "dryad/consul/version"
5
- require "dryad/consul/service_client"
6
5
  require "dryad/consul/service_registry"
7
6
  require "dryad/consul/service"
8
7
  require "dryad/consul/key_value_client"
@@ -13,13 +13,15 @@ module Dryad
13
13
  initializer "dryad_consul.update_active_record_connection" do
14
14
  config.after_initialize do
15
15
  db_path = "#{Dryad.configuration.namespace}/#{Dryad.configuration.group}/database.yml"
16
- db_config = Dryad::Consul::ConfigProvider.load(db_path)
17
- ActiveRecord::Base.configurations = YAML.load(ERB.new(db_config.payload).result)
18
- ActiveRecord::Base.establish_connection(Rails.env.to_sym)
19
- rescue Dryad::Core::ConfigurationNotFound => e
20
- raise e
21
- rescue Exception => e
22
- Rails.logger.warn e.message
16
+ begin
17
+ db_config = Dryad::Consul::ConfigProvider.load(db_path)
18
+ ActiveRecord::Base.configurations = YAML.load(ERB.new(db_config.payload).result)
19
+ ActiveRecord::Base.establish_connection(Rails.env.to_sym)
20
+ rescue Dryad::Core::ConfigurationNotFound => e
21
+ raise e
22
+ rescue Exception => e
23
+ Rails.logger.warn e.message
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -4,13 +4,13 @@ module Dryad
4
4
  class << self
5
5
  def register(service)
6
6
  service.to_registers.each do |register|
7
- ServiceClient.register(register)
7
+ ::Diplomat::Service.register(register)
8
8
  end
9
9
  end
10
10
 
11
11
  def deregister(service)
12
12
  service.portals.each do |portal|
13
- ServiceClient.deregister(portal.id)
13
+ ::Diplomat::Service.deregister(portal.id)
14
14
  end
15
15
  end
16
16
 
@@ -1,5 +1,5 @@
1
1
  module Dryad
2
2
  module Consul
3
- VERSION = '0.2.6'
3
+ VERSION = '0.2.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dryad-consul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pan Jie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-05 00:00:00.000000000 Z
11
+ date: 2019-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dryad-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.6
19
+ version: 0.2.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.6
26
+ version: 0.2.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: diplomat
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +108,6 @@ files:
108
108
  - lib/dryad/consul/key_value_client.rb
109
109
  - lib/dryad/consul/railtie.rb
110
110
  - lib/dryad/consul/service.rb
111
- - lib/dryad/consul/service_client.rb
112
111
  - lib/dryad/consul/service_registry.rb
113
112
  - lib/dryad/consul/version.rb
114
113
  homepage: https://github.com/jack0pan/dryad.rb
@@ -1,15 +0,0 @@
1
- module Dryad
2
- module Consul
3
- class ServiceClient
4
- class << self
5
- def method_missing(name, *args, &block)
6
- Diplomat::Service.send(name, *args, &block) || super
7
- end
8
-
9
- def respond_to_missing?(meth_id, with_private = false)
10
- access_method?(meth_id) || super
11
- end
12
- end
13
- end
14
- end
15
- end