raap 0.1.0

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.
data/sig/raap.rbs ADDED
@@ -0,0 +1,313 @@
1
+ module RaaP
2
+ type symbolic_call = [:call, untyped, Symbol, Array[untyped], Hash[Symbol, untyped], Proc?]
3
+ VERSION: String
4
+
5
+ def self.logger: () -> ::Logger
6
+ def self.logger=: (::Logger) -> void
7
+
8
+ module BindCall
9
+ def self.define_singleton_method: (untyped, Symbol) { (*untyped, **untyped) -> untyped } -> void
10
+ def self.respond_to?: (untyped, Symbol, ?bool) -> bool
11
+ def self.instance_of?: (untyped, Module) -> bool
12
+ def self.is_a?: (untyped, Module) -> bool
13
+ def self.extend: (untyped, Module) -> void
14
+ def self.name: (Module) -> String?
15
+ def self.to_s: (untyped) -> String
16
+ def self.class: (untyped) -> untyped
17
+ def self.inspect: (untyped) -> String
18
+ end
19
+
20
+ class CLI
21
+ class Option < ::Struct[untyped]
22
+ def self.new: (?dirs: ::Array[String], ?requires: ::Array[String], ?libraries: ::Array[String], ?timeout: (Integer | Float | nil), ?size_from: ::Integer, ?size_to: ::Integer, ?size_by: ::Integer) -> instance
23
+
24
+ def self.[]: (?dirs: ::Array[String], ?requires: ::Array[String], ?libraries: ::Array[String], ?timeout: (Integer | Float | nil), ?size_from: ::Integer, ?size_to: ::Integer, ?size_by: ::Integer) -> instance
25
+
26
+ def self.keyword_init?: () -> true
27
+
28
+ def self.members: () -> [ :dirs, :requires, :library, :timeout, :size_from, :size_to, :size_by]
29
+
30
+ def members: () -> [ :dirs, :requires, :library, :timeout, :size_from, :size_to, :size_by]
31
+
32
+ attr_accessor dirs: ::Array[String]
33
+
34
+ attr_accessor requires: ::Array[String]
35
+
36
+ attr_accessor libraries: ::Array[String]
37
+
38
+ attr_accessor timeout: (Integer | Float | nil)
39
+
40
+ attr_accessor size_from: ::Integer
41
+
42
+ attr_accessor size_to: ::Integer
43
+
44
+ attr_accessor size_by: ::Integer
45
+ end
46
+
47
+ @argv: Array[String]
48
+
49
+ def self.option: () -> Option
50
+ def self.option=: (Option) -> void
51
+
52
+ def initialize: (Array[String]) -> void
53
+ def load: () -> self
54
+
55
+ type property_result = [Integer, Symbol, ::RBS::MethodType]
56
+ def run: () -> self
57
+ def run_by: (tag: String) -> Array[Array[property_result]]
58
+ def run_by_instance: (tag: String) -> Array[Array[property_result]]
59
+ def run_by_singleton: (tag: String) -> Array[Array[property_result]]
60
+ def run_by_type_name: (tag: String) -> Array[Array[property_result]]
61
+ def run_by_type_name_with_search: (tag: String) -> Array[Array[property_result]]
62
+ def property: (receiver_type: Type, type_params_decl: Array[::RBS::AST::TypeParam], method_name: Symbol, method_type: ::RBS::MethodType) -> property_result
63
+ end
64
+
65
+ class FunctionType
66
+ @fun: ::RBS::Types::Function
67
+
68
+ def initialize: (::RBS::Types::Function) -> void
69
+ def pick_arguments: (?size: Integer, ?eval: bool) -> [Array[untyped], Hash[Symbol, untyped]]
70
+
71
+ private
72
+
73
+ def recursive_pick: (untyped, size: Integer, eval: bool) -> untyped
74
+ def build_args_type: () -> Array[Type]
75
+ def build_kwargs_type: () -> Hash[Symbol, Type]
76
+ end
77
+
78
+ class MethodProperty
79
+ class Stats
80
+ attr_accessor success: Integer
81
+ attr_accessor skip: Integer
82
+ attr_accessor exception: Integer
83
+ end
84
+ attr_reader receiver_type: Type
85
+ attr_reader method_name: Symbol
86
+ attr_reader method_type: MethodType
87
+ attr_reader size_step: _Each[Integer]
88
+ attr_reader timeout: (Integer | Float | nil)
89
+ def initialize: (receiver_type: Type, method_name: Symbol, method_type: MethodType, size_step: _Each[Integer], timeout: (Integer | Float | nil)) -> void
90
+ def run: () { (Result::Success | Result::Failure | Result::Skip | Result::Exception) -> void } -> Stats
91
+
92
+ private
93
+
94
+ def call: (size: Integer, stats: Stats) -> (Result::Success | Result::Failure | Result::Skip | Result::Exception)
95
+ def check_return: (receiver_value: untyped, return_value: untyped, method_type: MethodType) -> bool
96
+ def return_type: () -> RBS::Types::t
97
+ end
98
+
99
+ class MethodType
100
+ attr_reader rbs: ::RBS::MethodType
101
+ @fun_type: FunctionType
102
+
103
+ def initialize: (::RBS::MethodType | String method, ?type_params_decl: Array[untyped], ?type_args: Array[untyped], ?self_type: ::RBS::Types::ClassInstance?, ?instance_type: ::RBS::Types::ClassInstance?, ?class_type: ::RBS::Types::ClassSingleton?) -> void
104
+ def pick_arguments: (?size: Integer, ?eval: bool) -> [Array[untyped], Hash[Symbol, untyped], ::Proc?]
105
+ def pick_block: (?size: Integer, ?eval: bool) -> ::Proc?
106
+ end
107
+
108
+ class MethodValue < Data
109
+ def self.new: (untyped receiver_value, [Array[untyped], Hash[Symbol, untyped], ::Proc?] arguments, Symbol method_name, Integer size) -> instance
110
+ | (receiver_value: untyped, arguments: [Array[untyped], Hash[Symbol, untyped], ::Proc?], method_name: Symbol, size: Integer) -> instance
111
+
112
+ def self.[]: (untyped receiver_value, [Array[untyped], Hash[Symbol, untyped], ::Proc?] arguments, Symbol method_name, Integer size) -> instance
113
+ | (receiver_value: untyped, arguments: [Array[untyped], Hash[Symbol, untyped], ::Proc?], method_name: Symbol, size: Integer) -> instance
114
+
115
+ def self.members: () -> [ :receiver_value, :arguments, :method_name, :size ]
116
+ def members: () -> [ :receiver_value, :arguments, :method_name, :size ]
117
+
118
+ attr_reader receiver_value: untyped
119
+ attr_reader arguments: [Array[untyped], Hash[Symbol, untyped], ::Proc?]
120
+ attr_reader method_name: Symbol
121
+ attr_reader size: Integer
122
+
123
+ def to_symbolic_call: () -> symbolic_call
124
+ def call_str: () -> String
125
+
126
+ private
127
+
128
+ def argument_str: () -> String
129
+ def block_str: () -> String?
130
+ end
131
+
132
+ module RBS
133
+ def self.builder: () -> ::RBS::DefinitionBuilder
134
+ def self.env: () -> ::RBS::Environment
135
+ def self.loader: () -> ::RBS::EnvironmentLoader
136
+ def self.parse_type: (String) -> ::RBS::Types::t
137
+ end
138
+
139
+ module Result
140
+ interface _MethodValueReturnValue
141
+ def method_value: () -> MethodValue
142
+ def return_value: () -> untyped
143
+ end
144
+ module CalledStr : _MethodValueReturnValue
145
+ def called_str: () -> String
146
+ end
147
+ class Success < Data
148
+ def self.new: (method_value: MethodValue, return_value: untyped) -> instance
149
+ attr_reader method_value: MethodValue
150
+ attr_reader return_value: untyped
151
+ include CalledStr
152
+ end
153
+ class Failure < Data
154
+ def self.new: (method_value: MethodValue, return_value: untyped, symbolic_call: symbolic_call) -> instance
155
+ attr_reader method_value: MethodValue
156
+ attr_reader return_value: untyped
157
+ attr_reader symbolic_call: symbolic_call
158
+ include CalledStr
159
+ end
160
+ class Skip < Data
161
+ def self.new: (method_value: MethodValue?, exception: ::Exception) -> instance
162
+ attr_reader method_value: MethodValue?
163
+ attr_reader exception: ::Exception
164
+ end
165
+ class Exception < Data
166
+ def self.new: (method_value: MethodValue?, exception: ::Exception) -> instance
167
+ attr_reader method_value: MethodValue?
168
+ attr_reader exception: ::Exception
169
+ end
170
+ end
171
+
172
+ interface _Pick[T]
173
+ def pick: (size: Integer) -> T
174
+ end
175
+
176
+ class Sized
177
+ @block: ::Proc
178
+ @such_that: ::Proc?
179
+
180
+ def initialize: () { (Integer) -> untyped } -> void
181
+ include _Pick[untyped]
182
+ def such_that: () { (untyped) -> boolish } -> self
183
+ def such_that_loop: [R] () { (Integer) -> R } -> R
184
+ end
185
+
186
+ class SymbolicCaller
187
+ attr_reader symbolic_call: untyped
188
+ def initialize: (untyped) -> void
189
+ def eval: () -> untyped
190
+ def walk: () ?{ (symbolic_call) -> untyped} -> untyped
191
+ def to_lines: () -> Array[String]
192
+
193
+ private
194
+
195
+ def _walk: (untyped) ?{ (symbolic_call) -> untyped} -> untyped
196
+ def eval_one: (symbolic_call) -> untyped
197
+ def var_name: (Module) -> String
198
+ def printable?: (untyped) -> bool
199
+ def printable: (untyped) -> String
200
+ end
201
+
202
+ class TypeSubstitution
203
+ @type_params: ::Array[::RBS::AST::TypeParam]
204
+ @type_args: ::Array[::RBS::Types::t]
205
+
206
+ def initialize: (::Array[::RBS::AST::TypeParam], ::Array[::RBS::Types::t]) -> void
207
+ def build: () -> ::RBS::Substitution
208
+ def method_type_sub: (::RBS::MethodType, ?self_type: ::RBS::Types::ClassInstance?, ?instance_type: ::RBS::Types::ClassInstance?, ?class_type: ::RBS::Types::ClassSingleton?) -> ::RBS::MethodType
209
+
210
+ private
211
+
212
+ interface _MapType
213
+ def map_type: { (untyped) -> untyped } -> untyped
214
+ end
215
+
216
+ def sub: (_MapType search, self_type: ::RBS::Types::ClassInstance?, instance_type: ::RBS::Types::ClassInstance?, ?class_type: ::RBS::Types::ClassSingleton?) -> untyped
217
+ end
218
+
219
+ class Type
220
+ module Arithmetic
221
+ def self.float: () -> Float
222
+ def self.positive_float: () -> Float
223
+ end
224
+
225
+ GENERATORS: Hash[String, ^() -> _Pick[untyped] | Proc]
226
+ SIMPLE_SOURCE: Array[String]
227
+ RECURSION: Hash[String, :found | :logged]
228
+
229
+ def self.register: (String) { () [self: instance] -> _Pick[untyped] } -> void
230
+ attr_reader type: ::RBS::Types::t
231
+ attr_reader range: Range[untyped]
232
+
233
+ def initialize: (String | ::RBS::Types::t, ?range: Range[untyped]) -> void
234
+
235
+ include _Pick[untyped]
236
+ def pick: (?size: Integer, ?eval: bool) -> untyped | ...
237
+ def to_symbolic_call: (?size: Integer) -> untyped
238
+ def pick_from_initialize: (::RBS::Types::ClassInstance, size: Integer) -> untyped
239
+ def sized: () { (Integer size) -> untyped } -> _Pick[untyped]
240
+
241
+ private
242
+
243
+ def parse: (String | ::RBS::Types::t) -> ::RBS::Types::t?
244
+ def try: (times: Integer, size: Integer) { (Integer size) -> untyped } -> untyped
245
+
246
+ def numeric: () -> _Pick[Numeric]
247
+ def integer: () -> _Pick[Integer]
248
+ def none_zero_integer: () -> _Pick[Integer]
249
+ def float: () -> _Pick[Float]
250
+ def rational: () -> _Pick[Rational]
251
+ def complex: () -> _Pick[Complex]
252
+ def string: () -> _Pick[String]
253
+ def symbol: () -> _Pick[Symbol]
254
+ def array: (Type) -> _Pick[Array[untyped]]
255
+ def encoding: () -> _Pick[Encoding]
256
+ def bool: () -> _Pick[bool]
257
+ def untyped: () -> _Pick[untyped]
258
+ def temp_method_object: () -> ::Method
259
+ end
260
+
261
+ module Value
262
+ class Bottom < BasicObject
263
+ def inspect: () -> String
264
+ def class: () -> class
265
+ end
266
+
267
+ class Interface < BasicObject
268
+ @type: ::RBS::Types::Interface
269
+ @size: Integer
270
+ @definition: ::RBS::Definition
271
+
272
+ def initialize: (String | ::RBS::Types::Interface, ?size: Integer) -> void
273
+ def inspect: () -> String
274
+ def class: () -> class
275
+ end
276
+
277
+ class Intersection < BasicObject
278
+ @type: ::RBS::Types::Intersection
279
+ @children: Array[Type]
280
+ @size: Integer
281
+
282
+ def initialize: (::RBS::Types::Intersection, size: Integer) -> void
283
+ def inspect: () -> String
284
+ def class: () -> class
285
+ end
286
+
287
+ class Module < BasicObject
288
+ attr_reader type: ::RBS::Types::ClassInstance
289
+
290
+ def initialize: (::RBS::Types::ClassInstance) -> void
291
+ def inspect: () -> String
292
+ def class: () -> class
293
+ end
294
+
295
+ class Top < BasicObject
296
+ def inspect: () -> String
297
+ def class: () -> class
298
+ end
299
+
300
+ class Variable < BasicObject
301
+ attr_reader type: ::RBS::Types::Variable
302
+
303
+ def initialize: (::RBS::Types::Variable) -> void
304
+ def inspect: () -> String
305
+ def class: () -> class
306
+ end
307
+
308
+ class Void < BasicObject
309
+ def inspect: () -> String
310
+ def class: () -> class
311
+ end
312
+ end
313
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: raap
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - ksss
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-03-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rbs
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: timeout
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Property based testing tool with RBS
42
+ email:
43
+ - co000ri@gmail.com
44
+ executables:
45
+ - raap
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - CHANGELOG.md
50
+ - CODE_OF_CONDUCT.md
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - Steepfile
55
+ - exe/raap
56
+ - lib/raap.rb
57
+ - lib/raap/bind_call.rb
58
+ - lib/raap/cli.rb
59
+ - lib/raap/function_type.rb
60
+ - lib/raap/method_property.rb
61
+ - lib/raap/method_type.rb
62
+ - lib/raap/method_value.rb
63
+ - lib/raap/rbs.rb
64
+ - lib/raap/result.rb
65
+ - lib/raap/sized.rb
66
+ - lib/raap/symbolic_caller.rb
67
+ - lib/raap/type.rb
68
+ - lib/raap/type_substitution.rb
69
+ - lib/raap/value.rb
70
+ - lib/raap/value/bottom.rb
71
+ - lib/raap/value/interface.rb
72
+ - lib/raap/value/intersection.rb
73
+ - lib/raap/value/module.rb
74
+ - lib/raap/value/top.rb
75
+ - lib/raap/value/variable.rb
76
+ - lib/raap/value/void.rb
77
+ - lib/raap/version.rb
78
+ - rbs_collection.lock.yaml
79
+ - rbs_collection.yaml
80
+ - sig/raap.rbs
81
+ homepage: https://github.com/ksss/raap
82
+ licenses:
83
+ - MIT
84
+ metadata:
85
+ homepage_uri: https://github.com/ksss/raap
86
+ source_code_uri: https://github.com/ksss/raap
87
+ changelog_uri: https://github.com/ksss/raap
88
+ post_install_message:
89
+ rdoc_options: []
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 3.3.0
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ requirements: []
103
+ rubygems_version: 3.5.3
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: RBS as a Property
107
+ test_files: []