umts-microservices-engine 0.0.9 → 0.1.0

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: e31c36ad32fb81c29bddd959d0daa12d7ee2c0db
4
- data.tar.gz: a0715607064359d69440323ec5794c6a7c8241c3
3
+ metadata.gz: 047205e3f834412639d8032e0f99de1ce8671c6c
4
+ data.tar.gz: 5605425e67060720ec62fc0d9eefe8e431936b3f
5
5
  SHA512:
6
- metadata.gz: 99b5ed0a0434156703f07b5436f69aea1b2d1349dd3196381ae0ec83c7f813d2e3b4691550bbbfcee7186ba5275b63fb988b8acfce4dbd145eab11fd74ac591e
7
- data.tar.gz: 75adfcc8c1e83a4c7000e01ea65142b2066e8a745cd6357dfdd8fd4282b53ac8b7af8d5e2d08b73c8008678aa51a35a8e0f104f73ab47ba4b66a7e1ac370432d
6
+ metadata.gz: 99fa43095b2487549c47200ab00e1a788763e590908fdd6a0e50ff5f9bd4d3cfaf56e5180e537c566e22441b40bf092a912fffe21c03fea6153e56b5b660cc05
7
+ data.tar.gz: d071ce009966b5023fd7a9f374eb5a84548493261a83670df7e90b60e3ef80e5448fc0810b0aba7f16cf7a0523ab18964381beb8461d8d0eacf9517ccfacc8ce
@@ -1,21 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
  require 'net/http'
3
- config_file = 'config/mse_router_info.yml'
3
+ CONFIG_FILE = 'config/mse_router_info.yml'
4
4
 
5
- REPORT_MISSING_CONFIG_KEY = -> (key) {
6
- raise ArgumentError, "Missing key #{key} in #{config_file}"
7
- }
5
+ report_missing_config_key = lambda do |key|
6
+ raise ArgumentError, "Missing key #{key} in #{CONFIG_FILE}"
7
+ end
8
8
 
9
- unless File.file?(config_file)
9
+ unless File.file?(CONFIG_FILE)
10
10
  raise IOError, 'No router configuration YAML file found'
11
11
  end
12
12
 
13
- config_data = YAML.load_file(config_file)
13
+ config_data = YAML.load_file(CONFIG_FILE)
14
+
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
14
19
 
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
19
20
  router_url = router_url + '/services/register'
20
21
 
21
22
  res = Net::HTTP.post_form(
@@ -7,6 +7,7 @@ name: ''
7
7
 
8
8
  # REQUIRED field
9
9
  # The URI for the site hosting the microservice
10
+ # remember to add http:// to the beginning of your uri
10
11
  uri: ''
11
12
 
12
13
  # REQUIRED field
@@ -15,7 +16,8 @@ security_token: ''
15
16
 
16
17
  # REQUIRED Field
17
18
  # Endpoint of Microservices router
18
- # Make sure you do not add a slash to this.
19
+ # Make sure you do not add a slash to this, and remember to add
20
+ # http:// to the beginning of your uri.
19
21
  router_uri: ''
20
22
 
21
23
  # OPTIONAL field (leave blank if not applicable)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module MicroservicesEngine
3
- VERSION = '0.0.9'
3
+ VERSION = '0.1.0'
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.0.9
4
+ version: 0.1.0
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-11 00:00:00.000000000 Z
11
+ date: 2017-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails