ynl 0.2.4 → 0.4.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.
@@ -0,0 +1,163 @@
1
+ # Generated from lib/ynl/generator.rb with RBS::Inline
2
+
3
+ module Ynl
4
+ # Generates Ruby code from a parsed YNL specification.
5
+ class Generator
6
+ # @private
7
+ module Refinements
8
+ WORD_DELIM: ::Regexp
9
+
10
+ def as_const_name: () -> untyped
11
+
12
+ def as_class_name: () -> untyped
13
+
14
+ def as_variable_name: () -> untyped
15
+
16
+ alias as_method_name as_variable_name
17
+
18
+ def as_string_literal: () -> untyped
19
+
20
+ def as_symbol_literal: () -> untyped
21
+ end
22
+
23
+ PRELUDE: untyped
24
+
25
+ OPERATION_FLAG_DOCS: untyped
26
+
27
+ KERNEL_DOC_REFERENCE: ::Regexp
28
+
29
+ # @rbs (Models::Family ynl, _Writable out) -> void
30
+ def initialize: (Models::Family ynl, _Writable out) -> void
31
+
32
+ # @rbs (?superclass: String?, ?namespace: String?, ?default_resolver: String?) -> void
33
+ def generate: (?superclass: String?, ?namespace: String?, ?default_resolver: String?) -> void
34
+
35
+ INDENT: untyped
36
+
37
+ NEWLINE: untyped
38
+
39
+ private def write: (*untyped str) -> untyped
40
+
41
+ private def indent: () -> untyped
42
+
43
+ private def emit_module: (untyped name) -> untyped
44
+
45
+ private def emit_class: (untyped name, ?untyped superclass) -> untyped
46
+
47
+ private def emit_singleton_class: () -> untyped
48
+
49
+ private def emit_const: (untyped name, untyped value, ?rbs: untyped, ?internal: untyped) -> untyped
50
+
51
+ private def emit_value_definitions: (untyped namespace, untyped definitions) -> untyped
52
+
53
+ private def enums_used_as_flags: () -> untyped
54
+
55
+ private def emit_getter: (untyped name, untyped expr) -> untyped
56
+
57
+ private def emit_internal: () -> untyped
58
+
59
+ private def emit_open: (raw: untyped, default_resolver: untyped, classname: untyped) -> untyped
60
+
61
+ private def emit_yard_open_params: (resolver: untyped, ?indentation: untyped) -> untyped
62
+
63
+ private def emit_comment: (untyped comment) -> untyped
64
+
65
+ private def operation_doc: (untyped operation) -> untyped
66
+
67
+ private def notification_operations: () -> untyped
68
+
69
+ private def notification_doc: (untyped operation) -> untyped
70
+
71
+ private def notification_layout: (untyped operation) -> untyped
72
+
73
+ private def emit_message_class: (untyped name, untyped message, fixed_header: untyped, attribute_set: untyped, doc: untyped) -> untyped
74
+
75
+ private def emit_sub_messages: () -> untyped
76
+
77
+ private def emit_sub_message_class: (untyped name, untyped format) -> untyped
78
+
79
+ private def parameter_rbs_type: (untyped param) -> untyped
80
+
81
+ private def parameter_yard_type: (untyped param) -> untyped
82
+
83
+ private def struct_member_rbs_type: (untyped type) -> untyped
84
+
85
+ private def struct_member_yard_type: (untyped type) -> untyped
86
+
87
+ private def input_rbs_type: (untyped type) -> untyped
88
+
89
+ private def input_yard_type: (untyped type) -> untyped
90
+
91
+ private def attribute_rbs_type: (untyped attribute) -> untyped
92
+
93
+ private def attribute_yard_type: (untyped attribute) -> untyped
94
+
95
+ private def attribute_doc: (untyped attribute) -> untyped
96
+
97
+ private def attribute_value_definition: (untyped attribute) -> untyped
98
+
99
+ private def sub_message_rbs_type: (untyped type) -> untyped
100
+
101
+ private def sub_message_yard_type: (untyped type) -> untyped
102
+
103
+ private def yard_type: (untyped type) -> untyped
104
+
105
+ private def emit_mcast_groups: () -> untyped
106
+
107
+ private def emit_subscription_methods: () -> untyped
108
+
109
+ private def emit_rbs_comment: (*untyped args) -> untyped
110
+
111
+ private def emit_yard_overload: (untyped signature) -> untyped
112
+
113
+ private def emit_yard_options: (untyped params, ?indentation: untyped) -> untyped
114
+
115
+ private def emit_yard_option: (untyped parameter, untyped name, untyped type, untyped description, ?indentation: untyped) -> untyped
116
+
117
+ private def emit_yard_attribute: (untyped name, untyped type, untyped description) -> untyped
118
+
119
+ private def emit_yard_param: (untyped name, untyped type, ?indentation: untyped) -> untyped
120
+
121
+ private def emit_yard_return: (untyped type, ?untyped description, ?indentation: untyped) -> untyped
122
+
123
+ private def emit_yard_see: (untyped object) -> untyped
124
+
125
+ private def emit_yard_yieldparam: (untyped name, untyped type, ?indentation: untyped) -> untyped
126
+
127
+ private def build_selector_plan: () -> untyped
128
+
129
+ private def require_selector: (untyped set, untyped selector) -> untyped
130
+
131
+ private def build_attribute_orders: () -> untyped
132
+
133
+ private def build_selector_sources: (untyped roots) -> untyped
134
+
135
+ private def validate_selector_values: () -> untyped
136
+
137
+ private def child_attribute_sets: (untyped type) -> untyped
138
+
139
+ private def attribute_by_name: (untyped set, untyped name) -> untyped
140
+
141
+ private def selector_source_literal: (untyped set, untyped selector) -> untyped
142
+
143
+ private def selector_bindings_literal: (untyped parent, untyped child) -> untyped
144
+
145
+ private def selector_value_literal: (untyped set, untyped selector, untyped format_value) -> untyped
146
+
147
+ private def to_datatype: (untyped type, untyped checks, ?owner: untyped) -> untyped
148
+
149
+ private def to_struct_member_datatype: (untyped type) -> untyped
150
+
151
+ private def to_checks: (untyped checks) -> untyped
152
+
153
+ private def to_check: (untyped check) -> untyped
154
+
155
+ private def check_message_value: (untyped check, untyped value) -> untyped
156
+
157
+ private def const_value_literal: (untyped value) -> untyped
158
+
159
+ private def integer_literal: (untyped value) -> untyped
160
+
161
+ private def mcast_group_value_literal: (untyped value) -> untyped
162
+ end
163
+ end
@@ -0,0 +1,165 @@
1
+ # Generated from lib/ynl/models.rb with RBS::Inline
2
+
3
+ module Ynl
4
+ module Models
5
+ Family: untyped
6
+
7
+ class Family
8
+ def resolve: () -> untyped
9
+
10
+ def find_type: (untyped name) -> untyped
11
+ end
12
+
13
+ class Thunk
14
+ def initialize: () ?{ (?) -> untyped } -> untyped
15
+
16
+ def resolve: (untyped f) -> untyped
17
+ end
18
+
19
+ Const: untyped
20
+
21
+ Check: untyped
22
+
23
+ class SubMessage
24
+ Format: untyped
25
+
26
+ attr_reader name: untyped
27
+
28
+ attr_reader formats: untyped
29
+
30
+ def initialize: (name: untyped) -> untyped
31
+
32
+ def resolve: (untyped f) -> untyped
33
+ end
34
+
35
+ class Enum
36
+ Entry: untyped
37
+
38
+ attr_reader name: untyped
39
+
40
+ attr_reader entries: untyped
41
+
42
+ attr_reader doc: untyped
43
+
44
+ def initialize: (name: untyped, doc: untyped) -> untyped
45
+
46
+ def resolve: (untyped f) -> untyped
47
+ end
48
+
49
+ class Flags
50
+ Entry: untyped
51
+
52
+ attr_reader name: untyped
53
+
54
+ attr_reader entries: untyped
55
+
56
+ attr_reader doc: untyped
57
+
58
+ def initialize: (name: untyped, doc: untyped) -> untyped
59
+
60
+ def resolve: (untyped f) -> untyped
61
+ end
62
+
63
+ class Struct
64
+ Member: untyped
65
+
66
+ attr_reader name: untyped
67
+
68
+ attr_reader members: untyped
69
+
70
+ attr_reader doc: untyped
71
+
72
+ def initialize: (name: untyped, doc: untyped) -> untyped
73
+
74
+ def resolve: (untyped f) -> untyped
75
+ end
76
+
77
+ class AttributeSet
78
+ Attribute: untyped
79
+
80
+ attr_reader name: untyped
81
+
82
+ attr_reader name_prefix: untyped
83
+
84
+ attr_reader attributes: untyped
85
+
86
+ attr_reader doc: untyped
87
+
88
+ def initialize: (name: untyped, name_prefix: untyped, doc: untyped) -> untyped
89
+
90
+ def resolve: (untyped f) -> untyped
91
+ end
92
+
93
+ class AttributeSubset
94
+ attr_reader name: untyped
95
+
96
+ attr_reader superset: untyped
97
+
98
+ attr_reader doc: untyped
99
+
100
+ def initialize: (name: untyped, superset: untyped, attributes: untyped, doc: untyped) -> untyped
101
+
102
+ def attributes: () -> untyped
103
+
104
+ def resolve: (untyped f) -> untyped
105
+ end
106
+
107
+ McastGroup: untyped
108
+
109
+ class Operation
110
+ attr_reader name: untyped
111
+
112
+ attr_reader doc: untyped
113
+
114
+ attr_reader flags: untyped
115
+
116
+ attr_reader fixed_header: untyped
117
+
118
+ attr_reader attribute_set: untyped
119
+
120
+ attr_reader doit: untyped
121
+
122
+ attr_reader dumpit: untyped
123
+
124
+ attr_reader notification: untyped
125
+
126
+ def initialize: (name: untyped, doc: untyped, flags: untyped, fixed_header: untyped, attribute_set: untyped, doit: untyped, dumpit: untyped, notification: untyped) -> untyped
127
+
128
+ def resolve: (untyped f) -> untyped
129
+ end
130
+
131
+ class Notification
132
+ attr_reader kind: untyped
133
+
134
+ attr_reader message: untyped
135
+
136
+ attr_reader source: untyped
137
+
138
+ attr_reader group: untyped
139
+
140
+ def initialize: (kind: untyped, message: untyped, source: untyped, group: untyped) -> untyped
141
+
142
+ def resolve: (untyped f) -> untyped
143
+ end
144
+
145
+ class RequestReply
146
+ attr_reader request: untyped
147
+
148
+ attr_reader reply: untyped
149
+
150
+ def initialize: (request: untyped, reply: untyped) -> untyped
151
+
152
+ def resolve: (untyped f) -> untyped
153
+ end
154
+
155
+ class Message
156
+ attr_reader value: untyped
157
+
158
+ attr_reader attributes: untyped
159
+
160
+ def initialize: (value: untyped, attributes: untyped) -> untyped
161
+
162
+ def resolve: (untyped f) -> untyped
163
+ end
164
+ end
165
+ end
@@ -0,0 +1,62 @@
1
+ # Generated from lib/ynl/parser.rb with RBS::Inline
2
+
3
+ module Ynl
4
+ class Parser
5
+ # @param [String, #read] source
6
+ # @rbs (String | _Readable source) -> void
7
+ def initialize: (String | _Readable source) -> void
8
+
9
+ # @param [String, #to_path] path
10
+ # @return [Models::Family]
11
+ # @rbs (String | _PathLike path) -> Models::Family
12
+ def self.parse_file: (String | _PathLike path) -> Models::Family
13
+
14
+ # @return [Models::Family]
15
+ # @rbs () -> Models::Family
16
+ def parse: () -> Models::Family
17
+
18
+ private def parse_definition: (untyped d) -> untyped
19
+
20
+ private def reject_enum_flags_name_collision: (untyped name, untyped other_definitions) -> untyped
21
+
22
+ private def parse_const: (untyped d) -> untyped
23
+
24
+ private def parse_enum_flags: (untyped d, type: untyped) -> untyped
25
+
26
+ private def parse_struct_member_type: (untyped d) -> untyped
27
+
28
+ private def parse_attribute_type: (untyped d) -> untyped
29
+
30
+ private def parse_indexed_array_sub_type: (untyped d) -> untyped
31
+
32
+ private def parse_packed_array_sub_type: (untyped d) -> untyped
33
+
34
+ private def parse_byte_order: (untyped v) -> untyped
35
+
36
+ private def parse_struct: (untyped d) -> untyped
37
+
38
+ private def parse_checks: (untyped d) -> untyped
39
+
40
+ private def parse_check: (untyped op, untyped value_literal) -> untyped
41
+
42
+ private def parse_value: (untyped v) -> untyped
43
+
44
+ private def parse_attribute_set: (untyped d) -> untyped
45
+
46
+ private def parse_attribute: (untyped d) -> untyped
47
+
48
+ private def parse_sub_message: (untyped d) -> untyped
49
+
50
+ private def parse_operation: (untyped d, request_id: untyped, reply_id: untyped) -> untyped
51
+
52
+ private def parse_notification: (untyped d, default_id: untyped) -> untyped
53
+
54
+ private def parse_request_reply: (untyped d, default_request_id: untyped, default_reply_id: untyped) -> untyped
55
+
56
+ private def parse_message: (untyped d, default_id: untyped) -> untyped
57
+
58
+ private def parse_mcast_group: (untyped d) -> untyped
59
+
60
+ private def translate_doc: (untyped doc) -> untyped
61
+ end
62
+ end
@@ -0,0 +1,5 @@
1
+ # Generated from lib/ynl/version.rb with RBS::Inline
2
+
3
+ module Ynl
4
+ VERSION: ::String
5
+ end
@@ -0,0 +1,119 @@
1
+ # Generated from lib/ynl.rb with RBS::Inline
2
+
3
+ # Ynl parser and code generator. See {Family} for library entrypoint.
4
+ module Ynl
5
+ interface _Readable
6
+ def read: () -> String
7
+ end
8
+
9
+ interface _Writable
10
+ def write: (*String strings) -> untyped
11
+ end
12
+
13
+ interface _PathLike
14
+ def to_path: () -> String
15
+ end
16
+
17
+ class ParseError < StandardError
18
+ end
19
+
20
+ # @private
21
+ module Types
22
+ class Scalar < Data
23
+ attr_reader type(): untyped
24
+
25
+ attr_reader byte_order(): untyped
26
+
27
+ def self.new: (untyped type, untyped byte_order) -> instance
28
+ | (type: untyped, byte_order: untyped) -> instance
29
+
30
+ def self.members: () -> [ :type, :byte_order ]
31
+
32
+ def members: () -> [ :type, :byte_order ]
33
+ end
34
+
35
+ class String < Struct[]
36
+ def self.new: () -> instance
37
+ | () -> instance
38
+ end
39
+
40
+ class Binary < Struct[untyped]
41
+ attr_accessor struct(): untyped
42
+
43
+ attr_accessor length(): untyped
44
+
45
+ attr_accessor display_hint(): untyped
46
+
47
+ def self.new: (?untyped struct, ?untyped length, ?untyped display_hint) -> instance
48
+ | (?struct: untyped, ?length: untyped, ?display_hint: untyped) -> instance
49
+ end
50
+
51
+ class PackedArray < Struct[untyped]
52
+ attr_accessor sub_type(): untyped
53
+
54
+ def self.new: (?untyped sub_type) -> instance
55
+ | (?sub_type: untyped) -> instance
56
+ end
57
+
58
+ class NestedAttributes < Struct[untyped]
59
+ attr_accessor attribute_set(): untyped
60
+
61
+ def self.new: (?untyped attribute_set) -> instance
62
+ | (?attribute_set: untyped) -> instance
63
+ end
64
+
65
+ class NestTypeValue < Struct[untyped]
66
+ attr_accessor attribute_set(): untyped
67
+
68
+ attr_accessor type_values(): untyped
69
+
70
+ def self.new: (?untyped attribute_set, ?untyped type_values) -> instance
71
+ | (?attribute_set: untyped, ?type_values: untyped) -> instance
72
+ end
73
+
74
+ class SubMessage < Struct[untyped]
75
+ attr_accessor sub_message(): untyped
76
+
77
+ attr_accessor selector(): untyped
78
+
79
+ def self.new: (?untyped sub_message, ?untyped selector) -> instance
80
+ | (?sub_message: untyped, ?selector: untyped) -> instance
81
+ end
82
+
83
+ class Pad < Data
84
+ attr_reader length(): untyped
85
+
86
+ def self.new: (untyped length) -> instance
87
+ | (length: untyped) -> instance
88
+
89
+ def self.members: () -> [ :length ]
90
+
91
+ def members: () -> [ :length ]
92
+ end
93
+
94
+ class Flag < Data
95
+ def self.new: () -> instance
96
+ | () -> instance
97
+
98
+ def self.members: () -> [ ]
99
+
100
+ def members: () -> [ ]
101
+ end
102
+
103
+ class Bitfield32 < Data
104
+ def self.new: () -> instance
105
+ | () -> instance
106
+
107
+ def self.members: () -> [ ]
108
+
109
+ def members: () -> [ ]
110
+ end
111
+
112
+ class IndexedArray < Struct[untyped]
113
+ attr_accessor sub_type(): untyped
114
+
115
+ def self.new: (?untyped sub_type) -> instance
116
+ | (?sub_type: untyped) -> instance
117
+ end
118
+ end
119
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ynl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasumi Hanazuki
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.4
18
+ version: 0.4.1
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.2.4
25
+ version: 0.4.1
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: yaml
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -37,7 +37,8 @@ dependencies:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
- description: Linux Netlink
40
+ description: ynl parses YAML Netlink specifications (YNL) and generates Netlink clients
41
+ for the interfaces they describe.
41
42
  email:
