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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e19f2ff09effa0411bc676e0eb2356129f8aa496ec4bbf1df66935268d4e6763
4
- data.tar.gz: 72bfd23c64c44dd2db4b449e6863c7855e34c1ed2c774b5f2ff3e16f7fd7910f
3
+ metadata.gz: f48caa109de676a0bae8fcf3f5cdfa78fc7299c885c83ed9f5e7e64e0623fc76
4
+ data.tar.gz: d97b628c02d64d1a05b0ab48e0fb126bc5bfb7b5aef6d9b1f000a5b1c13e33c5
5
5
  SHA512:
6
- metadata.gz: c3c294f02102bb2031e6681a17a5bd92dfd4bbde39db1c94302dd8775756d34b47d1bea3ff0a7c94f4f5a857569fc2c4a658ae80ff275c7b109094c0d9b208c7
7
- data.tar.gz: 941d649b3233024963fabd1bd51d083b3ba22639dfb15e9b2e74df5264b948fb82ac152d86751f6352be28d2a4a283c10aba2dbddcd154744db810594bbee821
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 Ruby class from a spec file
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 spec source
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