raap 0.7.0 → 0.9.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13f734d53db009621045979dfc7d705b14c2f378625ff36067784995e8889134
4
- data.tar.gz: 472adf32ff8ea739d83a5b41c6a62e80149b29e34d44536df844010eb2e8cb90
3
+ metadata.gz: a8b20f587b1dff6f9c33beb9e3dd237f130bc260be25f4932cde3a24cc9e795a
4
+ data.tar.gz: 9080f6e301291b4d0c88a89d640635c900d610ef4886664221f3e056e1694c45
5
5
  SHA512:
6
- metadata.gz: cc3782c7a65e098eef727163ccc069ca27b339eeaadc7be44abd2eac94c78fa74443c413364e579998dd49aa11c5be38bd27f6504f92759580ec893dd54a3e97
7
- data.tar.gz: 68e133fa67a03d4c84ab264c1e0fd1c40204da8995a552e99912eb61c1cddb14d9c81bac26c4aa04615d9833dfa74ad64bd212071dd3195dacad6ae85bd23b54
6
+ metadata.gz: 35ba388b95030f3bdd79a7050b26d0ef5fe607f2e98596d61c1a8f49630f3bfb301309cac19c0c0bf95c047b042ffa1a0ffd24985259beff7d0bc49fecb19529
7
+ data.tar.gz: f23bc8a43bd6b7f1295c28b05e0242cf966a589a79f806007d90f468562128ae47e25b8440aaa2be8f3dea2149d7986cedd23b38008eef6f71bccb1f1c0842ab
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.8.0] - 2024-06-09
4
+
5
+ * Function of interface should not log coverage by @ksss in https://github.com/ksss/raap/pull/11
6
+ * Type-checking block arguments by @ksss in https://github.com/ksss/raap/pull/12
7
+ * Read options directly by @ksss in https://github.com/ksss/raap/pull/13
8
+ * Return value is not checked by @ksss in https://github.com/ksss/raap/pull/14
9
+
3
10
  ## [0.1.0] - 2024-03-20
4
11
 
5
12
  - Initial release
data/README.md CHANGED
@@ -57,6 +57,10 @@ Then, you can start loop again.
57
57
 
58
58
  Finally, you get the perfect RBS!
59
59
 
60
+ ## Slide
61
+
62
+ https://speakerdeck.com/ksss/raap
63
+
60
64
  ## Installation
61
65
 
62
66
  Install the gem and add to the application's Gemfile by executing:
data/lib/raap/cli.rb CHANGED
@@ -38,9 +38,6 @@ module RaaP
38
38
  def initialize(argv)
39
39
  # defaults
