nmspec 1.6.1 → 1.7.0

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: 3e70533f6e749c2e1002934b261b6d642d70d05c713ba4ae277e19fdc9ec5ca8
4
- data.tar.gz: 1ab962483d6d486185ded45fdf9b74d5759741ba7f6baa6d03a857df399afcc6
3
+ metadata.gz: 88cca809908f3d18f892632676265d699f4c5d4d9d2e529648d0c9afce089b8c
4
+ data.tar.gz: 1e1bd8dde9f3ddb429a82c691d98e093af6c7c8062a5dd787fd1c03ce86ff36d
5
5
  SHA512:
6
- metadata.gz: 7011dd7477bc0a65e472a93b8f305e5e9c4e240574543765a36dc30b2bc4244536a762bcd915bca646bca821dfa95c481d866eba9e24656c8d2349a33ed00a53
7
- data.tar.gz: e173d860689aaa6845e3e7313305cb2667464122506dcfe7069fe5f064a2889fbe8e7638116c34548e3e56c077821b20aa0ce63c8b61747836b57c2d00131e86
6
+ metadata.gz: 32e55f491c9ccab6035971c9b9b4d086a9275569ac252b52560d16d14266724c43c6ce75f3d45eb9efdc774e4f91a86f95c081f65e11d93a169632f22a9e5535
7
+ data.tar.gz: 062cafda68dc77cf47261e783c1937cf68ef762f60ef572842f98803e6f0ebf4fbded2a514fd21a382a3c6814cb6c2a2d78bcfad1ea67f9ccbcbfad39815f128
@@ -2,7 +2,7 @@ require 'set'
2
2
 
3
3
  # Nmspec code generator for ruby
4
4
  module Nmspec
5
- module GDScript
5
+ module GDScript3x
6
6
  class << self
7
7
  def gen(spec)
8
8
  big_endian = spec.dig(:msgr, :bigendian)
@@ -52,8 +52,6 @@ module Nmspec
52
52
 
53
53
  subtypes = spec[:types].select{|t| !t[:base_type].nil? }
54
54
  code << _protos_methods(spec[:protos], subtypes)
55
-
56
- code.join("\n")
57
55
  rescue => e
58
56
  "Code generation failed due to unknown error: check spec validity\n cause: #{e.inspect}"
59
57
  puts e.backtrace.join("\n ")
@@ -288,6 +286,7 @@ module Nmspec
288
286
  ##
289
287
  # send
290
288
  code << _proto_method('send', proto_code, proto, send_local_vars, send_passed_params, subtypes)
289
+ code << "\n"
291
290
  code << _proto_method('recv', proto_code, proto, recv_local_vars, recv_passed_params, subtypes)
292
291
  end
293
292
 
@@ -2,7 +2,7 @@ require 'set'
2
2
 
3
3
  # Nmspec code generator for ruby
4
4
  module Nmspec
5
- module Ruby
5
+ module Ruby3x
6
6
  class << self
7
7
  def gen(spec)
8
8
  endian_marker = spec.dig(:msgr, :bigendian) ? '>' : '<'
data/lib/nmspec/v1.rb CHANGED
@@ -4,7 +4,7 @@ require_relative './version.rb'
4
4
  module Nmspec
5
5
  module V1
6
6
  SUPPORTED_SPEC_VERSIONS = [1]
7
- SUPPORTED_OUTPUT_LANGS = %w(gdscript ruby)
7
+ SUPPORTED_OUTPUT_LANGS = %w(gdscript3x ruby3x)
8
8
  GEN_OPTS_KEYS = %w(langs spec)
9
9
  REQ_KEYS = %w(version msgr)
10
10
  OPT_KEYS = %w(types protos)
@@ -27,7 +27,7 @@ module Nmspec
27
27
  #
28
28
  # {
29
29
  # 'spec' => <String of valid nmspec YAML,
30
- # 'langs' => ['ruby', ...], # array of target languages
30
+ # 'langs' => ['ruby3x', ...], # array of target languages
31
31
  # }
32
32
  #
33
33
  # Returns a hash with this format:
@@ -157,14 +157,14 @@ module Nmspec
157
157
  errors(raw_spec).empty?
158
158
  end
159
159
 
160
- def to_ruby(spec_hash)
161
- ::Nmspec::Ruby.gen(spec_hash)
160
+ def to_ruby3x(spec_hash)
161
+ ::Nmspec::Ruby3x.gen(spec_hash)
162
162
  rescue
163
163
  'codegen failure'
164
164
  end
165
165
 
166
- def to_gdscript(spec_hash)
167
- ::Nmspec::GDScript.gen(spec_hash)
166
+ def to_gdscript3x(spec_hash)
167
+ ::Nmspec::GDScript3x.gen(spec_hash)
168
168
  rescue
169
169
  'codegen failure'
170
170
  end
@@ -1 +1 @@
1
- NMSPEC_GEM_VERSION = '1.6.1'
1
+ NMSPEC_GEM_VERSION = '1.7.0'
data/lib/nmspec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'nmspec/v1'
2
- require 'nmspec/parser'
3
- require 'nmspec/ruby'
4
- require 'nmspec/gdscript.rb'
1
+ require_relative 'nmspec/v1'
2
+ require_relative 'nmspec/parser'
3
+ require_relative 'nmspec/ruby3x'
4
+ require_relative 'nmspec/gdscript3x.rb'
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.1
4
+ version: 1.7.0
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-12 00:00:00.000000000 Z
11
+ date: 2024-06-23 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
@@ -22,9 +22,9 @@ files:
22
22
  - LICENSE
23
23
  - README.md
24
24
  - lib/nmspec.rb
25
- - lib/nmspec/gdscript.rb
25
+ - lib/nmspec/gdscript3x.rb
26
26
  - lib/nmspec/parser.rb
27
- - lib/nmspec/ruby.rb
27
+ - lib/nmspec/ruby3x.rb
28
28
  - lib/nmspec/v1.rb
29
29
  - lib/nmspec/version.rb
30
30
  homepage: http://nmspec.com
@@ -47,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  requirements: []
50
- rubygems_version: 3.2.32
50
+ rubygems_version: 3.4.10
51
51
  signing_key:
52
52
  specification_version: 4
53
53
  summary: nmspec is a network message specification language for network peers