raap 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/sig/raap.rbs CHANGED
@@ -7,7 +7,7 @@ module RaaP
7
7
 
8
8
  module BindCall
9
9
  def self.define_singleton_method: (untyped, Symbol) { (*untyped, **untyped) -> untyped } -> void
10
- def self.respond_to?: (untyped, Symbol, ?bool) -> bool
10
+ def self.respond_to?: (untyped, untyped, ?boolish) -> bool
11
11
  def self.instance_of?: (untyped, Module) -> bool
12
12
  def self.is_a?: (untyped, Module) -> bool
13
13
  def self.extend: (untyped, Module) -> void
@@ -19,15 +19,15 @@ module RaaP
19
19
 
20
20
  class CLI
21
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, ?allow_private: bool) -> instance
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, ?allow_private: bool, ?skips: ::Array[::String]) -> instance
23
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, ?allow_private: bool) -> instance
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, ?allow_private: bool, ?skips: ::Array[::String]) -> instance
25
25
 
26
26
  def self.keyword_init?: () -> true
27
27
 
28
- def self.members: () -> [ :dirs, :requires, :library, :timeout, :size_from, :size_to, :size_by, :allow_private]
28
+ def self.members: () -> [ :dirs, :requires, :library, :timeout, :size_from, :size_to, :size_by, :allow_private, :skips]
29
29
 
30
- def members: () -> [ :dirs, :requires, :library, :timeout, :size_from, :size_to, :size_by, :allow_private]
30
+ def members: () -> [ :dirs, :requires, :library, :timeout, :size_from, :size_to, :size_by, :allow_private, :skips]
31
31
 
32
32
  attr_accessor dirs: ::Array[String]
33
33
 
@@ -44,35 +44,43 @@ module RaaP
44
44
  attr_accessor size_by: ::Integer
45
45
 
46
46
  attr_accessor allow_private: bool
47
+
48
+ attr_accessor skips: ::Array[String]
47
49
  end
48
50
 
51
+ type property_result = [Integer, Symbol, ::RBS::MethodType, StringIO?]
52
+
53
+ DEFAULT_SKIP: ::Set[String]
54
+
49
55
  @argv: Array[String]
56
+ @results: Array[{ method: ::RBS::Definition::Method, properties: Array[property_result] }]
50
57
 
51
58
  def self.option: () -> Option
52
59
  def self.option=: (Option) -> void
53
60
 
54
61
  def initialize: (Array[String]) -> void
55
62
  def load: () -> self
63
+ def run: () -> Integer
56
64
 
57
- type property_result = [Integer, Symbol, ::RBS::MethodType]
58
- def run: () -> self
59
- def run_by: (tag: String) -> Array[Array[property_result]]
60
- def run_by_instance: (tag: String) -> Array[Array[property_result]]
61
- def run_by_singleton: (tag: String) -> Array[Array[property_result]]
62
- def run_by_type_name: (tag: String) -> Array[Array[property_result]]
63
- def run_by_type_name_with_search: (tag: String) -> Array[Array[property_result]]
64
- def property: (receiver_type: Type, type_params_decl: Array[::RBS::AST::TypeParam], method_name: Symbol, method_type: ::RBS::MethodType) -> property_result
65
+ private
66
+
67
+ def run_by: (kind: (:instance | :singleton), tag: String) -> void
68
+ def run_by_type_name: (tag: String) -> void
69
+ def run_by_type_name_with_search: (tag: String) -> void
70
+ def property: (receiver_type: Type, type_params_decl: Array[::RBS::AST::TypeParam], type_args: Array[::RBS::Types::t], method_name: Symbol, method_type: ::RBS::MethodType) -> property_result
71
+ def report: () -> Integer
65
72
  end
66
73
 
67
74
  class FunctionType
68
75
  @fun: ::RBS::Types::Function
69
76
 
70
77
  def initialize: (::RBS::Types::Function) -> void
71
- def pick_arguments: (?size: Integer, ?eval: bool) -> [Array[untyped], Hash[Symbol, untyped]]
78
+ def pick_arguments: (?size: Integer) -> [Array[untyped], Hash[Symbol, untyped]]
79
+ def arguments_to_symbolic_call: (?size: Integer) -> [Array[untyped], Hash[Symbol, untyped]]
72
80
 
73
81
  private
74
82
 
75
- def recursive_pick: (untyped, size: Integer, eval: bool) -> untyped
83
+ def to_symbolic_call_recursive: (untyped, size: Integer) -> untyped
76
84
  def build_args_type: () -> Array[Type]
77
85
  def build_kwargs_type: () -> Hash[Symbol, Type]
78
86
  end
@@ -82,6 +90,7 @@ module RaaP
82
90
  attr_accessor success: Integer
83
91
  attr_accessor skip: Integer
