instructure_registrar 0.1.14 → 0.1.15

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
  SHA1:
3
- metadata.gz: 94bb387d09ea3aed41df6db6457910e2ad941749
4
- data.tar.gz: 23b60a9592296c928de1f0738f95b93cdd37ef8d
3
+ metadata.gz: 5b2003ff7c8762ebc1fc1e9fc7a924d58bb4c31e
4
+ data.tar.gz: 809e99d6a39fc38c223b069465b4a2ffe29a3181
5
5
  SHA512:
6
- metadata.gz: 89ce75acc84e0c8b8165324e016e433f3c2ac2a45c73eabf5d3bc121c4929d8febfc6b99a398aad6385d45acb41aa5cc1e744ac1d2cf0b107a22eb09955cfe76
7
- data.tar.gz: 30457a744b132e31ec33c37eb662c7699fdb91f71ea57e24c2d75a6cf9f1a3a69a93dd18443f7d7a4fde04e20b046a0dd5bde8c2e5a8ed60b0043d7171c5c15c
6
+ metadata.gz: 84c0aa62ef69c33590108ca9563de0c26543bec423fe3a582464044cd909e6db571f24026dfbbde76ca9b462a36b0cabfd5c9febd01c5b8e32ea6928ffed5ee9
7
+ data.tar.gz: 694d18c3e3395929305e5b7894d920f16f521a63dc7f504fdfd4184cbf93533d96f0177bc0d5d5e6d613a3e53e89b4183dacbb0fb119c01b897b34e61345e4df
data/README.md CHANGED
@@ -36,9 +36,10 @@ In your service's project folder, create a configuration file with the following
36
36
  config.registry_host = ENV['REGISTRY_HOST']# || "http://instructure-etcd.docker"
37
37
  config.registry_port = ENV['REGISTRY_PORT']# || 12379
38
38
  config.service_name = "sample_service_3"
39
- config.service_host = ENV['SERVICE_HOST'] || "http://localhost"
40
- config.service_port = ENV['SERVICE_PORT'] || 3000
41
- config.service_config = { token: 'foo', option: 'bar'}
39
+ config.service_config = {
40
+ host: "http://someservice.docker",
41
+ token: 'foo',
42
+ option: 'bar'}
42
43
  end
43
44
 
44
45
  if ENV['RAILS_ENV'] == "development"
@@ -66,3 +67,5 @@ Then, to fetch connection information for a given service:
66
67
  require 'instructure_registrar'
67
68
  @some_service_url = InstructureRegistrar.get_service('some_service_name')
68
69
 
70
+ This will return all keys and values associated with the service.
71
+
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{Client for registering an Instructure service via etcd.}
13
13
  spec.description = %q{Client for registering an Instructure service via etcd.}
14
- spec.homepage = "https://github.com/CoralineAda/instructure_registrar"
14
+ spec.homepage = "https://github.com/Instructure/instructure_registrar"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
17
  spec.bindir = "exe"
@@ -18,17 +18,18 @@ module InstructureRegistrar
18
18
 
19
19
  def lookup(service_name)
20
20
  begin
21
- client.get("/#{service_name}").value
21
+ client.get("/#{service_name}").children.inject({}) do |h, child|
22
+ h["#{child.key.split('/').last}"] = child.value; h
23
+ end
22
24
  rescue Etcd::KeyNotFound
23
- "unknown"
25
+ {status: "unknown"}
24
26
  end
25
27
  end
26
28
 
27
29
  def register
28
30
  return unless server_available
29
31
  InstructureRegistrar.config.service_config.keys.each do |key|
30
- p "InstructureRegistrar setting #{InstructureRegistrar.config.service_name}/#{key}"
31
- p client.set(
32
+ client.set(
32
33
  "/#{InstructureRegistrar.config.service_name}/#{key}",
33
34
  value: InstructureRegistrar.config.service_config[key]
34
35
  )
@@ -1,3 +1,3 @@
1
1
  module InstructureRegistrar
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.15"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instructure_registrar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - CoralineAda
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-09-03 00:00:00.000000000 Z
12
+ date: 2015-10-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: etcd
@@ -87,7 +87,7 @@ files:
87
87
  - lib/instructure_registrar.rb
88
88
  - lib/instructure_registrar/client.rb
89
89
  - lib/instructure_registrar/version.rb
90
- homepage: https://github.com/CoralineAda/instructure_registrar
90
+ homepage: https://github.com/Instructure/instructure_registrar
91
91
  licenses: []
92
92
  metadata: {}
93
93
  post_install_message: