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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1780e56743cbf25af41b5e7dec759c315468e77
|
4
|
+
data.tar.gz: 6b59e88c4e97d6cd0fc7e8a175e00f08b499449b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2017-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|