40
40
  @option = Option.new(
41
- dirs: [],
42
- requires: [],
43
- libraries: [],
44
41
  timeout: 3,
45
42
  size_from: 0,
46
43
  size_to: 99,
@@ -55,14 +52,16 @@ module RaaP
55
52
 
56
53
  def load
57
54
  OptionParser.new do |o|
55
+ o.version = RaaP::VERSION
56
+
58
57
  o.on('-I', '--include PATH') do |path|
59
- @option.dirs << path
58
+ RaaP::RBS.loader.add(path: Pathname(path))
60
59
  end
61
60
  o.on('--library lib', 'load rbs library') do |lib|
62
- @option.libraries << lib
61
+ RaaP::RBS.loader.add(library: lib, version: nil)
63
62
  end
64
63
  o.on('--require lib', 'require ruby library') do |lib|
65
- @option.requires << lib
64
+ require lib
66
65
  end
67
66
  o.on('--log-level level', "default: info") do |arg|
68
67
  RaaP.logger.level = arg
@@ -90,16 +89,6 @@ module RaaP
90
89
  end
91
90
  end.parse!(@argv)
92
91
 
93
- @option.dirs.each do |dir|
94
- RaaP::RBS.loader.add(path: Pathname(dir))
95
- end
96
- @option.libraries.each do |lib|
97
- RaaP::RBS.loader.add(library: lib, version: nil)
98
- end
99
- @option.requires.each do |lib|
100
- require lib
101
- end
102
-
103
92
  self
104
93
  end
105
94
 
@@ -236,7 +225,7 @@ module RaaP
236
225
  type_args = type.args
237
226
 
238
227
  definition = RBS.builder.build_singleton(type_name)
239
- type_params_decl = definition.type_params_decl
228
+ type_params_decl = definition.type_params_decl.freeze
240
229
  definition.methods.each do |method_name, method|
241
230
  if @skip.include?("#{type_name.absolute!}.#{method_name}")
242
231
  RaaP.logger.info("Skip #{"#{type_name.absolute!}.#{method_name}"}")
@@ -256,7 +245,7 @@ module RaaP
256
245
  end
257
246
 
258
247
  definition = RBS.builder.build_instance(type_name)
259
- type_params_decl = definition.type_params_decl
248
+ type_params_decl = definition.type_params_decl.freeze
260
249
  definition.methods.each do |method_name, method|
261
250
  if @skip.include?("#{type_name.absolute!}##{method_name}")
262
251
  RaaP.logger.info("Skip #{"#{type_name.absolute!}.#{method_name}"}")
data/lib/raap/coverage.rb CHANGED
@@ -25,7 +25,7 @@ module RaaP
25
25
  RaaP.logger.warn("No location information for `#{phantom_member}`")
26
26
  return
27
27
  end
28
- write_type(io, "return", phantom_member.type, :abs)
28
+ write_type(io, "return", phantom_member.type)
29
29
  io.write(slice(@cur, @cur...phantom_member.location.end_pos))
30
30
  else
31
31
  RaaP.logger.error("#{phantom_member.class} is not supported")
@@ -37,22 +37,22 @@ module RaaP
37
37
  phantom_method_type.type.yield_self do |fun|
38
38
  case fun
39
39
  when ::RBS::Types::Function
40
- fun.required_positionals.each_with_index { |param, i| write_param(io, "req_#{i}", param, :abs) }
41
- fun.optional_positionals.each_with_index { |param, i| write_param(io, "opt_#{i}", param, :opt) }
42
- fun.rest_positionals&.yield_self { |param| write_param(io, "rest", param, :opt) }
43
- fun.trailing_positionals.each_with_index { |param, i| write_param(io, "trail_#{i}", param, :abs) }
44
- fun.required_keywords.each { |key, param| write_param(io, "keyreq_#{key}", param, :abs) }
45
- fun.optional_keywords.each { |key, param| write_param(io, "key_#{key}", param, :opt) }
46
- fun.rest_keywords&.yield_self { |param| write_param(io, "keyrest", param, :opt) }
40
+ fun.required_positionals.each_with_index { |param, i| write_param(io, "req_#{i}", param) }
41
+ fun.optional_positionals.each_with_index { |param, i| write_param(io, "opt_#{i}", param) }
42
+ fun.rest_positionals&.yield_self { |param| write_param(io, "rest", param) }
43
+ fun.trailing_positionals.each_with_index { |param, i| write_param(io, "trail_#{i}", param) }
44
+ fun.required_keywords.each { |key, param| write_param(io, "keyreq_#{key}", param) }
45
+ fun.optional_keywords.each { |key, param| write_param(io, "key_#{key}", param) }
46
+ fun.rest_keywords&.yield_self { |param| write_param(io, "keyrest", param) }
47
47
  # when ::RBS::Types::UntypedFunction
48
48
  end
49
49
  end
50
50
 
51
51
  phantom_method_type.block&.yield_self do |b|
52
- b.type.each_param.with_index { |param, i| write_param(io, "block_param_#{i}", param, :opt) }
53
- write_type(io, "block_return", b.type.return_type, :abs)
52
+ b.type.each_param.with_index { |param, i| write_param(io, "block_param_#{i}", param) }
53
+ write_type(io, "block_return", b.type.return_type)
54
54
  end
55
- write_type(io, "return", phantom_method_type.type.return_type, :abs)
55
+ write_type(io, "return", phantom_method_type.type.return_type)
56
56
  raise unless phantom_method_type.location
57
57
 
58
58
  io.write(slice(@cur, @cur...phantom_method_type.location.end_pos))
@@ -70,11 +70,11 @@ module RaaP
70
70
  ml.source[start, range.end - range.begin] or raise
71
71
  end
72
72
 
73
- def write_param(io, position, param, accuracy)
74
- write_type(io, position, param.type, accuracy)
73
+ def write_param(io, position, param)
74
+ write_type(io, position, param.type)
75
75
  end
76
76
 
77
- def write_type(io, position, type, accuracy)
77
+ def write_type(io, position, type)
78
78
  unless type.location
79
79
  RaaP.logger.warn("No location information for `#{type}`")
80
80
  return
@@ -88,12 +88,12 @@ module RaaP
88
88
  t.location or raise
89
89
  io.write(slice(@cur, @cur...t.location.start_pos)) # ( or [
90
90
  @cur = t.location.start_pos
91
- write_type(io, "#{position}_#{name}_#{i}", t, accuracy)
91
+ write_type(io, "#{position}_#{name}_#{i}", t)
92
92
  end
93
93
  when ::RBS::Types::Optional
94
94
  raise unless type.location
95
95
 
96
- write_type(io, "#{position}_optional_left", type.type, accuracy)
96
+ write_type(io, "#{position}_optional_left", type.type)
97
97
  io.write(slice(@cur, @cur...(type.location.end_pos - 1)))
98
98
  @cur = type.location.end_pos - 1
99
99
  if @cov.include?("#{position}_optional_right".to_sym)
@@ -103,17 +103,6 @@ module RaaP
103
103
  end
104
104
  raise unless type.location
105
105
 
106
- @cur = type.location.end_pos
107
- when ::RBS::Types::Variable
108
- case accuracy
109
- when :abs
110
- io.write(green(type.name.to_s))
111
- when :opt
112
- # Variables are substed so raap don't know if they've been used.
113
- io.write(yellow(type.name.to_s))
114
- end
115
- raise unless type.location
116
-
117
106
  @cur = type.location.end_pos
118
107
  else
119
108
  raise unless type.location
@@ -129,7 +118,6 @@ module RaaP
129
118
 
130
119
  def green(str) = "\e[32m#{str}\e[0m"
131
120
  def red(str) = "\e[1;4;41m#{str}\e[0m"
132
- def yellow(str) = "\e[93m#{str}\e[0m"
133
121
  end
134
122
 
135
123
  class << self
@@ -142,8 +130,6 @@ module RaaP
142
130
  !!@cov
143
131
  end
144
132
 
145
- # position: req_0
146
- # type: union_1
147
133
  def log(position)
148
134
  return unless running?
149
135
 
@@ -151,7 +137,7 @@ module RaaP
151
137
  end
152
138
 
153
139
  def cov
154
- @cov or raise
140
+ @cov or raise("Coverage is not started")
155
141
  end
156
142
 
157
143
  def show(io)
@@ -162,25 +148,31 @@ module RaaP
162
148
  end
163
149
 
164
150
  def new_type_with_log(position, type)
151
+ log_with_type(position, type) do |t|
152
+ Type.new(t)
153
+ end
154
+ end
155
+
156
+ def log_with_type(position, type, &block)
165
157
  case type
166
158
  when ::RBS::Types::Tuple
167
159
  # FIXME: Support Union in Tuple
168
160
  type.types.each_with_index do |_t, i|
169
161
  log("#{position}_tuple_#{i}")
170
162
  end
171
- Type.new(type)
163
+ block&.call(type)
172
164
  when ::RBS::Types::Union
173
165
  i = Random.rand(type.types.length)
174
- new_type_with_log("#{position}_union_#{i}", type.types[i])
166
+ log_with_type("#{position}_union_#{i}", type.types[i], &block)
175
167
  when ::RBS::Types::Optional
176
168
  if Random.rand(2).zero?
177
- new_type_with_log("#{position}_optional_left", type.type)
169
+ log_with_type("#{position}_optional_left", type.type, &block)
178
170
  else
179
- new_type_with_log("#{position}_optional_right", ::RBS::Types::Bases::Nil.new(location: nil))
171
+ log_with_type("#{position}_optional_right", ::RBS::Types::Bases::Nil.new(location: nil), &block)
180
172
  end
181
173
  else
182
174
  log(position)
183
- Type.new(type)
175
+ block&.call(type)
184
176
  end
185
177
  end
186
178
  end
@@ -2,8 +2,9 @@
2
2
 
3
3
  module RaaP
4
4
  class FunctionType
5
- def initialize(fun)
5
+ def initialize(fun, coverage: true)
6
6
  @fun = fun
7
+ @coverage = coverage
7
8
  end
8
9
 
9
10
  def pick_arguments(size: 10)
@@ -81,7 +82,11 @@ module RaaP
81
82
  end
82
83
 
83
84
  def build_type_with_coverage(position, param)
84
- Coverage.new_type_with_log(position, param.type)
85
+ if @coverage
86
+ Coverage.new_type_with_log(position, param.type)
87
+ else
88
+ Type.new(param.type)
89
+ end
85
90
  end
86
91
  end
87
92
  end
@@ -50,7 +50,7 @@ module RaaP
50
50
  private
51
51
 
52
52
  def call(size:, stats:)
53
- if @method_type.rbs.type.each_type.find { |t| t.instance_of?(::RBS::Types::Bases::Any) }
53
+ if @method_type.rbs.type.each_param.find { |param| param.type.each_type.find { |t| t.instance_of?(::RBS::Types::Bases::Any) } }
54
54
  RaaP.logger.info { "Skip type check since `#{@method_type.rbs}` includes `untyped`" }
55
55
  stats.break = true
56
56
  throw :break
@@ -2,7 +2,7 @@
2
2
 
3
3
  module RaaP
4
4
  class MethodType
5
- attr_reader :rbs, :original_rbs
5
+ attr_reader :rbs
6
6
 
7
7
  def initialize(method, type_params_decl: [], type_args: [], self_type: nil, instance_type: nil, class_type: nil)
8
8
  rbs =
@@ -19,11 +19,17 @@ module RaaP
19
19
 
20
20
  params = (type_params_decl + rbs.type_params).uniq
21
21
  ts = TypeSubstitution.new(params, type_args)
22
-
23
- @original_rbs = rbs
24
22
  @rbs = ts.method_type_sub(rbs, self_type: self_type, instance_type: instance_type, class_type: class_type)
25
23
  function_or_untypedfunction = __skip__ = @rbs.type
26
24
  @fun_type = FunctionType.new(function_or_untypedfunction)
25
+ @type_check = ::RBS::Test::TypeCheck.new(
26
+ self_class: (_ = self_type),
27
+ instance_class: (_ = instance_type),
28
+ class_class: (_ = class_type),
29
+ builder: RBS.builder,
30
+ sample_size: 100,
31
+ unchecked_classes: []
32
+ )
27
33
  end
28
34
 
29
35
  def pick_arguments(size: 10)
@@ -42,28 +48,63 @@ module RaaP
42
48
  return nil if block.nil?
43
49
  return nil if (block.required == false) && [true, false].sample
44
50
 
45
- fixed_return_value = Type.new(block.type.return_type).pick(size: size)
46
- Proc.new do
47
- block.type.each_param.with_index do |_param, i|
48
- Coverage.log("block_param_#{i}")
51
+ args_name = []
52
+ args_source = []
53
+ resource = [*'a'..'z']
54
+ case fun = block.type
55
+ when ::RBS::Types::Function
56
+ # FIXME: Support keyword types
57
+ fun.required_positionals.each do
58
+ resource.shift.tap do |name|
59
+ args_name << name
60
+ args_source << name
61
+ end
62
+ end
63
+ fun.optional_positionals.each do |param|
64
+ resource.shift.tap do |name|
65
+ # FIXME: Support without literal type
66
+ default = Type.new(param.type).pick(size: size)
67
+ args_name << name
68
+ args_source << "#{name} = #{default}"
69
+ end
70
+ end
71
+ fun.rest_positionals&.yield_self do |_|
72
+ resource.shift.tap do |name|
73
+ args_name << "*#{name}"
74
+ args_source << "*#{name}"
75
+ end
76
+ end
77
+ fun.trailing_positionals.each do
78
+ resource.shift.tap do |name|
79
+ args_name << name
80
+ args_source << name
81
+ end
49
82
  end
50
-
51
- Coverage.new_type_with_log("block_return", block.type.return_type)
52
- fixed_return_value
53
83
  end
84
+ # Hack: Use local variable in eval
85
+ fixed_return_value = Type.new(block.type.return_type).pick(size: size)
86
+ _ = fixed_return_value
87
+ type_check = @type_check
88
+ _ = type_check
89
+ eval(<<~RUBY) # rubocop:disable Security/Eval
90
+ -> (#{args_source.join(', ')}) do
91
+ i = 0
92
+ type_check.zip_args([#{args_name.join(', ')}], block.type) do |val, param|
93
+ unless type_check.value(val, param.type)
94
+ raise TypeError, "block argument type mismatch: expected `(\#{fun.param_to_s})`, got \#{BindCall.inspect([#{args_name.join(', ')}])}"
95
+ end
96
+
97
+ Coverage.log_with_type("block_param_\#{i}", param.type)
98
+ i += 1
99
+ end
100
+ Coverage.log_with_type("block_return", block.type.return_type)
101
+ fixed_return_value
102
+ end
103
+ RUBY
54
104
  end
55
105
 
56
106
  def check_return(return_value)
57
- untyped = __skip__ = nil
58
- type_check = ::RBS::Test::TypeCheck.new(
59
- self_class: untyped, # cannot support `self`
60
- instance_class: untyped, # cannot support `instance`
61
- class_class: untyped, # cannot support `class`
62
- builder: RBS.builder,
63
- sample_size: 100,
64
- unchecked_classes: []
65
- )
66
- type_check.value(return_value, rbs.type.return_type)
107
+ @type_check.value(return_value, rbs.type.return_type)
67
108
  end
68
109
  end
69
110
  end
@@ -148,9 +148,17 @@ module RaaP
148
148
  def eval_one(symbolic_call)
149
149
  symbolic_call => [:call, receiver_value, method_name, args, kwargs, block]
150
150
  if @allow_private
151
- receiver_value.__send__(method_name, *args, **kwargs, &block)
151
+ if kwargs.empty?
152
+ receiver_value.__send__(method_name, *args, &block)
153
+ else
154
+ receiver_value.__send__(method_name, *args, **kwargs, &block)
155
+ end
152
156
  else
153
- BindCall.public_send(receiver_value, method_name, *args, **kwargs, &block)
157
+ if kwargs.empty?
158
+ BindCall.public_send(receiver_value, method_name, *args, &block)
159
+ else
160
+ BindCall.public_send(receiver_value, method_name, *args, **kwargs, &block)
161
+ end
154
162
  end
155
163
  end
156
164
 
data/lib/raap/type.rb CHANGED
@@ -47,7 +47,7 @@ module RaaP
47
47
  if snew
48
48
  # class
49
49
  rbs_method_type = snew.method_types.sample or raise
50
- type_params = definition.type_params_decl.concat(rbs_method_type.type_params.drop(definition.type_params_decl.length))
50
+ type_params = definition.type_params_decl.dup.concat(rbs_method_type.type_params.drop(definition.type_params_decl.length))
51
51
  ts = TypeSubstitution.new(type_params, type.args)
52
52
  maped_rbs_method_type = ts.method_type_sub(rbs_method_type)
53
53
  method_type = MethodType.new(maped_rbs_method_type)
@@ -33,7 +33,7 @@ module RaaP
33
33
  if b && subed_method_type.block && subed_method_type.block.type.is_a?(::RBS::Types::Function)
34
34
  @fixed_block_arguments ||= {}
35
35
  @fixed_block_arguments[name] ||= size.times.map do
36
- FunctionType.new(subed_method_type.block.type)
36
+ FunctionType.new(subed_method_type.block.type, coverage: false)
37
37
  .pick_arguments(size: size)
38
38
  end
39
39
 
data/lib/raap/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RaaP
4
- VERSION = "0.7.0"
4
+ VERSION = "0.9.0"
5
5
  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.7.0
4
+ version: 0.9.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-05-08 00:00:00.000000000 Z
11
+ date: 2024-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbs
@@ -46,13 +46,10 @@ executables:
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
- - ".rubocop.yml"
50
49
  - CHANGELOG.md
51
50
  - CODE_OF_CONDUCT.md
52
51
  - LICENSE.txt
53
52
  - README.md
54
- - Rakefile
55
- - Steepfile
56
53
  - exe/raap
57
54
  - lib/raap.rb
58
55
  - lib/raap/bind_call.rb
@@ -78,12 +75,6 @@ files:
78
75
  - lib/raap/value/void.rb
79
76
  - lib/raap/version.rb
80
77
  - lib/shims.rb
81
- - public/example.webp
82
- - public/jacket.webp
83
- - rbs_collection.lock.yaml
84
- - rbs_collection.yaml
85
- - sig/raap.rbs
86
- - sig/shims.rbs
87
78
  homepage: https://github.com/ksss/raap
88
79
  licenses:
89
80
  - MIT
@@ -97,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
88
  requirements:
98
89
  - - ">="
99
90
  - !ruby/object:Gem::Version
100
- version: 3.0.0
91
+ version: 3.1.0
101
92
  required_rubygems_version: !ruby/object:Gem::Requirement
102
93
  requirements:
103
94
  - - ">="
data/.rubocop.yml DELETED
@@ -1,33 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 3.0
3
- NewCops: enable
4
- Include:
5
- - 'lib/**/*.rb'
6
-
7
- Lint:
8
- Enabled: true
9
- Lint/EmptyBlock:
10
- Enabled: false
11
- Lint/SymbolConversion:
12
- Enabled: false
13
-
14
- Style:
15
- Enabled: false
16
- Style/HashSyntax:
17
- EnforcedShorthandSyntax: always
18
- Enabled: true
19
- Style/FrozenStringLiteralComment:
20
- Enabled: true
21
-
22
- Metrics:
23
- Enabled: false
24
-
25
- Layout:
26
- Enabled: true
27
- Layout/FirstArrayElementIndentation:
28
- EnforcedStyle: consistent
29
- Layout/LineLength:
30
- Max: 150
31
-
32
- Naming:
33
- Enabled: false
data/Rakefile DELETED
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "minitest/test_task"
5
- require "rubocop/rake_task"
6
-
7
- Minitest::TestTask.create do |t|
8
- t.test_prelude = 'require "test/test_helper"'
9
- end
10
-
11
- RuboCop::RakeTask.new
12
-
13
- namespace :steep do
14
- task :check do
15
- sh "bundle exec steep check"
16
- end
17
- end
18
-
19
- task default: [:test, :rubocop, 'steep:check']
data/Steepfile DELETED
@@ -1,4 +0,0 @@
1
- target :lib do
2
- check "lib"
3
- signature "sig"
4
- end
data/public/example.webp DELETED
Binary file
data/public/jacket.webp DELETED
Binary file
@@ -1,128 +0,0 @@
1
- ---
2
- path: ".gem_rbs_collection"
3
- gems:
4
- - name: abbrev
5
- version: '0'
6
- source:
7
- type: stdlib
8
- - name: activesupport
9
- version: '7.0'
10
- source:
11
- type: git
12
- name: ruby/gem_rbs_collection
13
- revision: d2e93d426c927fdab90ef12e30a9875aa05d60d6
14
- remote: https://github.com/ruby/gem_rbs_collection.git
15
- repo_dir: gems
16
- - name: base64
17
- version: '0'
18
- source:
19
- type: stdlib
20
- - name: bigdecimal
21
- version: '0'
22
- source:
23
- type: stdlib
24
- - name: concurrent-ruby
25
- version: '1.1'
26
- source:
27
- type: git
28
- name: ruby/gem_rbs_collection
29
- revision: d2e93d426c927fdab90ef12e30a9875aa05d60d6
30
- remote: https://github.com/ruby/gem_rbs_collection.git
31
- repo_dir: gems
32
- - name: connection_pool
33
- version: '2.4'
34
- source:
35
- type: git
36
- name: ruby/gem_rbs_collection
37
- revision: d2e93d426c927fdab90ef12e30a9875aa05d60d6
38
- remote: https://github.com/ruby/gem_rbs_collection.git
39
- repo_dir: gems
40
- - name: date
41
- version: '0'
42
- source:
43
- type: stdlib
44
- - name: erb
45
- version: '0'
46
- source:
47
- type: stdlib
48
- - name: fileutils
49
- version: '0'
50
- source:
51
- type: stdlib
52
- - name: i18n
53
- version: '1.10'
54
- source:
55
- type: git
56
- name: ruby/gem_rbs_collection
57
- revision: d2e93d426c927fdab90ef12e30a9875aa05d60d6
58
- remote: https://github.com/ruby/gem_rbs_collection.git
59
- repo_dir: gems
60
- - name: io-console
61
- version: '0'
62
- source:
63
- type: stdlib
64
- - name: json
65
- version: '0'
66
- source:
67
- type: stdlib
68
- - name: logger
69
- version: '0'
70
- source:
71
- type: stdlib
72
- - name: minitest
73
- version: '0'
74
- source:
75
- type: stdlib
76
- - name: monitor
77
- version: '0'
78
- source:
79
- type: stdlib
80
- - name: mutex_m
81
- version: '0'
82
- source:
83
- type: stdlib
84
- - name: optparse
85
- version: '0'
86
- source:
87
- type: stdlib
88
- - name: pathname
89
- version: '0'
90
- source:
91
- type: stdlib
92
- - name: rake
93
- version: '13.0'
94
- source:
95
- type: git
96
- name: ruby/gem_rbs_collection
97
- revision: d2e93d426c927fdab90ef12e30a9875aa05d60d6
98
- remote: https://github.com/ruby/gem_rbs_collection.git
99
- repo_dir: gems
100
- - name: rbs
101
- version: 3.4.4
102
- source:
103
- type: rubygems
104
- - name: rdoc
105
- version: '0'
106
- source:
107
- type: stdlib
108
- - name: securerandom
109
- version: '0'
110
- source:
111
- type: stdlib
112
- - name: singleton
113
- version: '0'
114
- source:
115
- type: stdlib
116
- - name: time
117
- version: '0'
118
- source:
119
- type: stdlib
120
- - name: timeout
121
- version: '0'
122
- source:
123
- type: stdlib
124
- - name: tsort
125
- version: '0'
126
- source:
127
- type: stdlib
128
- gemfile_lock_path: Gemfile.lock
data/rbs_collection.yaml DELETED
@@ -1,19 +0,0 @@
1
- # Download sources
2
- sources:
3
- - type: git
4
- name: ruby/gem_rbs_collection
5
- remote: https://github.com/ruby/gem_rbs_collection.git
6
- revision: main
7
- repo_dir: gems
8
-
9
- # You can specify local directories as sources also.
10
- # - type: local
11
- # path: path/to/your/local/repository
12
-
13
- # A directory to install the downloaded RBSs
14
- path: .gem_rbs_collection
15
-
16
- gems:
17
- - name: activesupport
18
- - name: steep
19
- ignore: true
data/sig/raap.rbs DELETED
@@ -1,385 +0,0 @@
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_method: (untyped, Symbol) { (*untyped, **untyped) -> untyped } -> void
10
- def self.respond_to?: (untyped, untyped, ?boolish) -> 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, ?allow_private: bool, ?coverage: bool) -> 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, ?allow_private: bool, ?coverage: bool) -> instance
25
-
26
- def self.keyword_init?: () -> true
27
-
28
- def self.members: () -> [ :dirs, :requires, :library, :timeout, :size_from, :size_to, :size_by, :allow_private, :coverage]
29
-
30
- def members: () -> [ :dirs, :requires, :library, :timeout, :size_from, :size_to, :size_by, :allow_private, :coverage]
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
-
46
- attr_accessor allow_private: bool
47
-
48
- attr_accessor coverage: bool
49
- end
50
-
51
- type property_result = [Integer, Symbol, ::RBS::MethodType, StringIO?]
52
-
53
- DEFAULT_SKIP: ::Set[String]
54
-
55
- @argv: Array[String]
56
- @option: Option
57
- @results: Array[{ method: ::RBS::Definition::Method, properties: Array[property_result] }]
58
- @skip: ::Set[::String]
59
-
60
- def self.option: () -> Option
61
- def self.option=: (Option) -> void
62
-
63
- def initialize: (Array[String]) -> void
64
- def load: () -> self
65
- def run: () -> Integer
66
-
67
- private
68
-
69
- def run_by: (kind: (:instance | :singleton), tag: String) -> void
70
- def run_by_type_name: (tag: String) -> void
71
- def run_by_type_name_with_search: (tag: String) -> void
72
- 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
73
- def report: () -> Integer
74
- end
75
-
76
- module Coverage
77
- type locs = [::RBS::Buffer::loc, ::RBS::Buffer::loc]
78
- type accuracy = :abs | :opt
79
- class Writer
80
- @method_type: ::RBS::MethodType
81
- @cov: ::Set[Symbol]
82
- @cur: Integer
83
-
84
- def initialize: (::RBS::MethodType, Set[Symbol]) -> void
85
- def write: (IO) -> void
86
-
87
- private
88
-
89
- def method_type_location: () -> ::RBS::Location[untyped, untyped]
90
- def slice: (Integer, Range[Integer]) -> String
91
- def write_param: (IO, String, ::RBS::Types::Function::Param, accuracy) -> void
92
- def write_type: (IO, String, ::RBS::Types::t, accuracy) -> void
93
- def green: (String) -> String
94
- def red: (String) -> String
95
- def yellow: (String) -> String
96
- end
97
-
98
- self.@cov: Set[Symbol]?
99
- self.@method_type: ::RBS::MethodType
100
-
101
- def self.start: (::RBS::MethodType) -> void
102
- def self.running?: () -> bool
103
- def self.log: (String | Symbol) -> void
104
- def self.cov: () -> Set[Symbol]
105
- def self.show: (IO) -> void
106
- def self.new_type_with_log: (String, ::RBS::Types::t) -> Type
107
- end
108
-
109
- class FunctionType
110
- @fun: ::RBS::Types::Function
111
-
112
- def initialize: (::RBS::Types::Function) -> void
113
- def pick_arguments: (?size: Integer) -> [Array[untyped], Hash[Symbol, untyped]]
114
- def arguments_to_symbolic_call: (?size: Integer) -> [Array[untyped], Hash[Symbol, untyped]]
115
-
116
- private
117
-
118
- def to_symbolic_call_recursive: (untyped, size: Integer) -> untyped
119
- def build_args_type: () -> Array[Type]
120
- def build_kwargs_type: () -> Hash[Symbol, Type]
121
- def build_type_with_coverage: (String, ::RBS::Types::Function::Param) -> Type
122
- end
123
-
124
- class MethodProperty
125
- class Stats
126
- attr_accessor success: Integer
127
- attr_accessor skip: Integer
128
- attr_accessor exception: Integer
129
- attr_accessor break: bool
130
- end
131
-
132
- @receiver_type: Type
133
- @method_name: Symbol
134
- @method_type: MethodType
135
- @size_step: _Each[Integer]
136
- @timeout: (Integer | Float | nil)
137
- @allow_private: bool
138
-
139
- def initialize: (receiver_type: Type, method_name: Symbol, method_type: MethodType, size_step: _Each[Integer], timeout: (Integer | Float | nil), ?allow_private: bool) -> void
140
- def run: () { (Result::Success | Result::Failure | Result::Skip | Result::Exception) -> void } -> Stats
141
-
142
- private
143
-
144
- def call: (size: Integer, stats: Stats) -> (Result::Success | Result::Failure | Result::Skip | Result::Exception)
145
- def check_return: (receiver_value: untyped, return_value: untyped) -> ([Symbol] | [Symbol, Exception])
146
- def return_type: () -> RBS::Types::t
147
- def original_return_type: () -> RBS::Types::t
148
- def coverage: (String, untyped, RBS::Types::t, ?RBS::Test::TypeCheck?) -> void
149
- end
150
-
151
- class MethodType
152
- attr_reader rbs: ::RBS::MethodType
153
- attr_reader original_rbs: ::RBS::MethodType
154
- @fun_type: FunctionType
155
-
156
- 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
157
- def pick_arguments: (?size: Integer) -> [Array[untyped], Hash[Symbol, untyped], ::Proc?]
158
- def arguments_to_symbolic_call: (?size: Integer) -> [Array[untyped], Hash[Symbol, untyped], ::Proc?]
159
- def pick_block: (?size: Integer) -> ::Proc?
160
- def check_return: (untyped) -> bool
161
- end
162
-
163
- module Minitest
164
- end
165
-
166
- module RBS
167
- self.@builder: ::RBS::DefinitionBuilder
168
- self.@env: ::RBS::Environment
169
- self.@loader: ::RBS::EnvironmentLoader
170
-
171
- def self.builder: () -> ::RBS::DefinitionBuilder
172
- def self.env: () -> ::RBS::Environment
173
- def self.loader: () -> ::RBS::EnvironmentLoader
174
- def self.parse_type: (String) -> ::RBS::Types::t
175
- def self.parse_method_type: (String) -> ::RBS::MethodType
176
- def self.parse_member: (String) -> ::RBS::AST::Members::Attribute
177
- def self._shift_location: (untyped, Integer) -> void
178
- def self.find_alias_decl: (::RBS::TypeName, Symbol) -> ::RBS::AST::Members::Alias?
179
- end
180
-
181
- module Result
182
- interface _ReturnValue
183
- def return_value: () -> untyped
184
- end
185
-
186
- module ReturnValueWithType : _ReturnValue
187
- def return_value_with_type: () -> String
188
-
189
- private
190
-
191
- def return_value_to_type: (untyped) -> String
192
- end
193
-
194
- class Success < Data
195
- include ReturnValueWithType
196
- def self.new: (symbolic_call: symbolic_call, return_value: untyped) -> instance
197
- attr_reader symbolic_call: symbolic_call
198
- attr_reader return_value: untyped
199
- def called_str: () -> String
200
- end
201
- class Failure < Data
202
- include ReturnValueWithType
203
- def self.new: (symbolic_call: symbolic_call, return_value: untyped, ?exception: ::Exception?) -> instance
204
- attr_reader symbolic_call: symbolic_call
205
- attr_reader return_value: untyped
206
- attr_reader exception: ::Exception?
207
- def called_str: () -> String
208
- end
209
- class Skip < Data
210
- def self.new: (symbolic_call: symbolic_call?, exception: ::Exception) -> instance
211
- attr_reader symbolic_call: symbolic_call?
212
- attr_reader exception: ::Exception
213
- end
214
- class Exception < Data
215
- def self.new: (symbolic_call: symbolic_call?, exception: ::Exception) -> instance
216
- attr_reader symbolic_call: symbolic_call?
217
- attr_reader exception: ::Exception
218
- end
219
- end
220
-
221
- class Sized[T]
222
- @block: ::Proc
223
- @such_that: ::Proc?
224
-
225
- def initialize: () { (Integer) -> untyped } -> void
226
- def pick: (size: Integer) -> T
227
- def such_that: () { (untyped) -> boolish } -> self
228
- def such_that_loop: [R] () { (Integer) -> R } -> R
229
- end
230
-
231
- class SymbolicCaller
232
- class Var
233
- attr_reader name: String
234
- def initialize: (String name) -> void
235
- def +: (String) -> String
236
- def to_s: () -> String
237
- end
238
-
239
- attr_reader symbolic_call: untyped
240
- attr_reader allow_private: bool
241
-
242
- def initialize: (untyped, ?allow_private: bool) -> void
243
- def eval: () -> untyped
244
- def call_str: () -> String
245
- def to_lines: () -> Array[String]
246
-
247
- private
248
-
249
- def try_eval: (untyped) -> untyped
250
- def walk: () ?{ (symbolic_call) -> untyped} -> untyped
251
- def _walk: (untyped, bool is_last) ?{ (symbolic_call) -> untyped} -> untyped
252
- def eval_one: (symbolic_call) -> untyped
253
- def var_name: (Module) -> String
254
- def printable?: (untyped) -> bool
255
- def printable: (untyped) -> String
256
- end
257
-
258
- class TypeSubstitution
259
- @type_params: ::Array[::RBS::AST::TypeParam]
260
- @type_args: ::Array[::RBS::Types::t]
261
-
262
- def initialize: (::Array[::RBS::AST::TypeParam], ::Array[::RBS::Types::t]) -> void
263
- def build: () -> ::RBS::Substitution
264
- def method_type_sub: (::RBS::MethodType, ?self_type: ::RBS::Types::t?, ?instance_type: ::RBS::Types::ClassInstance?, ?class_type: ::RBS::Types::ClassSingleton?) -> ::RBS::MethodType
265
-
266
- private
267
-
268
- interface _MapType
269
- def map_type: { (untyped) -> untyped } -> untyped
270
- end
271
-
272
- def sub: (_MapType search, self_type: ::RBS::Types::t?, instance_type: ::RBS::Types::t?, class_type: ::RBS::Types::t?) -> untyped
273
- end
274
-
275
- class Type
276
- module Arithmetic
277
- def self.float: () -> Float
278
- def self.positive_float: () -> Float
279
- end
280
-
281
- @such_that: (^(untyped) -> ::boolish)?
282
-
283
- GENERATORS: Hash[String, ^() -> Sized[untyped]]
284
- SIMPLE_SOURCE: Array[String]
285
-
286
- def self.register: (String) { () [self: instance] -> untyped } -> void
287
- def self.random: () -> Type
288
- def self.random_without_basic_object: () -> Type
289
- def self.call_new_from: (Module, ::RBS::Types::ClassInstance, size: Integer) -> symbolic_call
290
-
291
- attr_reader type: ::RBS::Types::t
292
- attr_reader range: Range[untyped]
293
-
294
- def initialize: (String | ::RBS::Types::t, ?range: Range[untyped]) -> void
295
-
296
- # Define rule for generating values
297
- # type.such_that { |i| i != 0 }.pick #=> ensure that the value is not 0
298
- def such_that: () { (untyped) -> boolish } -> self
299
-
300
- # Basic API for materializing values
301
- def pick: (?size: Integer) -> untyped
302
- def to_symbolic_caller: (?size: Integer) -> SymbolicCaller
303
- def to_symbolic_call: (?size: Integer) -> untyped
304
- def sized: [T] () { (Integer size) -> T } -> Sized[T]
305
-
306
- private
307
-
308
- def to_symbolic_call_from_initialize: (::RBS::Types::ClassInstance, size: Integer) -> (symbolic_call | Value::Module)
309
- def parse: (String | ::RBS::Types::t) -> ::RBS::Types::t?
310
- def try: (times: Integer, size: Integer) { (Integer size) -> untyped } -> untyped
311
-
312
- def numeric: () -> Sized[Numeric]
313
- def integer: () -> Sized[Integer]
314
- def none_zero_integer: () -> Sized[Integer]
315
- def float: () -> Sized[Float]
316
- def rational: () -> Sized[symbolic_call]
317
- def complex: () -> Sized[symbolic_call]
318
- def string: () -> Sized[String]
319
- def symbol: () -> Sized[Symbol]
320
- def array: (Type) -> Sized[Array[untyped]]
321
- def dict: (Type, Type) -> Sized[Hash[untyped, untyped]]
322
- def encoding: () -> symbolic_call
323
- def bool: () -> bool
324
- def temp_method_object: () -> ::Method
325
- end
326
-
327
- module Value
328
- class Bottom < BasicObject
329
- def inspect: () -> String
330
- def class: () -> class
331
- end
332
-
333
- class Interface
334
- @type: ::RBS::Types::Interface
335
- @size: Integer
336
- @definition: ::RBS::Definition
337
-
338
- def self.define_method_from_interface: (::Module base_class, String | ::RBS::Types::Interface type, ?size: Integer) -> void
339
- def initialize: (String | ::RBS::Types::Interface | String, ?size: Integer) -> void
340
- def respond_to?: (Symbol, ?boolish) -> bool
341
- def inspect: () -> String
342
- def class: () -> class
343
- end
344
-
345
- module Intersection
346
- @type: ::RBS::Types::Intersection
347
- @children: Array[Type]
348
- @size: Integer
349
-
350
- def initialize: (::RBS::Types::Intersection | String, ?size: Integer) -> void
351
- def respond_to?: (Symbol, ?boolish) -> bool
352
- def inspect: () -> String
353
- def class: () -> class
354
- end
355
-
356
- class Module < BasicObject
357
- @type: ::RBS::Types::ClassInstance
358
- @size: Integer
359
- @self_type: untyped
360
-
361
- def initialize: (::RBS::Types::ClassInstance | String, ?size: Integer) -> void
362
- def respond_to?: (Symbol, ?boolish) -> bool
363
- def inspect: () -> String
364
- def class: () -> class
365
- end
366
-
367
- class Top < BasicObject
368
- def inspect: () -> String
369
- def class: () -> class
370
- end
371
-
372
- class Variable
373
- attr_reader type: ::RBS::Types::Variable
374
-
375
- def initialize: (::RBS::Types::Variable | String | Symbol) -> void
376
- def inspect: () -> String
377
- def class: () -> class
378
- end
379
-
380
- class Void < BasicObject
381
- def inspect: () -> String
382
- def class: () -> class
383
- end
384
- end
385
- end
data/sig/shims.rbs DELETED
@@ -1,4 +0,0 @@
1
- module Timeout
2
- class ExitException < Exception
3
- end
4
- end