raap 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/raap/cli.rb +7 -5
- data/lib/raap/method_type.rb +2 -2
- data/lib/raap/type.rb +20 -0
- data/lib/raap/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e99f2314c4dda64e47604310a13a5814b1fe016f1e54a73e4531d9fcae504325
|
4
|
+
data.tar.gz: 11698fd1846523fb0d17bcc7d38f5d115ddbffa590aee182977d11e2702b8b7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee00fb743ee63fcdc1cfb2b3301e4cc911b705b65d43b1018b1cccdfe64d486887895491a1b7dbf64d1c01ace851eb8f1f4ea2fe8c6f375e915e322b0afd3c33
|
7
|
+
data.tar.gz: 45352b27b3bb0d3dae3b31ee02a12a1e61124d854fbe9539fd0726cbc7baeb17307fbfee67591aec1269690168dc94b8666d7f1ec67c2f52abe0bf87ad84e902
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.10.0] - 2024-06-25
|
4
|
+
|
5
|
+
* Support default nil in block by @ksss in https://github.com/ksss/raap/pull/18
|
6
|
+
* Support Enumerator by @ksss in https://github.com/ksss/raap/pull/19
|
7
|
+
* Support BigDecimal by @ksss in https://github.com/ksss/raap/pull/20
|
8
|
+
|
9
|
+
## [0.9.0] - 2024-06-11
|
10
|
+
|
11
|
+
* Update ruby by @ksss in https://github.com/ksss/raap/pull/15
|
12
|
+
* Avoid ArgumentError no keywords accepted by @ksss in https://github.com/ksss/raap/pull/16
|
13
|
+
* Fix bug for Set by @ksss in https://github.com/ksss/raap/pull/17
|
14
|
+
|
3
15
|
## [0.8.0] - 2024-06-09
|
4
16
|
|
5
17
|
* Function of interface should not log coverage by @ksss in https://github.com/ksss/raap/pull/11
|
data/lib/raap/cli.rb
CHANGED
@@ -274,10 +274,12 @@ module RaaP
|
|
274
274
|
end
|
275
275
|
|
276
276
|
# type_args delegate to self_type
|
277
|
-
|
278
|
-
|
279
|
-
|
277
|
+
if rtype.instance_of?(::RBS::Types::ClassInstance)
|
278
|
+
args = type_params_decl.map.with_index do |param, i|
|
279
|
+
type_args[i] || param.upper_bound || ::RBS::Types::Bases::Any.new(location: nil)
|
280
280
|
end
|
281
|
+
rtype = ::RBS::Types::ClassInstance.new(name: rtype.name, args: args, location: rtype.location)
|
282
|
+
receiver_type = Type.new(rtype)
|
281
283
|
end
|
282
284
|
RaaP.logger.info("## def #{prefix}#{method_name}: #{method_type}")
|
283
285
|
status = 0
|
@@ -305,7 +307,7 @@ module RaaP
|
|
305
307
|
print '.'
|
306
308
|
RaaP.logger.debug { "Success: #{s.called_str}" }
|
307
309
|
in Result::Failure => f
|
308
|
-
|
310
|
+
print 'F'
|
309
311
|
if (e = f.exception)
|
310
312
|
RaaP.logger.info { "Failure: [#{e.class}] #{e.message}" }
|
311
313
|
RaaP.logger.debug { e.backtrace.join("\n") }
|
@@ -336,12 +338,12 @@ module RaaP
|
|
336
338
|
end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
337
339
|
puts
|
338
340
|
RaaP::Coverage.show($stdout) if @option.coverage
|
339
|
-
puts
|
340
341
|
|
341
342
|
time_diff = end_time - start_time
|
342
343
|
time = ", time: #{(time_diff * 1000).round}ms"
|
343
344
|
stats_log = "success: #{stats.success}, skip: #{stats.skip}, exception: #{stats.exception}#{time}"
|
344
345
|
RaaP.logger.info(stats_log)
|
346
|
+
puts
|
345
347
|
|
346
348
|
if status == 0 && stats.success.zero? && !stats.break
|
347
349
|
status = 1
|
data/lib/raap/method_type.rb
CHANGED
@@ -62,10 +62,10 @@ module RaaP
|
|
62
62
|
end
|
63
63
|
fun.optional_positionals.each do |param|
|
64
64
|
resource.shift.tap do |name|
|
65
|
-
# FIXME: Support without literal type
|
66
65
|
default = Type.new(param.type).pick(size: size)
|
67
66
|
args_name << name
|
68
|
-
|
67
|
+
# FIXME: Support any object
|
68
|
+
args_source << "#{name} = #{default.inspect}"
|
69
69
|
end
|
70
70
|
end
|
71
71
|
fun.rest_positionals&.yield_self do |_|
|
data/lib/raap/type.rb
CHANGED
@@ -74,6 +74,21 @@ module RaaP
|
|
74
74
|
register("::Complex") { complex }
|
75
75
|
register("::Data") { Data.define }
|
76
76
|
register("::Encoding") { encoding }
|
77
|
+
register("::Enumerator") do
|
78
|
+
sized do |size|
|
79
|
+
instance = __skip__ = type
|
80
|
+
Enumerator.new do |y|
|
81
|
+
size.times do
|
82
|
+
elem = if instance.args[0]
|
83
|
+
Type.new(instance.args[0]).pick(size: size / 2)
|
84
|
+
else
|
85
|
+
Type.random.pick(size: size / 2)
|
86
|
+
end
|
87
|
+
y.yield elem
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
77
92
|
register("::FalseClass") { false }
|
78
93
|
register("::File") { File.open("/dev/null") }
|
79
94
|
register("::Float") { float }
|
@@ -96,6 +111,11 @@ module RaaP
|
|
96
111
|
register("::Time") { [:call, Time, :now, [], {}, nil] }
|
97
112
|
register("::TrueClass") { true }
|
98
113
|
register("::UnboundMethod") { temp_method_object.unbind }
|
114
|
+
register("BigDecimal") do
|
115
|
+
sized do |size|
|
116
|
+
[:call, Kernel, :BigDecimal, [size], {}, nil]
|
117
|
+
end
|
118
|
+
end
|
99
119
|
|
100
120
|
attr_reader :type
|
101
121
|
attr_reader :range
|
data/lib/raap/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.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-
|
11
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbs
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
|
-
rubygems_version: 3.
|
98
|
+
rubygems_version: 3.3.26
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: RBS as a Property
|