umts-microservices-engine 0.1.1 → 0.1.2

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: 9409c0b1a98e54dadf7bd0800deeb7aa39d72a9b
4
- data.tar.gz: 0a53090a5e55d798486c6ddfa618dda0503d4c63
3
+ metadata.gz: c1780e56743cbf25af41b5e7dec759c315468e77
4
+ data.tar.gz: 6b59e88c4e97d6cd0fc7e8a175e00f08b499449b
5
5
  SHA512:
6
- metadata.gz: 4a67493586dc5607dc0782678bfd93350e5ab434e333b884a4ce2577c38356602b652fa956c64694a20576ab11adad4485ec3417e328749db0267aab8d64a1cf
7
- data.tar.gz: a1af368d87eff8874420679b4ca72e2d0caf4f315335fc9278393f617716cc4a81de46f536874dee63077bcb0ca0248583997ae9815cc383494c7b23a208a908
6
+ metadata.gz: 585babaed237a4fade50671c0f69d6f4137b9fad775b37e48145536476bd1e5e88c1eb192152f89728a0902318a4c7ab9a08e39291a9e0270a4443688074a242
7
+ data.tar.gz: 98b2cdc2665e3a9bb5de99ebbfeae75fa7c8556ecf3889962567cc68cbcce22dabf67f8e7b6ad272554c9c2f87393a870da144d721493af8cac401a9d24124aa
@@ -7,7 +7,10 @@ module MicroservicesEngine
7
7
 
8
8
  def self.get(resource, path, params = {})
9
9
  conn = Connection.find_by(object: resource.to_s) # Does :abc match "abc"?
10
- conn.get(path, params) if conn.present?
10
+ if conn.present?
11
+ conn.get path, params
12
+ else raise ArgumentError, "Unknown resource #{resource}"
13
+ end
11
14
  end
12
15
 
13
16
  def get(path, params = {})
@@ -22,7 +25,10 @@ module MicroservicesEngine
22
25
  uri.query = URI.encode_www_form(params)
23
26
 
24
27
  res = Net::HTTP.get_response(uri)
25
- return res.body if res.is_a?(Net::HTTPSuccess)
28
+ if res.is_a? Net::HTTPSuccess
29
+ res.body
30
+ else raise ArgumentError, res.body
31
+ end
26
32
  end
27
33
  end
28
34
  end
@@ -6,5 +6,6 @@ class InstallGenerator < Rails::Generators::Base
6
6
  template 'mse_router_info.yml', 'config/mse_router_info.yml'
7
7
  copy_file 'microservices_engine.rb',
8
8
  'config/initializers/microservices_engine.rb'
9
+ generate 'migration', 'create_microservices_engine_connections', 'name:string', 'object:string', 'url:string'
9
10
  end
10
11
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module MicroservicesEngine
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
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.1
4
+ version: 0.1.2
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-17 00:00:00.000000000 Z
11
+ date: 2017-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails