umts-microservices-engine 0.1.0 → 0.1.1

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: 047205e3f834412639d8032e0f99de1ce8671c6c
4
- data.tar.gz: 5605425e67060720ec62fc0d9eefe8e431936b3f
3
+ metadata.gz: 9409c0b1a98e54dadf7bd0800deeb7aa39d72a9b
4
+ data.tar.gz: 0a53090a5e55d798486c6ddfa618dda0503d4c63
5
5
  SHA512:
6
- metadata.gz: 99fa43095b2487549c47200ab00e1a788763e590908fdd6a0e50ff5f9bd4d3cfaf56e5180e537c566e22441b40bf092a912fffe21c03fea6153e56b5b660cc05
7
- data.tar.gz: d071ce009966b5023fd7a9f374eb5a84548493261a83670df7e90b60e3ef80e5448fc0810b0aba7f16cf7a0523ab18964381beb8461d8d0eacf9517ccfacc8ce
6
+ metadata.gz: 4a67493586dc5607dc0782678bfd93350e5ab434e333b884a4ce2577c38356602b652fa956c64694a20576ab11adad4485ec3417e328749db0267aab8d64a1cf
7
+ data.tar.gz: a1af368d87eff8874420679b4ca72e2d0caf4f315335fc9278393f617716cc4a81de46f536874dee63077bcb0ca0248583997ae9815cc383494c7b23a208a908
@@ -2,29 +2,33 @@
2
2
  require 'net/http'
3
3
  CONFIG_FILE = 'config/mse_router_info.yml'
4
4
 
5
- report_missing_config_key = lambda do |key|
6
- raise ArgumentError, "Missing key #{key} in #{CONFIG_FILE}"
7
- end
5
+ unless ENV['DISABLE_ROUTER_CHECKIN']
8
6
 
9
- unless File.file?(CONFIG_FILE)
10
- raise IOError, 'No router configuration YAML file found'
11
- end
7
+ report_missing_config_key = lambda do |key|
8
+ raise ArgumentError, "Missing key #{key} in #{CONFIG_FILE}"
9
+ end
10
+
11
+ unless File.file?(CONFIG_FILE)
12
+ raise IOError, 'No router configuration YAML file found'
13
+ end
12
14
 
13
- config_data = YAML.load_file(CONFIG_FILE)
15
+ config_data = YAML.load_file(CONFIG_FILE)
14
16
 
15
- service_name = config_data.fetch 'name', &report_missing_config_key
16
- service_url = config_data.fetch 'uri', &report_missing_config_key
17
- router_url = config_data.fetch 'router_uri', &report_missing_config_key
18
- security_token = config_data.fetch 'security_token', &report_missing_config_key
17
+ service_name = config_data.fetch 'name', &report_missing_config_key
18
+ service_url = config_data.fetch 'uri', &report_missing_config_key
19
+ router_url = config_data.fetch 'router_uri', &report_missing_config_key
20
+ security_token = config_data.fetch 'security_token', &report_missing_config_key
19
21
 
20
- router_url = router_url + '/services/register'
22
+ router_url = router_url + '/services/register'
21
23
 
22
- res = Net::HTTP.post_form(
23
- URI.parse(router_url),
24
- name: service_name,
25
- url: service_url,
26
- models: config_data['accessible_models'],
27
- security_token: security_token
28
- )
24
+ res = Net::HTTP.post_form(
25
+ URI.parse(router_url),
26
+ name: service_name,
27
+ url: service_url,
28
+ models: config_data['accessible_models'],
29
+ security_token: security_token
30
+ )
29
31
 
30
- raise 'The router API response was invalid' if res.code != '200'
32
+ raise 'The router API response was invalid' if res.code != '200'
33
+
34
+ end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module MicroservicesEngine
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umts-microservices-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - UMass Transportation Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-14 00:00:00.000000000 Z
11
+ date: 2017-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails