orthoses 0.5.0 → 0.6.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/orthoses/utils.rb +25 -3
- data/lib/orthoses/version.rb +1 -1
- data/sig/orthoses/_call.rbs +1 -1
- data/sig/orthoses/attribute/hook.rbs +7 -0
- data/sig/orthoses/attribute.rbs +5 -0
- data/sig/orthoses/avoid_recursive_ancestor_error.rbs +2 -2
- data/sig/orthoses/builder/call_logable.rbs +1 -0
- data/sig/orthoses/builder.rbs +5 -0
- data/sig/orthoses/call_tracer.rbs +2 -0
- data/sig/orthoses/const_load_error.rbs +1 -0
- data/sig/orthoses/constant.rbs +5 -2
- data/sig/orthoses/content/duplication_checker.rbs +6 -0
- data/sig/orthoses/content/environment.rbs +14 -4
- data/sig/orthoses/content/header_builder.rbs +9 -0
- data/sig/orthoses/content.rbs +7 -0
- data/sig/orthoses/create_file_by_name.rbs +2 -2
- data/sig/orthoses/delegate_class.rbs +3 -2
- data/sig/orthoses/filter.rbs +2 -2
- data/sig/orthoses/load_rbs.rbs +2 -2
- data/sig/orthoses/mixin.rbs +2 -0
- data/sig/orthoses/object_space_all.rbs +2 -2
- data/sig/orthoses/pp.rbs +2 -0
- data/sig/orthoses/rbs_prototype_rb.rbs +3 -2
- data/sig/orthoses/store.rbs +2 -0
- data/sig/orthoses/tap.rbs +2 -2
- data/sig/orthoses/utils.rbs +6 -4
- data/sig/orthoses/walk.rbs +2 -2
- data/sig/orthoses/writer.rbs +2 -2
- data/sig/orthoses.rbs +2 -2
- 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: 3fe5907a7edff87d73372b0e6f556d5f3b08a3ae6d7407447f249a25953d069e
|
4
|
+
data.tar.gz: 7564345ffdc6363a5ba03bb9c70299b17cb15cdb3cc501bcbd3b221c7b0a823a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35acabbfbd4ab4c549d8cefdecc829074ade2bc041093432b3a1ae52c095f1d2e8a4420d30754dfd0a1dfb9d09f999fb2885b4f87c7e14c2c3386afff886082f
|
7
|
+
data.tar.gz: 01f8881d042a106e720574902abc2227161c65c78b35277618aea2343f8be43dfdcb4d94735ce2f5a7fd62ffb5137e5c928e0bd1e9dd50cd583ecd6819c80d38
|
data/Gemfile.lock
CHANGED
data/lib/orthoses/utils.rb
CHANGED
@@ -46,6 +46,28 @@ module Orthoses
|
|
46
46
|
RBS::Namespace.parse(name).to_type_name
|
47
47
|
end
|
48
48
|
|
49
|
+
class << self
|
50
|
+
# Generated scripts are not always located in the root.
|
51
|
+
# By default, it follows the upper level directory from the current directory
|
52
|
+
# to find the rbs_collection.yaml file and set it to `rbs_collection_pathname`.
|
53
|
+
# It can be reconfigured if necessary.
|
54
|
+
attr_accessor :rbs_collection_pathname
|
55
|
+
end
|
56
|
+
# set default
|
57
|
+
self.rbs_collection_pathname = ->() {
|
58
|
+
begin
|
59
|
+
start = here = Dir.pwd
|
60
|
+
until ok = RBS::Collection::Config::PATH.exist?
|
61
|
+
Dir.chdir("..")
|
62
|
+
return nil if Dir.pwd == here
|
63
|
+
here = Dir.pwd
|
64
|
+
end
|
65
|
+
Pathname(here) + RBS::Collection::Config::PATH
|
66
|
+
ensure
|
67
|
+
Dir.chdir(start)
|
68
|
+
end
|
69
|
+
}.call
|
70
|
+
|
49
71
|
def self.rbs_environment(library: nil, collection: false, cache: true)
|
50
72
|
@env_cache ||= {}
|
51
73
|
if cache && hit = @env_cache[[library, collection]]
|
@@ -54,9 +76,9 @@ module Orthoses
|
|
54
76
|
|
55
77
|
loader = RBS::EnvironmentLoader.new
|
56
78
|
|
57
|
-
if collection
|
58
|
-
|
59
|
-
loader.add_collection(
|
79
|
+
if collection && rbs_collection_pathname
|
80
|
+
config = RBS::Collection::Config.lockfile_of(rbs_collection_pathname) or raise
|
81
|
+
loader.add_collection(config)
|
60
82
|
end
|
61
83
|
|
62
84
|
case library
|
data/lib/orthoses/version.rb
CHANGED
data/sig/orthoses/_call.rbs
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
module Orthoses::Attribute::Hook
|
4
|
+
def attr: (*untyped names) -> untyped
|
5
|
+
|
6
|
+
def attr_accessor: (*untyped names) -> untyped
|
7
|
+
|
8
|
+
def attr_reader: (*untyped names) -> untyped
|
9
|
+
|
10
|
+
def attr_writer: (*untyped names) -> untyped
|
4
11
|
end
|
data/sig/orthoses/attribute.rbs
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::Attribute
|
4
|
+
def initialize: (Orthoses::_Call loader) -> void
|
5
|
+
def call: () -> Orthoses::store
|
6
|
+
private
|
7
|
+
def each_definition: (untyped call_tracer) { (untyped) -> untyped } -> untyped
|
8
|
+
@loader: Orthoses::_Call
|
4
9
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::AvoidRecursiveAncestorError
|
4
|
-
@loader: Orthoses::_Call
|
5
|
-
include Orthoses::_MiddleWare
|
6
4
|
def initialize: (Orthoses::_Call loader) -> void
|
5
|
+
def call: () -> Orthoses::store
|
6
|
+
@loader: Orthoses::_Call
|
7
7
|
end
|
data/sig/orthoses/builder.rbs
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::Builder
|
4
|
+
def initialize: () { () -> untyped } -> void
|
5
|
+
def use: (untyped middleware, *untyped args, **untyped key) { () -> untyped } -> untyped
|
6
|
+
def run: (untyped loader) -> untyped
|
7
|
+
def to_loader: () -> untyped
|
8
|
+
|
4
9
|
def call: () { () -> void } -> Orthoses::store
|
5
10
|
end
|
data/sig/orthoses/constant.rbs
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::Constant
|
4
|
+
def initialize: (Orthoses::_Call loader, strict: bool, ?if: ^(Module, Symbol, untyped) -> boolish, ?on_error: ^(Orthoses::ConstLoadError) -> void) -> void
|
5
|
+
def call: () -> Orthoses::store
|
4
6
|
@loader: Orthoses::_Call
|
5
|
-
|
6
|
-
|
7
|
+
@strict: bool
|
8
|
+
@if: ^(Module mod, Symbol const, untyped val, String rbs) -> boolish?
|
9
|
+
@on_error: ^(Orthoses::ConstLoadError) -> void | nil
|
7
10
|
end
|
@@ -1,4 +1,10 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::Content::DuplicationChecker
|
4
|
+
def initialize: (untyped decl) -> void
|
5
|
+
def update_decl: () -> untyped
|
6
|
+
private
|
7
|
+
def drop_known_method_definition: (untyped uniq_map) -> untyped
|
8
|
+
def member_to_s: (untyped member) -> untyped
|
9
|
+
def member_key: (untyped member) -> untyped
|
4
10
|
end
|
@@ -1,13 +1,23 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::Content::Environment
|
4
|
+
def self.load_from_paths: (untyped paths) -> untyped
|
5
|
+
|
6
|
+
def initialize: (?constant_filter: constant_filter?, ?mixin_filter: mixin_filter?, ?attribute_filter: attribute_filter?) -> void
|
7
|
+
def <<: (RBS::AST::Declarations::t decl) -> RBS::Environment
|
8
|
+
def write_to: (store: Orthoses::store) -> void
|
9
|
+
def each: () { (Orthoses::Content) -> void } -> void
|
10
|
+
private
|
11
|
+
# Avoid `RBS::GenericParameterMismatchError` from like rbs_prototype_rb
|
12
|
+
# class Array # <= RBS::GenericParameterMismatchError
|
13
|
+
# end
|
14
|
+
def avoid_generic_parameter_mismatch_error: () -> untyped
|
15
|
+
def decls_to_lines: (untyped decls) -> untyped
|
4
16
|
type constant_filter = ^(RBS::AST::Declarations::Constant) -> boolish
|
5
17
|
type mixin_filter = ^(RBS::AST::Members::Mixin) -> boolish
|
18
|
+
type attribute_filter = ^(RBS::AST::Members::Attribute) -> boolish
|
6
19
|
@env: RBS::Environment
|
7
20
|
@constant_filter: constant_filter?
|
8
21
|
@mixin_filter: mixin_filter?
|
9
|
-
|
10
|
-
def <<: (RBS::AST::Declarations::t decl) -> RBS::Environment
|
11
|
-
def write_to: (store: Orthoses::store) -> void
|
12
|
-
def each: () { (Orthoses::Content) -> void } -> void
|
22
|
+
@attribute_filter: attribute_filter?
|
13
23
|
end
|
@@ -1,4 +1,13 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::Content::HeaderBuilder
|
4
|
+
def initialize: (env: untyped) -> void
|
5
|
+
def build: (entry: untyped, ?name_hint: untyped?) -> untyped
|
6
|
+
private
|
7
|
+
def build_module: (entry: untyped, ?name_hint: untyped?) -> ::String
|
8
|
+
def build_class: (entry: untyped, ?name_hint: untyped?) -> ::String
|
9
|
+
def build_super_class: (untyped primary) -> (nil | untyped)
|
10
|
+
def build_interface: (entry: untyped, ?name_hint: untyped?) -> ::String
|
11
|
+
def name_and_params: (untyped name, untyped params) -> ::String
|
12
|
+
def name_and_args: (untyped name, untyped args) -> (::String | nil)
|
4
13
|
end
|
data/sig/orthoses/content.rbs
CHANGED
@@ -8,7 +8,14 @@ class Orthoses::Content
|
|
8
8
|
def <<: (String) -> void
|
9
9
|
def concat: (Array[String]) -> void
|
10
10
|
def to_rbs: () -> String
|
11
|
+
def to_decl: () -> untyped
|
12
|
+
|
11
13
|
private
|
14
|
+
def original_rbs: () -> ::String
|
15
|
+
|
12
16
|
def uniqed_body_string: () -> String
|
13
17
|
def uniqed_body_decl: () -> RBS::AST::Declarations::t
|
18
|
+
def auto_header: () -> (nil | untyped)
|
19
|
+
def temporary_type_params: (untyped name) -> untyped
|
20
|
+
def type_params: (untyped name) -> untyped
|
14
21
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::CreateFileByName
|
4
|
-
@loader: Orthoses::_Call
|
5
|
-
include Orthoses::_MiddleWare
|
6
4
|
def initialize: (Orthoses::_Call loader, base_dir: String, ?header: String?) -> void
|
5
|
+
def call: () -> Orthoses::store
|
6
|
+
@loader: Orthoses::_Call
|
7
7
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::DelegateClass
|
4
|
-
@loader: Orthoses::_Call
|
5
|
-
include Orthoses::_MiddleWare
|
6
4
|
def initialize: (Orthoses::_Call loader) -> void
|
5
|
+
def call: () -> Orthoses::store
|
6
|
+
def temporary_type_params: (untyped name) -> untyped
|
7
|
+
@loader: Orthoses::_Call
|
7
8
|
end
|
data/sig/orthoses/filter.rbs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::Filter
|
4
|
-
@loader: Orthoses::_Call
|
5
|
-
include Orthoses::_MiddleWare
|
6
4
|
def initialize: (Orthoses::_Call loader, if: ^(String, Orthoses::Content) -> boolish) -> void
|
5
|
+
def call: () -> Orthoses::store
|
6
|
+
@loader: Orthoses::_Call
|
7
7
|
end
|
data/sig/orthoses/load_rbs.rbs
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::LoadRBS
|
4
|
+
def initialize: (Orthoses::_Call loader, paths: Array[_ToS]) -> void
|
5
|
+
def call: () -> Orthoses::store
|
4
6
|
@loader: Orthoses::_Call
|
5
7
|
@paths: Array[_ToS]
|
6
|
-
include Orthoses::_MiddleWare
|
7
|
-
def initialize: (Orthoses::_Call loader, paths: Array[_ToS]) -> void
|
8
8
|
end
|
data/sig/orthoses/mixin.rbs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::ObjectSpaceAll
|
4
|
-
@loader: Orthoses::_Call
|
5
|
-
include Orthoses::_MiddleWare
|
6
4
|
def initialize: (Orthoses::_Call loader, ?if: ^(Module) -> boolish) -> void
|
5
|
+
def call: () -> Orthoses::store
|
6
|
+
@loader: Orthoses::_Call
|
7
7
|
end
|
data/sig/orthoses/pp.rbs
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::RBSPrototypeRB
|
4
|
+
def initialize: (Orthoses::_Call loader, paths: Array[_ToS], ?constant_filter: Orthoses::Content::Environment::constant_filter?, ?mixin_filter: Orthoses::Content::Environment::mixin_filter?, ?attribute_filter: Orthoses::Content::Environment::attribute_filter?) -> void
|
5
|
+
def call: () -> Orthoses::store
|
4
6
|
@loader: Orthoses::_Call
|
5
|
-
include Orthoses::_MiddleWare
|
6
|
-
def initialize: (Orthoses::_Call loader, paths: Array[_ToS], ?constant_filter: Orthoses::Content::Environment::constant_filter?, ?mixin_filter: Orthoses::Content::Environment::mixin_filter?) -> void
|
7
7
|
@paths: Array[_ToS]
|
8
8
|
@constant_filter: Orthoses::Content::Environment::constant_filter?
|
9
9
|
@mixin_filter: Orthoses::Content::Environment::mixin_filter?
|
10
|
+
@attribute_filter: Orthoses::Content::Environment::mixin_filter?
|
10
11
|
end
|
data/sig/orthoses/store.rbs
CHANGED
data/sig/orthoses/tap.rbs
CHANGED
data/sig/orthoses/utils.rbs
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Orthoses::Utils
|
4
4
|
def self.unautoload!: () -> void
|
5
5
|
|
6
|
-
def self.each_const_recursive: (Module root, ?cache: Hash[untyped, true], ?on_error: ^(Orthoses::ConstLoadError) -> void
|
6
|
+
def self.each_const_recursive: (Module root, ?cache: Hash[untyped, true], ?on_error: ^(Orthoses::ConstLoadError) -> void) ?{ (Module, Symbol, untyped) -> void } -> void
|
7
7
|
|
8
8
|
def self.rbs_defined_const?: (String name, ?library: (String | Array[String])?, ?collection: boolish) -> bool
|
9
9
|
|
@@ -11,10 +11,14 @@ module Orthoses::Utils
|
|
11
11
|
|
12
12
|
def self.rbs_type_name: (String) -> RBS::TypeName
|
13
13
|
|
14
|
-
|
14
|
+
attr_accessor self.rbs_collection_pathname: Pathname
|
15
|
+
|
16
|
+
def self.rbs_environment: (?library: String | Array[String] | nil, ?collection: boolish, ?cache: boolish) -> RBS::Environment
|
15
17
|
|
16
18
|
def self.object_to_rbs: (untyped object, strict: bool) -> String
|
17
19
|
|
20
|
+
UNBOUND_NAME_METHOD: UnboundMethod
|
21
|
+
|
18
22
|
def self.module_name: (Module mod) -> String?
|
19
23
|
|
20
24
|
def self.module_to_type_name: (Module) -> RBS::TypeName?
|
@@ -22,6 +26,4 @@ module Orthoses::Utils
|
|
22
26
|
def self.known_type_params: (Module | String) -> Array[RBS::AST::TypeParam]
|
23
27
|
|
24
28
|
def self.new_store: () -> Orthoses::store
|
25
|
-
|
26
|
-
UNBOUND_NAME_METHOD: UnboundMethod
|
27
29
|
end
|
data/sig/orthoses/walk.rbs
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::Walk
|
4
|
+
def initialize: (Orthoses::_Call loader, root: Module | String) -> void
|
5
|
+
def call: () -> Orthoses::store
|
4
6
|
@loader: Orthoses::_Call
|
5
7
|
@root: Module | String
|
6
|
-
include Orthoses::_MiddleWare
|
7
|
-
def initialize: (Orthoses::_Call loader, root: Module | String) -> void
|
8
8
|
end
|
data/sig/orthoses/writer.rbs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# THIS IS GENERATED CODE from `$ rake generate_self_sig`
|
2
2
|
|
3
3
|
class Orthoses::Writer
|
4
|
-
@loader: Orthoses::_Call
|
5
|
-
include Orthoses::_MiddleWare
|
6
4
|
def initialize: (Orthoses::_Call loader, io: _Writer) -> void
|
5
|
+
def call: () -> Orthoses::store
|
6
|
+
@loader: Orthoses::_Call
|
7
7
|
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.6.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-
|
11
|
+
date: 2022-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbs
|