nmspec 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -3
- data/lib/nmspec/gdscript.rb +2 -2
- data/lib/nmspec/ruby.rb +4 -3
- data/lib/nmspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e70533f6e749c2e1002934b261b6d642d70d05c713ba4ae277e19fdc9ec5ca8
|
4
|
+
data.tar.gz: 1ab962483d6d486185ded45fdf9b74d5759741ba7f6baa6d03a857df399afcc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7011dd7477bc0a65e472a93b8f305e5e9c4e240574543765a36dc30b2bc4244536a762bcd915bca646bca821dfa95c481d866eba9e24656c8d2349a33ed00a53
|
7
|
+
data.tar.gz: e173d860689aaa6845e3e7313305cb2667464122506dcfe7069fe5f064a2889fbe8e7638116c34548e3e56c077821b20aa0ce63c8b61747836b57c2d00131e86
|
data/README.md
CHANGED
@@ -12,6 +12,12 @@ described in `nmspec` are used to create both the reading and writing sides
|
|
12
12
|
of the connection, so that a single source code file contains everything you
|
13
13
|
need for a network peer, regardless of if it's the client or server.
|
14
14
|
|
15
|
+
## Demo video explaining how to use this gem
|
16
|
+
|
17
|
+
<a href="https://youtu.be/Ib6c6BEl82c">
|
18
|
+
<img src="https://s3.us-east-2.amazonaws.com/vim4evar.com/nmspec-imgs/link-to-demo-video.png" />
|
19
|
+
</a>
|
20
|
+
|
15
21
|
## Motivation
|
16
22
|
|
17
23
|
`nmspec` was specifically created to help with with a problem I was facing,
|
@@ -48,8 +54,8 @@ As a starting point this gem supports network messengers in these two languages:
|
|
48
54
|
* [Ruby 3.0.x][ruby-lang]
|
49
55
|
* [GDScript 3.4.stable][gdscript]
|
50
56
|
|
51
|
-
`nmspec` came out of a online game project where the backend
|
52
|
-
Ruby, and the frontend
|
57
|
+
`nmspec` came out of a online game project where the backend is written in
|
58
|
+
Ruby, and the frontend is built with the Godot game engine, which includes the
|
53
59
|
embedded scripting language, GDSCript.
|
54
60
|
|
55
61
|
# Sample usage
|
@@ -283,7 +289,7 @@ description languages/tools in the past, beginning with [Prolac][prolac]. This
|
|
283
289
|
lead me to other network messaging tools, binary serialization in general,
|
284
290
|
finally [Google's protocol buffers][protobuffs]. Protocol buffers were probably
|
285
291
|
the closest thing to what I wanted, and took care of binary
|
286
|
-
serialization/deserialization, but weren't
|
292
|
+
serialization/deserialization, but weren't packaged with the networking layer,
|
287
293
|
which introduces additional considerations such as byte ordering, efficient
|
288
294
|
packet construction, TCP stack options, and communication retries and graceful
|
289
295
|
failover. While protocol buffers are a good design, and I think do a good job of
|
data/lib/nmspec/gdscript.rb
CHANGED
@@ -14,7 +14,7 @@ module Nmspec
|
|
14
14
|
|
15
15
|
if spec.dig(:msgr, :desc)
|
16
16
|
code << '#'
|
17
|
-
|
17
|
+
spec.dig(:msgr, :desc).lines.each{|l| code << "# #{l.strip}" }
|
18
18
|
end
|
19
19
|
|
20
20
|
code << 'extends Reference'
|
@@ -323,7 +323,7 @@ module Nmspec
|
|
323
323
|
def _proto_method(kind, proto_code, proto, local_vars, passed_params, subtypes)
|
324
324
|
code = []
|
325
325
|
|
326
|
-
code << "# #{
|
326
|
+
proto[:desc].lines.each{|l| code << "# #{l.strip}" } if proto[:desc]
|
327
327
|
unless local_vars.empty?
|
328
328
|
code << '#'
|
329
329
|
code << '# returns: (type | local var name)'
|
data/lib/nmspec/ruby.rb
CHANGED
@@ -14,8 +14,8 @@ module Nmspec
|
|
14
14
|
code << '# NOTE: this code is auto-generated from an nmspec file'
|
15
15
|
|
16
16
|
if spec.dig(:msgr, :desc)
|
17
|
-
code << '
|
18
|
-
|
17
|
+
code << '##'
|
18
|
+
spec.dig(:msgr, :desc).lines.each{|l| code << "# #{l.strip}" }
|
19
19
|
end
|
20
20
|
|
21
21
|
code << "class #{_class_name_from_msgr_name(spec.dig(:msgr, :name))}"
|
@@ -372,7 +372,8 @@ module Nmspec
|
|
372
372
|
def _proto_method(kind, proto_code, proto, local_vars, passed_params)
|
373
373
|
code = []
|
374
374
|
|
375
|
-
code << " # #{
|
375
|
+
proto[:desc].lines.each{|l| code << " # #{l.strip}" } if proto[:desc]
|
376
|
+
|
376
377
|
unless local_vars.empty?
|
377
378
|
code << ' #'
|
378
379
|
code << ' # returns: (type | local var name)'
|
data/lib/nmspec/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
NMSPEC_GEM_VERSION = '1.6.
|
1
|
+
NMSPEC_GEM_VERSION = '1.6.1'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nmspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Lunt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: nmspec makes it easier to describe binary messages between two network
|
14
14
|
peers via a config file, generate their network code in a number of languages, and
|