42
43
  - kasumi@rollingapple.net
43
44
  executables: []
@@ -55,6 +56,12 @@ files:
55
56
  - lib/ynl/models.rb
56
57
  - lib/ynl/parser.rb
57
58
  - lib/ynl/version.rb
59
+ - sig/generated/ynl.rbs
60
+ - sig/generated/ynl/family.rbs
61
+ - sig/generated/ynl/generator.rbs
62
+ - sig/generated/ynl/models.rbs
63
+ - sig/generated/ynl/parser.rbs
64
+ - sig/generated/ynl/version.rbs
58
65
  - test.rb
59
66
  homepage: https://github.com/hanazuki/nl
60
67
  licenses:
@@ -70,14 +77,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
77
  requirements:
71
78
  - - ">="
72
79
  - !ruby/object:Gem::Version
73
- version: '3.1'
80
+ version: '3.4'
74
81
  required_rubygems_version: !ruby/object:Gem::Requirement
75
82
  requirements:
76
83
  - - ">="
77
84
  - !ruby/object:Gem::Version
78
85
  version: '0'
79
86
  requirements: []
80
- rubygems_version: 4.0.6
87
+ rubygems_version: 4.0.16
81
88
  specification_version: 4
82
- summary: Linux Netlink - core
89
+ summary: YAML Netlink specification tools for Ruby
83
90
  test_files: []