84
92
  attr_accessor exception: Integer
93
+ attr_accessor break: bool
85
94
  end
86
95
 
87
96
  @receiver_type: Type
@@ -97,7 +106,7 @@ module RaaP
97
106
  private
98
107
 
99
108
  def call: (size: Integer, stats: Stats) -> (Result::Success | Result::Failure | Result::Skip | Result::Exception)
100
- def check_return: (receiver_value: untyped, return_value: untyped, method_type: MethodType) -> bool
109
+ def check_return: (receiver_value: untyped, return_value: untyped) -> ([Symbol] | [Symbol, Exception])
101
110
  def return_type: () -> RBS::Types::t
102
111
  end
103
112
 
@@ -106,8 +115,9 @@ module RaaP
106
115
  @fun_type: FunctionType
107
116
 
108
117
  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
109
- def pick_arguments: (?size: Integer, ?eval: bool) -> [Array[untyped], Hash[Symbol, untyped], ::Proc?]
110
- def pick_block: (?size: Integer, ?eval: bool) -> ::Proc?
118
+ def pick_arguments: (?size: Integer) -> [Array[untyped], Hash[Symbol, untyped], ::Proc?]
119
+ def arguments_to_symbolic_call: (?size: Integer) -> [Array[untyped], Hash[Symbol, untyped], ::Proc?]
120
+ def pick_block: (?size: Integer) -> ::Proc?
111
121
  def check_return: (untyped) -> bool
112
122
  end
113
123
 
@@ -123,28 +133,37 @@ module RaaP
123
133
  def self.env: () -> ::RBS::Environment
124
134
  def self.loader: () -> ::RBS::EnvironmentLoader
125
135
  def self.parse_type: (String) -> ::RBS::Types::t
136
+ def self.parse_method_type: (String) -> ::RBS::MethodType
137
+ def self.find_alias_decl: (::RBS::TypeName, Symbol) -> ::RBS::AST::Members::Alias?
126
138
  end
127
139
 
128
140
  module Result
129
- interface _MethodValueReturnValue
130
- def symbolic_call: () -> symbolic_call
141
+ interface _ReturnValue
131
142
  def return_value: () -> untyped
132
143
  end
133
- module CalledStr : _MethodValueReturnValue
134
- def called_str: () -> String
144
+
145
+ module ReturnValueWithType : _ReturnValue
146
+ def return_value_with_type: () -> String
147
+
148
+ private
149
+
150
+ def return_value_to_type: (untyped) -> String
135
151
  end
152
+
136
153
  class Success < Data
154
+ include ReturnValueWithType
137
155
  def self.new: (symbolic_call: symbolic_call, return_value: untyped) -> instance
138
156
  attr_reader symbolic_call: symbolic_call
139
157
  attr_reader return_value: untyped
140
- include CalledStr
158
+ def called_str: () -> String
141
159
  end
142
160
  class Failure < Data
161
+ include ReturnValueWithType
143
162
  def self.new: (symbolic_call: symbolic_call, return_value: untyped, ?exception: ::Exception?) -> instance
144
163
  attr_reader symbolic_call: symbolic_call
145
164
  attr_reader return_value: untyped
146
165
  attr_reader exception: ::Exception?
147
- include CalledStr
166
+ def called_str: () -> String
148
167
  end
149
168
  class Skip < Data
150
169
  def self.new: (symbolic_call: symbolic_call?, exception: ::Exception) -> instance
@@ -188,7 +207,7 @@ module RaaP
188
207
 
189
208
  def try_eval: (untyped) -> untyped
190
209
  def walk: () ?{ (symbolic_call) -> untyped} -> untyped
191
- def _walk: (untyped) ?{ (symbolic_call) -> untyped} -> untyped
210
+ def _walk: (untyped, bool is_last) ?{ (symbolic_call) -> untyped} -> untyped
192
211
  def eval_one: (symbolic_call) -> untyped
193
212
  def var_name: (Module) -> String
194
213
  def printable?: (untyped) -> bool
@@ -222,9 +241,11 @@ module RaaP
222
241
 
223
242
  GENERATORS: Hash[String, ^() -> Sized[untyped]]
224
243
  SIMPLE_SOURCE: Array[String]
225
- RECURSION: Hash[String, :found | :logged]
226
244
 
227
245
  def self.register: (String) { () [self: instance] -> Sized[untyped] } -> void
246
+ def self.random: () -> Type
247
+ def self.random_without_basic_object: () -> Type
248
+
228
249
  attr_reader type: ::RBS::Types::t
229
250
  attr_reader range: Range[untyped]
230
251
 
@@ -235,13 +256,14 @@ module RaaP
235
256
  def such_that: () { (untyped) -> boolish } -> self
236
257
 
237
258
  # Basic API for materializing values
