orthoses 1.2.0 → 1.4.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 +20 -8
- data/lib/orthoses/content.rb +5 -1
- data/lib/orthoses/create_file_by_name.rb +1 -1
- data/lib/orthoses/outputable/constantizable_filter.rb +32 -0
- data/lib/orthoses/outputable/uniq_content_body.rb +1 -6
- data/lib/orthoses/outputable.rb +2 -0
- data/lib/orthoses/version.rb +1 -1
- data/sig/orthoses/attribute/hook.rbs +3 -0
- data/sig/orthoses/call_tracer/capturable.rbs +2 -0
- data/sig/orthoses/content.rbs +1 -0
- data/sig/orthoses/mixin/hook.rbs +2 -0
- data/sig/orthoses/outputable/constantizable_filter.rbs +6 -0
- data/sig/orthoses/utils.rbs +12 -0
- data/sig/orthoses.rbs +5 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ee37ddf25be5bbed113698301a2aeafb3b50e7af1da412b9a1fc6afad18d8c2
|
4
|
+
data.tar.gz: '075957101080441e02f4129303e766ecdfe1e7f30616177bc41a2cbf41f521f8'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98c1cff14563ecf14713890e56bddb053d6f128aacad7ff23b6f96cc8b2c338cbea511cc668ac18079ec921cb0183b145f6b26a3c04403a98e8aa0bf734942f7
|
7
|
+
data.tar.gz: 5dd573a63a6998e3a1fac1dd94f292dd80742185277124f6449ded149be662b74995815bad629157fc553cb8bef15bb31b123fdbcdccb1af3dff4d2645bc0da2
|
data/Gemfile.lock
CHANGED
@@ -1,51 +1,63 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
orthoses (1.
|
4
|
+
orthoses (1.4.0)
|
5
5
|
rbs (~> 2.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (7.0.
|
10
|
+
activesupport (7.0.4)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (>= 1.6, < 2)
|
13
13
|
minitest (>= 5.1)
|
14
14
|
tzinfo (~> 2.0)
|
15
15
|
ast (2.4.2)
|
16
16
|
concurrent-ruby (1.1.10)
|
17
|
+
csv (3.2.5)
|
17
18
|
ffi (1.15.5)
|
19
|
+
fileutils (1.6.0)
|
18
20
|
i18n (1.12.0)
|
19
21
|
concurrent-ruby (~> 1.0)
|
20
|
-
|
22
|
+
json (2.6.2)
|
23
|
+
language_server-protocol (3.17.0.1)
|
21
24
|
listen (3.7.1)
|
22
25
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
23
26
|
rb-inotify (~> 0.9, >= 0.9.10)
|
27
|
+
logger (1.5.1)
|
24
28
|
minitest (5.16.3)
|
25
29
|
parallel (1.22.1)
|
26
30
|
parser (3.1.2.1)
|
27
31
|
ast (~> 2.4.1)
|
28
32
|
rainbow (3.1.1)
|
29
33
|
rake (13.0.6)
|
30
|
-
rb-fsevent (0.11.
|
34
|
+
rb-fsevent (0.11.2)
|
31
35
|
rb-inotify (0.10.1)
|
32
36
|
ffi (~> 1.0)
|
33
|
-
rbs (2.
|
37
|
+
rbs (2.7.0)
|
34
38
|
rgot (1.1.0)
|
35
|
-
|
39
|
+
securerandom (0.2.0)
|
40
|
+
steep (1.2.1)
|
36
41
|
activesupport (>= 5.1)
|
42
|
+
csv (>= 3.0.9)
|
43
|
+
fileutils (>= 1.1.0)
|
44
|
+
json (>= 2.1.0)
|
37
45
|
language_server-protocol (>= 3.15, < 4.0)
|
38
46
|
listen (~> 3.0)
|
47
|
+
logger (>= 1.3.0)
|
39
48
|
parallel (>= 1.0.0)
|
40
49
|
parser (>= 3.1)
|
41
50
|
rainbow (>= 2.2.2, < 4.0)
|
42
|
-
rbs (>= 2.
|
51
|
+
rbs (>= 2.7.0)
|
52
|
+
securerandom (>= 0.1)
|
53
|
+
strscan (>= 1.0.0)
|
43
54
|
terminal-table (>= 2, < 4)
|
55
|
+
strscan (3.0.4)
|
44
56
|
terminal-table (3.0.2)
|
45
57
|
unicode-display_width (>= 1.1.1, < 3)
|
46
58
|
tzinfo (2.0.5)
|
47
59
|
concurrent-ruby (~> 1.0)
|
48
|
-
unicode-display_width (2.
|
60
|
+
unicode-display_width (2.3.0)
|
49
61
|
|
50
62
|
PLATFORMS
|
51
63
|
ruby
|
data/lib/orthoses/content.rb
CHANGED
@@ -41,6 +41,10 @@ module Orthoses
|
|
41
41
|
@body.empty?
|
42
42
|
end
|
43
43
|
|
44
|
+
def interface?
|
45
|
+
@name.split('::').last.start_with?('_')
|
46
|
+
end
|
47
|
+
|
44
48
|
def delete(val)
|
45
49
|
@body.delete(val)
|
46
50
|
end
|
@@ -123,7 +127,7 @@ module Orthoses
|
|
123
127
|
|
124
128
|
return unless @header.nil?
|
125
129
|
|
126
|
-
if
|
130
|
+
if interface?
|
127
131
|
self.header = "interface #{name}"
|
128
132
|
return
|
129
133
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Orthoses
|
4
|
+
module Outputable
|
5
|
+
# Constantizable is an internal middleware
|
6
|
+
# It's using on orthoses/outputable.rb
|
7
|
+
class ConstantizableFilter
|
8
|
+
def initialize(loader)
|
9
|
+
@loader = loader
|
10
|
+
end
|
11
|
+
|
12
|
+
def call
|
13
|
+
@loader.call.tap do |store|
|
14
|
+
failures = []
|
15
|
+
store.each do |name, content|
|
16
|
+
next if content.header
|
17
|
+
next if content.interface?
|
18
|
+
|
19
|
+
begin
|
20
|
+
Object.const_get(name)
|
21
|
+
rescue NameError, LoadError => err
|
22
|
+
Orthoses.logger.error(err.inspect)
|
23
|
+
failures << name
|
24
|
+
next
|
25
|
+
end
|
26
|
+
end
|
27
|
+
failures.each { |name| store.delete(name) }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/orthoses/outputable.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'orthoses/outputable/avoid_recursive_ancestor_error'
|
4
|
+
require 'orthoses/outputable/constantizable_filter'
|
4
5
|
require 'orthoses/outputable/uniq_content_body'
|
5
6
|
|
6
7
|
module Orthoses
|
@@ -16,6 +17,7 @@ module Orthoses
|
|
16
17
|
module Outputable
|
17
18
|
def call
|
18
19
|
@loader = AvoidRecursiveAncestorError.new(@loader)
|
20
|
+
@loader = ConstantizableFilter.new(@loader)
|
19
21
|
@loader = UniqContentBody.new(@loader)
|
20
22
|
super
|
21
23
|
end
|
data/lib/orthoses/version.rb
CHANGED
data/sig/orthoses/content.rbs
CHANGED
data/sig/orthoses/mixin/hook.rbs
CHANGED
data/sig/orthoses/utils.rbs
CHANGED
@@ -2,16 +2,28 @@
|
|
2
2
|
|
3
3
|
module Orthoses::Utils
|
4
4
|
def self.unautoload!: () -> untyped
|
5
|
+
|
5
6
|
def self.each_const_recursive: (Module root, ?cache: Hash[untyped, true], ?on_error: ^(Orthoses::ConstLoadError) -> void) ?{ (Module, Symbol, untyped) -> void } -> void
|
7
|
+
|
6
8
|
def self.rbs_defined_const?: (String name, ?library: (String | Array[String])?, ?collection: boolish) -> bool
|
9
|
+
|
7
10
|
def self.rbs_defined_class?: (String name, ?library: (String | Array[String])?, ?collection: boolish) -> bool
|
11
|
+
|
8
12
|
def self.rbs_type_name: (String) -> RBS::TypeName
|
13
|
+
|
9
14
|
def self.rbs_environment: (?library: String | Array[String] | nil, ?collection: boolish, ?cache: boolish) -> RBS::Environment
|
15
|
+
|
10
16
|
def self.object_to_rbs: (untyped object, strict: bool) -> String
|
17
|
+
|
11
18
|
def self.module_name: (Module mod) -> String?
|
19
|
+
|
12
20
|
def self.module_to_type_name: (Module) -> RBS::TypeName?
|
21
|
+
|
13
22
|
def self.known_type_params: (Module | String) -> Array[RBS::AST::TypeParam]?
|
23
|
+
|
14
24
|
def self.new_store: () -> Orthoses::store
|
25
|
+
|
15
26
|
UNBOUND_NAME_METHOD: UnboundMethod
|
27
|
+
|
16
28
|
attr_accessor self.rbs_collection_pathname: Pathname
|
17
29
|
end
|
data/sig/orthoses.rbs
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
module Orthoses
|
4
|
-
VERSION: "1.
|
4
|
+
VERSION: "1.4.0"
|
5
|
+
|
5
6
|
attr_accessor self.logger: ::Logger
|
7
|
+
|
6
8
|
type store = Hash[String, Orthoses::Content]
|
9
|
+
|
7
10
|
INSTANCE_METHOD_METHOD: UnboundMethod
|
11
|
+
|
8
12
|
METHOD_METHOD: UnboundMethod
|
9
13
|
end
|
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: 1.
|
4
|
+
version: 1.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: 2022-10-
|
11
|
+
date: 2022-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbs
|
@@ -60,6 +60,7 @@ files:
|
|
60
60
|
- lib/orthoses/object_space_all.rb
|
61
61
|
- lib/orthoses/outputable.rb
|
62
62
|
- lib/orthoses/outputable/avoid_recursive_ancestor_error.rb
|
63
|
+
- lib/orthoses/outputable/constantizable_filter.rb
|
63
64
|
- lib/orthoses/outputable/uniq_content_body.rb
|
64
65
|
- lib/orthoses/path_helper.rb
|
65
66
|
- lib/orthoses/pp.rb
|
@@ -105,6 +106,7 @@ files:
|
|
105
106
|
- sig/orthoses/object_space_all.rbs
|
106
107
|
- sig/orthoses/outputable.rbs
|
107
108
|
- sig/orthoses/outputable/avoid_recursive_ancestor_error.rbs
|
109
|
+
- sig/orthoses/outputable/constantizable_filter.rbs
|
108
110
|
- sig/orthoses/outputable/uniq_content_body.rbs
|
109
111
|
- sig/orthoses/path_helper.rbs
|
110
112
|
- sig/orthoses/pp.rbs
|