ynl 0.3.0 → 0.4.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 +4 -4
- data/CHANGELOG.md +15 -0
- data/Rakefile +7 -0
- data/lib/ynl/family.rb +15 -2
- data/lib/ynl/generator.rb +811 -64
- data/lib/ynl/models.rb +21 -10
- data/lib/ynl/parser.rb +109 -42
- data/lib/ynl/version.rb +1 -1
- data/lib/ynl.rb +32 -4
- data/sig/generated/ynl/family.rbs +24 -0
- data/sig/generated/ynl/generator.rbs +163 -0
- data/sig/generated/ynl/models.rbs +165 -0
- data/sig/generated/ynl/parser.rbs +62 -0
- data/sig/generated/ynl/version.rbs +5 -0
- data/sig/generated/ynl.rbs +119 -0
- metadata +10 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f48caa109de676a0bae8fcf3f5cdfa78fc7299c885c83ed9f5e7e64e0623fc76
|
|
4
|
+
data.tar.gz: d97b628c02d64d1a05b0ab48e0fb126bc5bfb7b5aef6d9b1f000a5b1c13e33c5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a8e20972eb123c93c01379741ac32577f7cd1dead7bbb4711c00d57a939512be13e04cf236a9406c604d244dc98d3250beb6e0ff2b661e90f9f7a0979d279e0
|
|
7
|
+
data.tar.gz: 3d80e4d799f558b6e870d2e42befe06d68f3cd89bdd18f475c0be57f856798111a842a870da73f1ad1bd5840b6dd63100f351e3d96901dcbc87677d5f143f4a0
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## v0.4.2 (2026-09-09)
|
|
6
|
+
|
|
7
|
+
## v0.4.1 (2026-09-08)
|
|
8
|
+
|
|
9
|
+
## v0.4.0 (2026-09-08)
|
|
10
|
+
|
|
11
|
+
- Generate `Nl::Bitfield32` types for `bitfield32` attributes.
|
|
12
|
+
- Generate binary struct members and attributes as structured values.
|
|
13
|
+
- Parse Generic Netlink family versions and emit them as generated metadata.
|
|
14
|
+
- Generate array parameters and accessors for `multi-attr` attributes.
|
|
15
|
+
- Generate typed value readers for nested attribute sets.
|
|
16
|
+
- Apply attribute property overrides declared by attribute-set subsets.
|
|
17
|
+
- Generate typed polymorphic sub-messages with statically resolved selectors.
|
|
18
|
+
- Correct enum and flags numbering from `value-start` and explicit entry values.
|
|
19
|
+
|
|
5
20
|
## v0.3.0 (2026-09-01)
|
|
6
21
|
|
|
7
22
|
- Generate notification and event message classes, multicast group metadata,
|
data/Rakefile
CHANGED
|
@@ -2,4 +2,11 @@ require 'rspec/core/rake_task'
|
|
|
2
2
|
|
|
3
3
|
RSpec::Core::RakeTask.new(:spec)
|
|
4
4
|
|
|
5
|
+
desc 'Generate RBS signatures from inline annotations'
|
|
6
|
+
task :rbs do
|
|
7
|
+
sh '../bin/rbs-inline', '--output=sig/generated', '--opt-out', 'lib'
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
task :build => :rbs
|
|
11
|
+
|
|
5
12
|
task default: :spec
|
data/lib/ynl/family.rb
CHANGED
|
@@ -4,8 +4,13 @@ require_relative 'parser'
|
|
|
4
4
|
require_relative 'generator'
|
|
5
5
|
|
|
6
6
|
module Ynl
|
|
7
|
+
# Entry points for generating family classes from YNL specifications.
|
|
7
8
|
class Family
|
|
8
|
-
# Builds a
|
|
9
|
+
# Builds a family class from a YNL specification file.
|
|
10
|
+
#
|
|
11
|
+
# @param [String, #to_path] path a path to a YNL specification file
|
|
12
|
+
# @return [Class<Nl::Family>] the generated family class
|
|
13
|
+
# @rbs (String | _PathLike path) -> Class
|
|
9
14
|
def self.build(path)
|
|
10
15
|
buf = StringIO.new(Generator::PRELUDE.dup)
|
|
11
16
|
classname = File.open(path) {|f| generate(f, buf, namespace: 'self') }
|
|
@@ -13,7 +18,15 @@ module Ynl
|
|
|
13
18
|
Module.new { eval(buf.string) }.const_get(classname)
|
|
14
19
|
end
|
|
15
20
|
|
|
16
|
-
# Generates Ruby code from a
|
|
21
|
+
# Generates Ruby source code to define a family class from a YNL specification.
|
|
22
|
+
#
|
|
23
|
+
# @param [String, #read] source a YAML string or readable IO containing the YNL specification
|
|
24
|
+
# @param [#write] out the destination for the generated source code
|
|
25
|
+
# @option kwargs [String, nil] superclass the name of the generated class's superclass
|
|
26
|
+
# @option kwargs [String, nil] namespace the namespace in which to define the family class
|
|
27
|
+
# @option kwargs [String, nil] default_resolver the expression used as the default family resolver
|
|
28
|
+
# @return [String] the generated family class name
|
|
29
|
+
# @rbs (String | _Readable source, _Writable out, ?superclass: String?, ?namespace: String?, ?default_resolver: String?) -> String
|
|
17
30
|
def self.generate(source, out, **kwargs)
|
|
18
31
|
Generator.new(Ynl::Parser.new(source).parse, out).generate(**kwargs)
|
|
19
32
|
end
|