grpc-rest 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3dc93105554c8c92a3229f693ab0c93ed5833796ef7b7f11e94cb8821f2c425
|
4
|
+
data.tar.gz: ac3ec407c674d16fb33e6bddccfa10b9e66859af3d5ecbad58d1ff2603e7c098
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1c05d823f083722774025bf8772d535b211b4ef01f3022baa92003a179ab2f3c1fcd6646c6b7eb5acf9ced1ff5abd3e962eea541ddfa7c0d9766bcc2649cb44
|
7
|
+
data.tar.gz: c4c40a55b73429c7716ed2e6164c546f8d1c2e53030d6b1182475b66ec430590c637c691bac7af21294a62b39782a4ecc2d332c4afa68879cef4b803a170beb1
|
data/.github/workflows/CI.yml
CHANGED
data/lib/grpc_rest/version.rb
CHANGED
@@ -78,7 +78,7 @@ func runTest(t *testing.T, directory string, options map[string]string) {
|
|
78
78
|
|
79
79
|
testDir := workdir + "/testdata/" + directory
|
80
80
|
if os.Getenv("UPDATE_SNAPSHOTS") != "" {
|
81
|
-
cmd := exec.Command("/bin/sh", "-c", fmt.Sprintf("cp %v/* %v", tmpdir, testDir))
|
81
|
+
cmd := exec.Command("/bin/sh", "-c", fmt.Sprintf("cp -R %v/* %v", tmpdir, testDir))
|
82
82
|
cmd.Run()
|
83
83
|
} else {
|
84
84
|
assertEqualFiles(t, testDir, tmpdir)
|
@@ -4,25 +4,39 @@ require 'services/geo_admin/v1/test_services_pb'
|
|
4
4
|
class MyServiceController < ActionController::Base
|
5
5
|
protect_from_forgery with: :null_session
|
6
6
|
|
7
|
-
rescue_from
|
7
|
+
rescue_from StandardError do |e|
|
8
8
|
render json: GrpcRest.error_msg(e)
|
9
9
|
end
|
10
|
+
METHOD_PARAM_MAP = {
|
11
|
+
|
12
|
+
"test" => [
|
13
|
+
{name: "blah", val: "foobar/*", split_name:["blah"]},
|
14
|
+
{name: "repeated_string", val: nil, split_name:["repeated_string"]},
|
15
|
+
],
|
16
|
+
|
17
|
+
"test_2" => [
|
18
|
+
],
|
19
|
+
|
20
|
+
"test_3" => [
|
21
|
+
{name: "sub_record.sub_id", val: nil, split_name:["sub_record","sub_id"]},
|
22
|
+
],
|
23
|
+
}.freeze
|
10
24
|
|
11
25
|
def test
|
12
26
|
grpc_request = Testdata::TestRequest.new
|
13
|
-
GrpcRest.assign_params(grpc_request, "
|
27
|
+
GrpcRest.assign_params(grpc_request, METHOD_PARAM_MAP["test"], "*", request.parameters)
|
14
28
|
render json: GrpcRest.send_request("Testdata::MyService", "test", grpc_request)
|
15
29
|
end
|
16
30
|
|
17
31
|
def test_2
|
18
32
|
grpc_request = Testdata::TestRequest.new
|
19
|
-
GrpcRest.assign_params(grpc_request, "
|
33
|
+
GrpcRest.assign_params(grpc_request, METHOD_PARAM_MAP["test_2"], "second_record", request.parameters)
|
20
34
|
render json: GrpcRest.send_request("Testdata::MyService", "test_2", grpc_request)
|
21
35
|
end
|
22
36
|
|
23
37
|
def test_3
|
24
38
|
grpc_request = Testdata::TestRequest.new
|
25
|
-
GrpcRest.assign_params(grpc_request, "
|
39
|
+
GrpcRest.assign_params(grpc_request, METHOD_PARAM_MAP["test_3"], "", request.parameters)
|
26
40
|
render json: GrpcRest.send_request("Testdata::MyService", "test_3", grpc_request)
|
27
41
|
end
|
28
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grpc-rest
|
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
|
- Daniel Orner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|