238
- def pick: (?size: Integer, ?eval: bool) -> untyped
259
+ def pick: (?size: Integer) -> untyped
260
+ def to_symbolic_caller: (?size: Integer) -> SymbolicCaller
239
261
  def to_symbolic_call: (?size: Integer) -> untyped
240
262
  def sized: [T] () { (Integer size) -> T } -> Sized[T]
241
263
 
242
264
  private
243
265
 
244
- def pick_from_initialize: (::RBS::Types::ClassInstance, size: Integer) -> (symbolic_call | Value::Module)
266
+ def to_symbolic_call_from_initialize: (::RBS::Types::ClassInstance, size: Integer) -> (symbolic_call | Value::Module)
245
267
  def parse: (String | ::RBS::Types::t) -> ::RBS::Types::t?
246
268
  def try: (times: Integer, size: Integer) { (Integer size) -> untyped } -> untyped
247
269
 
@@ -254,9 +276,9 @@ module RaaP
254
276
  def string: () -> Sized[String]
255
277
  def symbol: () -> Sized[Symbol]
256
278
  def array: (Type) -> Sized[Array[untyped]]
279
+ def dict: (Type, Type) -> Sized[Hash[untyped, untyped]]
257
280
  def encoding: () -> Sized[symbolic_call]
258
281
  def bool: () -> Sized[bool]
259
- def untyped: () -> Sized[untyped]
260
282
  def temp_method_object: () -> ::Method
261
283
  end
262
284
 
@@ -270,8 +292,11 @@ module RaaP
270
292
  @type: ::RBS::Types::Interface
271
293
  @size: Integer
272
294
  @definition: ::RBS::Definition
295
+ @fixed_return_value: untyped
296
+ @fixed_block_arguments: Array[untyped]
273
297
 
274
- def initialize: (String | ::RBS::Types::Interface, ?size: Integer) -> void
298
+ def initialize: (String | ::RBS::Types::Interface | String, ?size: Integer) -> void
299
+ def respond_to?: (Symbol, ?boolish) -> bool
275
300
  def inspect: () -> String
276
301
  def class: () -> class
277
302
  end
@@ -281,15 +306,19 @@ module RaaP
281
306
  @children: Array[Type]
282
307
  @size: Integer
283
308
 
284
- def initialize: (::RBS::Types::Intersection, size: Integer) -> void
309
+ def initialize: (::RBS::Types::Intersection | String, ?size: Integer) -> void
310
+ def respond_to?: (Symbol, ?boolish) -> bool
285
311
  def inspect: () -> String
286
312
  def class: () -> class
287
313
  end
288
314
 
289
- class Module
290
- attr_reader type: ::RBS::Types::ClassInstance
315
+ class Module < BasicObject
316
+ @type: ::RBS::Types::ClassInstance
317
+ @size: Integer
318
+ @self_type: untyped
291
319
 
292
- def initialize: (::RBS::Types::ClassInstance) -> void
320
+ def initialize: (::RBS::Types::ClassInstance | String, ?size: Integer) -> void
321
+ def respond_to?: (Symbol, ?boolish) -> bool
293
322
  def inspect: () -> String
294
323
  def class: () -> class
295
324
  end
@@ -302,7 +331,7 @@ module RaaP
302
331
  class Variable < BasicObject
303
332
  attr_reader type: ::RBS::Types::Variable
304
333
 
305
- def initialize: (::RBS::Types::Variable) -> void
334
+ def initialize: (::RBS::Types::Variable | String | Symbol) -> void
306
335
  def inspect: () -> String
307
336
  def class: () -> class
308
337
  end
data/sig/shims.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Timeout
2
+ class ExitException < Exception
3
+ end
4
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ksss
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-28 00:00:00.000000000 Z
11
+ date: 2024-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbs
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: timeout
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '0.4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '0.4'
41
41
  description: Property based testing tool with RBS
42
42
  email:
43
43
  - co000ri@gmail.com
@@ -46,6 +46,7 @@ executables:
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
+ - ".rubocop.yml"
49
50
  - CHANGELOG.md
50
51
  - CODE_OF_CONDUCT.md
51
52
  - LICENSE.txt
@@ -75,16 +76,16 @@ files:
75
76
  - lib/raap/value/variable.rb
76
77
  - lib/raap/value/void.rb
77
78
  - lib/raap/version.rb
79
+ - public/jacket.webp
78
80
  - rbs_collection.lock.yaml
79
81
  - rbs_collection.yaml
80
82
  - sig/raap.rbs
83
+ - sig/shims.rbs
81
84
  homepage: https://github.com/ksss/raap
82
85
  licenses:
83
86
  - MIT
84
87
  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
+ rubygems_mfa_required: 'true'
88
89
  post_install_message:
89
90
  rdoc_options: []
90
91
  require_paths: