orthoses 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/orthoses/avoid_recursive_ancestor_error.rb +13 -6
- data/lib/orthoses/constant.rb +10 -2
- data/lib/orthoses/version.rb +1 -1
- data/sig/orthoses/avoid_recursive_ancestor_error.rbs +1 -0
- data/sig/orthoses/call_tracer.rbs +1 -1
- data/sig/orthoses/const_load_error.rbs +2 -2
- data/sig/orthoses/content.rbs +3 -3
- data/sig/orthoses/utils.rbs +4 -4
- data/sig/orthoses.rbs +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 894390a9b9736bc6c773da2d8522b76a47a4f345f1eb48c847b4dc2cf691cfe4
|
4
|
+
data.tar.gz: 9189fdd9d19a953227093f99cd04e8a20f258e231e40b40ed5e7582cd5ac107c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90d06b917b9fb9aa88a18bae14bd792fe85520a8d8cf9f75c8d422f080cfe992036f3b1d2b9e115f1a6ff315478899a2b275d6ae99bdd6c5598bdcc21e3ddf56
|
7
|
+
data.tar.gz: 4d134a532af9973901e87fa48d1e96d9ca1469b46fa266d548476d252f8651dce94b40ee3de799dd7aa10f5d961e06d330048b5c833af88eee536965779dd131
|
data/Gemfile.lock
CHANGED
@@ -7,16 +7,23 @@ module Orthoses
|
|
7
7
|
def call
|
8
8
|
@loader.call.tap do |store|
|
9
9
|
object_mixins = {}
|
10
|
-
store
|
11
|
-
|
12
|
-
when RBS::AST::Members::Mixin
|
13
|
-
object_mixins[member.name.relative!.to_s] = true
|
14
|
-
end
|
15
|
-
end
|
10
|
+
set_object_mixins_recursive(store, "Object", object_mixins)
|
11
|
+
|
16
12
|
object_mixins.each_key do |object_mixin|
|
17
13
|
store[object_mixin].header = "module #{object_mixin} : BasicObject"
|
18
14
|
end
|
19
15
|
end
|
20
16
|
end
|
17
|
+
|
18
|
+
def set_object_mixins_recursive(store, name, object_mixins)
|
19
|
+
store[name].to_decl.members.each do |member|
|
20
|
+
case member
|
21
|
+
when RBS::AST::Members::Mixin
|
22
|
+
member_name = member.name.relative!.to_s
|
23
|
+
object_mixins[member_name] = true
|
24
|
+
set_object_mixins_recursive(store, member_name, object_mixins)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
21
28
|
end
|
22
29
|
end
|
data/lib/orthoses/constant.rb
CHANGED
@@ -27,10 +27,14 @@ module Orthoses
|
|
27
27
|
Orthoses::Utils.each_const_recursive(base, on_error: @on_error) do |current, const, val|
|
28
28
|
next if current.singleton_class?
|
29
29
|
next if Utils.module_name(current).nil?
|
30
|
-
next if val.kind_of?(Module)
|
31
30
|
next if cache[[current, const]]
|
32
31
|
cache[[current, const]] = true
|
33
32
|
|
33
|
+
if val.kind_of?(Module)
|
34
|
+
will_add_key_and_content << [Utils.module_name(val), nil]
|
35
|
+
next
|
36
|
+
end
|
37
|
+
|
34
38
|
rbs = Orthoses::Utils.object_to_rbs(val, strict: @strict)
|
35
39
|
next unless rbs
|
36
40
|
next unless @if.nil? || @if.call(current, const, val, rbs)
|
@@ -38,8 +42,12 @@ module Orthoses
|
|
38
42
|
will_add_key_and_content << [Utils.module_name(current), "#{const}: #{rbs}"]
|
39
43
|
end
|
40
44
|
end
|
45
|
+
|
41
46
|
will_add_key_and_content.each do |name, line|
|
42
|
-
|
47
|
+
next unless name
|
48
|
+
content = store[name]
|
49
|
+
next unless line
|
50
|
+
content << line
|
43
51
|
end
|
44
52
|
end
|
45
53
|
end
|
data/lib/orthoses/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::CallTracer
|
4
|
-
attr_accessor result: Array[[ Method, Hash[Symbol, untyped] ]]
|
5
4
|
def initialize: () -> void
|
6
5
|
|
7
6
|
def trace: [T] (Method | UnboundMethod) ?{ () -> T } -> T
|
7
|
+
attr_accessor result: Array[[ Method, Hash[Symbol, untyped] ]]
|
8
8
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::ConstLoadError < ::StandardError
|
4
|
+
def initialize: (root: Module, const: Symbol, error: untyped) -> void
|
5
|
+
def message: () -> ::String
|
4
6
|
attr_reader root: Module
|
5
7
|
attr_reader const: Symbol
|
6
8
|
attr_reader error: untyped
|
7
|
-
def initialize: (root: Module, const: Symbol, error: untyped) -> void
|
8
|
-
def message: () -> ::String
|
9
9
|
end
|
data/sig/orthoses/content.rbs
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::Content
|
4
|
-
attr_reader name: String
|
5
|
-
attr_reader body: Array[String]
|
6
|
-
attr_accessor header: String?
|
7
4
|
def initialize: (name: String) -> void
|
8
5
|
def <<: (String) -> void
|
9
6
|
def concat: (Array[String]) -> void
|
@@ -18,4 +15,7 @@ class Orthoses::Content
|
|
18
15
|
def auto_header: () -> (nil | untyped)
|
19
16
|
def temporary_type_params: (untyped name) -> untyped
|
20
17
|
def type_params: (untyped name) -> untyped
|
18
|
+
attr_reader name: String
|
19
|
+
attr_reader body: Array[String]
|
20
|
+
attr_accessor header: String?
|
21
21
|
end
|
data/sig/orthoses/utils.rbs
CHANGED
@@ -11,14 +11,10 @@ module Orthoses::Utils
|
|
11
11
|
|
12
12
|
def self.rbs_type_name: (String) -> RBS::TypeName
|
13
13
|
|
14
|
-
attr_accessor self.rbs_collection_pathname: Pathname
|
15
|
-
|
16
14
|
def self.rbs_environment: (?library: String | Array[String] | nil, ?collection: boolish, ?cache: boolish) -> RBS::Environment
|
17
15
|
|
18
16
|
def self.object_to_rbs: (untyped object, strict: bool) -> String
|
19
17
|
|
20
|
-
UNBOUND_NAME_METHOD: UnboundMethod
|
21
|
-
|
22
18
|
def self.module_name: (Module mod) -> String?
|
23
19
|
|
24
20
|
def self.module_to_type_name: (Module) -> RBS::TypeName?
|
@@ -26,4 +22,8 @@ module Orthoses::Utils
|
|
26
22
|
def self.known_type_params: (Module | String) -> Array[RBS::AST::TypeParam]
|
27
23
|
|
28
24
|
def self.new_store: () -> Orthoses::store
|
25
|
+
|
26
|
+
UNBOUND_NAME_METHOD: UnboundMethod
|
27
|
+
|
28
|
+
attr_accessor self.rbs_collection_pathname: Pathname
|
29
29
|
end
|
data/sig/orthoses.rbs
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orthoses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ksss
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbs
|