proto_dsl 0.1.0 → 0.1.1

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: 65e4ad31fcc61b8b2d14157ef69c9e66580d5bcfbee0772f6c2c629fc3c8ba03
4
- data.tar.gz: bba38d481018d03f0d51a7bddce5ac542e14c8f81deaff3b7754214824e62b2e
3
+ metadata.gz: ee1f8e513d714fade2531bf5d1579422b9404f2c5cb403679440a1c3760ee217
4
+ data.tar.gz: 28a5f60d3759749a054cde118d5301809f16b74b52332ff6e86d4676a29a4adf
5
5
  SHA512:
6
- metadata.gz: 0ec9c704050355c71734a7496ff6843442906c7d4e13cf3e1dbc8ce8b7af31e4d8b4a21a17419e52d05d4e6bde6bd30a8f35970ec639fc850299c0379244f00d
7
- data.tar.gz: ad6281d9fa7036f23665b74d68a4825b4b35f7b9d27ab167eed9695588943e067b5f7dfdfb4b7565d17e59129b806ca979d54243156c1e6275bb26a1e04acb8a
6
+ metadata.gz: 9e91ee3b91817c3b17f109c3e8f2a0a2845b299a20e794272073d43d83fce0057112ebd2221fcf2af6028f68a647e43d642e0f3cc050e2955abbc383da9a1aee
7
+ data.tar.gz: 33928658b24164eb304d0bab8e61d415ad2e97545b1b8d079f7bfaf46ec1b1d7c1bc27360d86936fd86f2b30e7540ab9d70e37b068e0cdb95b0158a6757e2d92
data/.rubocop.yml CHANGED
@@ -20,3 +20,6 @@ Metrics/AbcSize:
20
20
 
21
21
  Metrics/MethodLength:
22
22
  Max: 20
23
+
24
+ Metrics/BlockLength:
25
+ Max: 50
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- proto_dsl (0.1.0)
4
+ proto_dsl (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/proto_dsl/dsl.rb CHANGED
@@ -74,6 +74,14 @@ module ProtoDsl
74
74
  end
75
75
  output
76
76
  end
77
+
78
+ def to_server_code
79
+ output = +""
80
+ @services.each do |service|
81
+ output << service.to_server_code
82
+ end
83
+ output
84
+ end
77
85
  end
78
86
  end
79
87
 
data/lib/proto_dsl/rpc.rb CHANGED
@@ -24,6 +24,14 @@ module ProtoDsl
24
24
  output << " }\n"
25
25
  output
26
26
  end
27
+
28
+ def to_server_code
29
+ " def #{@name}(request: #{@request_type}, context: ServerContext)\n" \
30
+ " # TODO: implement server logic for #{@name} RPC method\n" \
31
+ " response = #{@response_type}()\n" \
32
+ " return response\n" \
33
+ " end\n"
34
+ end
27
35
  end
28
36
  end
29
37
 
@@ -26,5 +26,13 @@ module ProtoDsl
26
26
  output << "}\n"
27
27
  output
28
28
  end
29
+
30
+ def to_server_code
31
+ output = +""
32
+ @rpcs.each do |rpc|
33
+ output << rpc.to_server_code
34
+ end
35
+ output
36
+ end
29
37
  end
30
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProtoDsl
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proto_dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvance
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-06 00:00:00.000000000 Z
11
+ date: 2022-12-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: It provides a simple, readable syntax for defining Protocol Buffer message
14
14
  types using Ruby code. The `to_proto` method can be used to convert the defined