grpc-rest 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
  SHA256:
3
- metadata.gz: 0ca423be5a7314061750adbe2e151db9780fa33fd81f6737520ba697d8f71d43
4
- data.tar.gz: 6729fbbd231299780f71ae9fcf437c969f04975ecca2bd871fa733cc8ee4fa6a
3
+ metadata.gz: c3dc93105554c8c92a3229f693ab0c93ed5833796ef7b7f11e94cb8821f2c425
4
+ data.tar.gz: ac3ec407c674d16fb33e6bddccfa10b9e66859af3d5ecbad58d1ff2603e7c098
5
5
  SHA512:
6
- metadata.gz: 47b4b888dc91c03388bb6a20c2cdafd12ee0d6e9e6c0e288cb84696009df07b5ed30312038eda6b479a806f4fbf929122e5a5d05b7ca149b8e7a415a55fc67cd
7
- data.tar.gz: 20263c167837551a33f9b69ea2f923bf55f8c251ad7d4c11d4aa6832aa873955180fdd4946a6f2b7f9f101a6643c2d86bea8d36f2e229dddf1b70deeddc5ea6a
6
+ metadata.gz: b1c05d823f083722774025bf8772d535b211b4ef01f3022baa92003a179ab2f3c1fcd6646c6b7eb5acf9ced1ff5abd3e962eea541ddfa7c0d9766bcc2649cb44
7
+ data.tar.gz: c4c40a55b73429c7716ed2e6164c546f8d1c2e53030d6b1182475b66ec430590c637c691bac7af21294a62b39782a4ecc2d332c4afa68879cef4b803a170beb1
@@ -23,7 +23,7 @@ jobs:
23
23
  uses: arduino/setup-protoc@v2
24
24
  - run: git reset --hard
25
25
  - run: git clean -f -d
26
- - run: go test ./...
26
+ - run: cd protoc-gen-rails && go test ./...
27
27
 
28
28
  build_and_deploy:
29
29
  needs: test
@@ -1,3 +1,3 @@
1
1
  module GrpcRest
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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 Google::Protobuf::TypeError do |e|
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, "/test/{blah=foobar/*}/{repeated_string}", "*", request.parameters)
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, "/test2", "second_record", request.parameters)
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, "/test3/{sub_record.sub_id}", "", request.parameters)
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.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-03 00:00:00.000000000 Z
11
+ date: 2024-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc