orthoses 0.8.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +12 -12
  4. data/README.md +41 -1
  5. data/lib/orthoses/attribute.rb +0 -2
  6. data/lib/orthoses/autoload.rb +37 -0
  7. data/lib/orthoses/call_tracer/capturable.rb +42 -0
  8. data/lib/orthoses/call_tracer/lazy.rb +22 -0
  9. data/lib/orthoses/call_tracer.rb +9 -33
  10. data/lib/orthoses/content/duplication_checker.rb +15 -9
  11. data/lib/orthoses/content/header_builder.rb +12 -7
  12. data/lib/orthoses/content.rb +41 -11
  13. data/lib/orthoses/create_file_by_name.rb +12 -4
  14. data/lib/orthoses/lazy_trace_point.rb +103 -0
  15. data/lib/orthoses/load_rbs.rb +3 -1
  16. data/lib/orthoses/mixin.rb +2 -2
  17. data/lib/orthoses/object_space_all.rb +1 -3
  18. data/lib/orthoses/outputable/avoid_recursive_ancestor_error.rb +37 -0
  19. data/lib/orthoses/outputable.rb +21 -0
  20. data/lib/orthoses/path_helper.rb +38 -0
  21. data/lib/orthoses/rbs_prototype_runtime.rb +32 -0
  22. data/lib/orthoses/utils.rb +9 -4
  23. data/lib/orthoses/version.rb +1 -1
  24. data/lib/orthoses/writer.rb +2 -0
  25. data/lib/orthoses.rb +10 -1
  26. data/sig/orthoses/attribute/hook.rbs +0 -3
  27. data/sig/orthoses/autoload/hook.rbs +5 -0
  28. data/sig/orthoses/autoload.rbs +6 -0
  29. data/sig/orthoses/builder.rbs +0 -1
  30. data/sig/orthoses/call_tracer/capturable.rbs +7 -0
  31. data/sig/orthoses/call_tracer/lazy.rbs +6 -0
  32. data/sig/orthoses/call_tracer.rbs +0 -1
  33. data/sig/orthoses/content/array_io.rbs +7 -0
  34. data/sig/orthoses/content/duplication_checker.rbs +2 -3
  35. data/sig/orthoses/content/environment.rbs +0 -1
  36. data/sig/orthoses/content/header_builder.rbs +1 -0
  37. data/sig/orthoses/content.rbs +4 -2
  38. data/sig/orthoses/lazy_trace_point.rbs +15 -0
  39. data/sig/orthoses/load_rbs.rbs +3 -2
  40. data/sig/orthoses/mixin/hook.rbs +0 -2
  41. data/sig/orthoses/{avoid_recursive_ancestor_error.rbs → outputable/avoid_recursive_ancestor_error.rbs} +2 -2
  42. data/sig/orthoses/outputable.rbs +5 -0
  43. data/sig/orthoses/path_helper.rbs +9 -0
  44. data/sig/orthoses/rbs_prototype_runtime.rbs +6 -0
  45. data/sig/orthoses/utils.rbs +1 -13
  46. data/sig/orthoses.rbs +3 -3
  47. metadata +21 -5
  48. data/lib/orthoses/avoid_recursive_ancestor_error.rb +0 -29
@@ -2,9 +2,8 @@
2
2
 
3
3
  module Orthoses
4
4
  class ObjectSpaceAll
5
- def initialize(loader, if: nil)
5
+ def initialize(loader)
6
6
  @loader = loader
7
- @if = binding.local_variable_get(:if)
8
7
  end
9
8
 
10
9
  def call
@@ -14,7 +13,6 @@ module Orthoses
14
13
  after_modules.each do |mod|
15
14
  mod_name = Utils.module_name(mod)
16
15
  next if mod_name.nil?
17
- next unless @if.nil? || @if.call(mod)
18
16
 
19
17
  store[mod_name]
20
18
  end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orthoses
4
+ module Outputable
5
+ # AvoidRecursiveAncestorError is an internal middleware
6
+ # It's using on orthoses/outputable.rb
7
+ class AvoidRecursiveAncestorError
8
+ def initialize(loader)
9
+ @loader = loader
10
+ end
11
+
12
+ def call
13
+ @loader.call.tap do |store|
14
+ object_mixins = {}
15
+ collect_mixin_recursive(store, "Object", object_mixins)
16
+
17
+ object_mixins.each_key do |object_mixin|
18
+ store[object_mixin].header = "module #{object_mixin} : BasicObject"
19
+ end
20
+ end
21
+ end
22
+
23
+ private
24
+
25
+ def collect_mixin_recursive(store, name, mixins)
26
+ store[name].to_decl.members.each do |member|
27
+ case member
28
+ when RBS::AST::Members::Mixin
29
+ member_name = member.name.relative!.to_s
30
+ mixins[member_name] = true
31
+ collect_mixin_recursive(store, member_name, mixins)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'orthoses/outputable/avoid_recursive_ancestor_error'
4
+
5
+ module Orthoses
6
+ # Module for output middleware.
7
+ # Call internal some middleware on output phase.
8
+ # class Sample
9
+ # prepend Outputable
10
+ #
11
+ # def initialize(loader)
12
+ # ...
13
+ # def call
14
+ # ...
15
+ module Outputable
16
+ def call
17
+ @loader = AvoidRecursiveAncestorError.new(@loader)
18
+ super
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Helper for find best version dir.
4
+ # Orthoses::PathHelper.best_version_paths(
5
+ # ::ActiveSupport::VERSION::STRING,
6
+ # "known_sig/activesupport")
7
+ module Orthoses
8
+ class PathHelper
9
+ class << self
10
+ def best_version_paths(current, base_dir)
11
+ new(current, base_dir).best_version_paths
12
+ end
13
+ end
14
+
15
+ def initialize(current, base_dir)
16
+ @current = current
17
+ @base_dir = base_dir
18
+ end
19
+
20
+ def best_version_paths
21
+ best_version = find_best_version
22
+ Dir.glob("#{@base_dir}/#{best_version}/**/*.rbs")
23
+ end
24
+
25
+ def find_best_version
26
+ current_v = Gem::Version.new(@current)
27
+ versions = version_dir
28
+ versions.reverse.bsearch { |v| v <= current_v } || versions.first
29
+ end
30
+
31
+ def version_dir
32
+ Dir.glob("#{@base_dir}/*")
33
+ .map(&File.method(:basename))
34
+ .map(&Gem::Version.method(:new))
35
+ .sort
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,32 @@
1
+ module Orthoses
2
+ # Call `rbs prototype runtime` and add to store
3
+ # use Orthoses::RBSPrototypeRuntime,
4
+ # patterns: ['Foo::*']
5
+ class RBSPrototypeRuntime
6
+ def initialize(loader, patterns:)
7
+ @loader = loader
8
+ @patterns = patterns
9
+ end
10
+
11
+ def call
12
+ @loader.call.tap do |store|
13
+ content_env = Orthoses::Content::Environment.new
14
+
15
+ patterns = @patterns
16
+ env = RBS::Environment.new
17
+ merge = true
18
+ owners_included = []
19
+ RBS::Prototype::Runtime.new(
20
+ patterns: patterns,
21
+ env: env,
22
+ merge: merge,
23
+ owners_included: owners_included,
24
+ ).decls.each do |decl|
25
+ content_env << decl
26
+ end
27
+
28
+ content_env.write_to(store: store)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -3,13 +3,14 @@
3
3
  module Orthoses
4
4
  module Utils
5
5
  def self.unautoload!
6
+ warn "`Orthoses::Utils.unautoload!` is deprecated. please use `Orthoses::Autoload` middleware instead."
6
7
  ObjectSpace.each_object(Module) do |mod|
7
8
  each_const_recursive(mod)
8
9
  end
9
10
  end
10
11
 
11
12
  def self.each_const_recursive(root, cache: {}, on_error: nil, &block)
12
- root.constants(false).each do |const|
13
+ root.constants(false).sort.each do |const|
13
14
  val = root.const_get(const)
14
15
  next if cache[const].equal?(val)
15
16
  cache[const] = val
@@ -101,12 +102,16 @@ module Orthoses
101
102
  def self.object_to_rbs(object, strict:)
102
103
  case object
103
104
  when Class, Module
104
- "singleton(#{object})"
105
+ if name = module_name(object)
106
+ "singleton(#{name})"
107
+ else
108
+ "untyped"
109
+ end
105
110
  when Integer, Symbol, String
106
111
  if strict
107
112
  object.inspect
108
113
  else
109
- Utils.module_name(object.class) || 'untyped'
114
+ module_name(object.class) || 'untyped'
110
115
  end
111
116
  when true, false, nil
112
117
  object.inspect
@@ -151,7 +156,7 @@ module Orthoses
151
156
  # see also https://github.com/ruby/rbs/pull/975
152
157
  'untyped'
153
158
  else
154
- Utils.module_name(object.class) || 'untyped'
159
+ module_name(object.class) || 'untyped'
155
160
  end
156
161
  end
157
162
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orthoses
4
- VERSION = "0.8.0"
4
+ VERSION = "0.11.0"
5
5
  end
@@ -1,5 +1,7 @@
1
1
  module Orthoses
2
2
  class Writer
3
+ prepend Outputable
4
+
3
5
  def initialize(loader, io:)
4
6
  @loader = loader
5
7
  @io = io
data/lib/orthoses.rb CHANGED
@@ -4,7 +4,6 @@ require 'rbs'
4
4
  require 'pathname'
5
5
 
6
6
  require_relative 'orthoses/attribute'
7
- require_relative 'orthoses/avoid_recursive_ancestor_error'
8
7
  require_relative 'orthoses/builder'
9
8
  require_relative 'orthoses/call_tracer'
10
9
  require_relative 'orthoses/constant'
@@ -15,16 +14,26 @@ require_relative 'orthoses/filter'
15
14
  require_relative 'orthoses/mixin'
16
15
  require_relative 'orthoses/load_rbs'
17
16
  require_relative 'orthoses/object_space_all'
17
+ require_relative 'orthoses/outputable'
18
+ require_relative 'orthoses/path_helper'
18
19
  require_relative 'orthoses/pp'
19
20
  require_relative 'orthoses/rbs_prototype_rb'
21
+ require_relative 'orthoses/rbs_prototype_runtime'
20
22
  require_relative 'orthoses/store'
21
23
  require_relative 'orthoses/tap'
24
+ require_relative 'orthoses/autoload'
22
25
  require_relative 'orthoses/utils'
23
26
  require_relative 'orthoses/version'
24
27
  require_relative 'orthoses/walk'
25
28
  require_relative 'orthoses/writer'
26
29
 
27
30
  module Orthoses
31
+ # Use autoload just in case there are side effects.
32
+ autoload :LazyTracePoint, 'orthoses/lazy_trace_point'
33
+
34
+ METHOD_METHOD = ::Kernel.instance_method(:method)
35
+ INSTANCE_METHOD_METHOD = ::Module.instance_method(:instance_method)
36
+
28
37
  class ConstLoadError < StandardError
29
38
  attr_reader :root
30
39
  attr_reader :const
@@ -2,10 +2,7 @@
2
2
 
3
3
  module Orthoses::Attribute::Hook
4
4
  def attr: (*untyped names) -> untyped
5
-
6
5
  def attr_accessor: (*untyped names) -> untyped
7
-
8
6
  def attr_reader: (*untyped names) -> untyped
9
-
10
7
  def attr_writer: (*untyped names) -> untyped
11
8
  end
@@ -0,0 +1,5 @@
1
+ # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
+
3
+ module Orthoses::Autoload::Hook
4
+ def autoload: (untyped name, untyped path) -> untyped
5
+ end
@@ -0,0 +1,6 @@
1
+ # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
+
3
+ class Orthoses::Autoload
4
+ def initialize: (untyped loader) -> void
5
+ def call: () -> untyped
6
+ end
@@ -5,6 +5,5 @@ class Orthoses::Builder
5
5
  def use: (untyped middleware, *untyped args, **untyped key) ?{ () -> untyped } -> untyped
6
6
  def run: (untyped loader) -> untyped
7
7
  def to_loader: () -> untyped
8
-
9
8
  def call: () { () -> void } -> Orthoses::store
10
9
  end
@@ -0,0 +1,7 @@
1
+ # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
+
3
+ module Orthoses::CallTracer::Capturable
4
+ def build_capture: (untyped tp) -> untyped
5
+ private def build_method: (untyped tp) -> untyped
6
+ private def build_argument: (untyped tp) -> untyped
7
+ end
@@ -0,0 +1,6 @@
1
+ # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
+
3
+ class Orthoses::CallTracer::Lazy
4
+ def initialize: () -> void
5
+ def trace: (untyped name) ?{ () -> untyped } -> untyped
6
+ end
@@ -2,7 +2,6 @@
2
2
 
3
3
  class Orthoses::CallTracer
4
4
  def initialize: () -> void
5
-
6
5
  def trace: [T] (Method | UnboundMethod) ?{ () -> T } -> T
7
6
  attr_accessor captures: Array[Capture]
8
7
  end
@@ -0,0 +1,7 @@
1
+ # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
+
3
+ class Orthoses::Content::ArrayIO
4
+ def initialize: () -> void
5
+ def puts: (untyped line) -> untyped
6
+ def to_a: () -> untyped
7
+ end
@@ -1,9 +1,8 @@
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
4
+ def initialize: (untyped decl, ?env: untyped?) -> void
5
+ def update_decl: () -> (nil | untyped)
6
6
  private def drop_known_method_definition: (untyped uniq_map) -> untyped
7
- private def member_to_s: (untyped member) -> untyped
8
7
  private def member_key: (untyped member) -> untyped
9
8
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  class Orthoses::Content::Environment
4
4
  def self.load_from_paths: (untyped paths) -> untyped
5
-
6
5
  def initialize: (?constant_filter: constant_filter?, ?mixin_filter: mixin_filter?, ?attribute_filter: attribute_filter?) -> void
7
6
  def <<: (RBS::AST::Declarations::t decl) -> RBS::Environment
8
7
  def write_to: (store: Orthoses::store) -> void
@@ -7,6 +7,7 @@ class Orthoses::Content::HeaderBuilder
7
7
  private def build_class: (entry: untyped, ?name_hint: untyped?) -> ::String
8
8
  private def build_super_class: (untyped primary) -> (nil | untyped)
9
9
  private def build_interface: (entry: untyped, ?name_hint: untyped?) -> ::String
10
+ private def build_context: (entry: untyped) -> untyped
10
11
  private def name_and_params: (untyped name, untyped params) -> ::String
11
12
  private def name_and_args: (untyped name, untyped args) -> (::String | nil)
12
13
  end
@@ -4,10 +4,12 @@ class Orthoses::Content
4
4
  def initialize: (name: String) -> void
5
5
  def <<: (String) -> void
6
6
  def concat: (Array[String]) -> void
7
+ def empty?: () -> untyped
8
+ def delete: (untyped val) -> untyped
7
9
  def to_rbs: () -> String
8
10
  def to_decl: () -> untyped
9
- private def original_rbs: () -> ::String
10
-
11
+ def uniq!: () -> untyped
12
+ def original_rbs: () -> untyped
11
13
  private def uniqed_body_string: () -> String
12
14
  private def uniqed_body_decl: () -> RBS::AST::Declarations::t
13
15
  private def auto_header: () -> (nil | untyped)
@@ -0,0 +1,15 @@
1
+ # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
+
3
+ class Orthoses::LazyTracePoint < ::TracePoint
4
+ def method_added: (untyped id) -> untyped
5
+ def singleton_method_added: (untyped id) -> untyped
6
+ def initialize: (*untyped events) ?{ () -> untyped } -> void
7
+ def enable: (?target: untyped?, ?target_line: untyped?, ?target_thread: untyped?) ?{ () -> untyped } -> untyped
8
+ private def trace_instance_method: () ?{ () -> untyped } -> untyped
9
+ private def trace_singleton_method: () ?{ () -> untyped } -> untyped
10
+ INSTANCE_METHOD_METHOD: UnboundMethod
11
+ METHOD_ADDED_METHOD: UnboundMethod
12
+ METHOD_METHOD: UnboundMethod
13
+ SINGLETON_METHOD_ADDED_METHOD: UnboundMethod
14
+ UNBOUND_NAME_METHOD: UnboundMethod
15
+ end
@@ -1,8 +1,9 @@
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
4
+ def initialize: (Orthoses::_Call loader, paths: paths) -> void
5
5
  def call: () -> Orthoses::store
6
+ type paths = Array[String] | ^() -> Array[String]
6
7
  @loader: Orthoses::_Call
7
- @paths: Array[_ToS]
8
+ @paths: paths
8
9
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Orthoses::Mixin::Hook
4
4
  def include: (*untyped modules) -> untyped
5
-
6
5
  def extend: (*untyped modules) -> untyped
7
-
8
6
  def prepend: (*untyped modules) -> untyped
9
7
  end
@@ -1,8 +1,8 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
- class Orthoses::AvoidRecursiveAncestorError
3
+ class Orthoses::Outputable::AvoidRecursiveAncestorError
4
4
  def initialize: (Orthoses::_Call loader) -> void
5
5
  def call: () -> Orthoses::store
6
- def set_object_mixins_recursive: (untyped store, untyped name, untyped object_mixins) -> untyped
6
+ private def collect_mixin_recursive: (untyped store, untyped name, untyped mixins) -> untyped
7
7
  @loader: Orthoses::_Call
8
8
  end
@@ -0,0 +1,5 @@
1
+ # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
+
3
+ module Orthoses::Outputable
4
+ def call: () -> untyped
5
+ end
@@ -0,0 +1,9 @@
1
+ # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
+
3
+ class Orthoses::PathHelper
4
+ def self.best_version_paths: (untyped current, untyped base_dir) -> untyped
5
+ def initialize: (untyped current, untyped base_dir) -> void
6
+ def best_version_paths: () -> untyped
7
+ def find_best_version: () -> untyped
8
+ def version_dir: () -> untyped
9
+ end
@@ -0,0 +1,6 @@
1
+ # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
+
3
+ class Orthoses::RBSPrototypeRuntime
4
+ def initialize: (untyped loader, patterns: untyped) -> void
5
+ def call: () -> untyped
6
+ end
@@ -1,29 +1,17 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
3
  module Orthoses::Utils
4
- def self.unautoload!: () -> void
5
-
4
+ def self.unautoload!: () -> untyped
6
5
  def self.each_const_recursive: (Module root, ?cache: Hash[untyped, true], ?on_error: ^(Orthoses::ConstLoadError) -> void) ?{ (Module, Symbol, untyped) -> void } -> void
7
-
8
6
  def self.rbs_defined_const?: (String name, ?library: (String | Array[String])?, ?collection: boolish) -> bool
9
-
10
7
  def self.rbs_defined_class?: (String name, ?library: (String | Array[String])?, ?collection: boolish) -> bool
11
-
12
8
  def self.rbs_type_name: (String) -> RBS::TypeName
13
-
14
9
  def self.rbs_environment: (?library: String | Array[String] | nil, ?collection: boolish, ?cache: boolish) -> RBS::Environment
15
-
16
10
  def self.object_to_rbs: (untyped object, strict: bool) -> String
17
-
18
11
  def self.module_name: (Module mod) -> String?
19
-
20
12
  def self.module_to_type_name: (Module) -> RBS::TypeName?
21
-
22
13
  def self.known_type_params: (Module | String) -> Array[RBS::AST::TypeParam]?
23
-
24
14
  def self.new_store: () -> Orthoses::store
25
-
26
15
  UNBOUND_NAME_METHOD: UnboundMethod
27
-
28
16
  attr_accessor self.rbs_collection_pathname: Pathname
29
17
  end
data/sig/orthoses.rbs CHANGED
@@ -1,9 +1,9 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
3
  module Orthoses
4
- VERSION: "0.8.0"
5
-
4
+ VERSION: "0.11.0"
6
5
  attr_accessor self.logger: ::Logger
7
-
8
6
  type store = Hash[String, Orthoses::Content]
7
+ INSTANCE_METHOD_METHOD: UnboundMethod
8
+ METHOD_METHOD: UnboundMethod
9
9
  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: 0.8.0
4
+ version: 0.11.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-10 00:00:00.000000000 Z
11
+ date: 2022-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbs
@@ -41,9 +41,11 @@ files:
41
41
  - examples/simple_middleware.rbs
42
42
  - lib/orthoses.rb
43
43
  - lib/orthoses/attribute.rb
44
- - lib/orthoses/avoid_recursive_ancestor_error.rb
44
+ - lib/orthoses/autoload.rb
45
45
  - lib/orthoses/builder.rb
46
46
  - lib/orthoses/call_tracer.rb
47
+ - lib/orthoses/call_tracer/capturable.rb
48
+ - lib/orthoses/call_tracer/lazy.rb
47
49
  - lib/orthoses/constant.rb
48
50
  - lib/orthoses/content.rb
49
51
  - lib/orthoses/content/duplication_checker.rb
@@ -52,11 +54,16 @@ files:
52
54
  - lib/orthoses/create_file_by_name.rb
53
55
  - lib/orthoses/delegate_class.rb
54
56
  - lib/orthoses/filter.rb
57
+ - lib/orthoses/lazy_trace_point.rb
55
58
  - lib/orthoses/load_rbs.rb
56
59
  - lib/orthoses/mixin.rb
57
60
  - lib/orthoses/object_space_all.rb
61
+ - lib/orthoses/outputable.rb
62
+ - lib/orthoses/outputable/avoid_recursive_ancestor_error.rb
63
+ - lib/orthoses/path_helper.rb
58
64
  - lib/orthoses/pp.rb
59
65
  - lib/orthoses/rbs_prototype_rb.rb
66
+ - lib/orthoses/rbs_prototype_runtime.rb
60
67
  - lib/orthoses/store.rb
61
68
  - lib/orthoses/tap.rb
62
69
  - lib/orthoses/utils.rb
@@ -69,14 +76,18 @@ files:
69
76
  - sig/orthoses/_middle_ware.rbs
70
77
  - sig/orthoses/attribute.rbs
71
78
  - sig/orthoses/attribute/hook.rbs
72
- - sig/orthoses/avoid_recursive_ancestor_error.rbs
79
+ - sig/orthoses/autoload.rbs
80
+ - sig/orthoses/autoload/hook.rbs
73
81
  - sig/orthoses/builder.rbs
74
82
  - sig/orthoses/builder/call_logable.rbs
75
83
  - sig/orthoses/call_tracer.rbs
84
+ - sig/orthoses/call_tracer/capturable.rbs
76
85
  - sig/orthoses/call_tracer/capture.rbs
86
+ - sig/orthoses/call_tracer/lazy.rbs
77
87
  - sig/orthoses/const_load_error.rbs
78
88
  - sig/orthoses/constant.rbs
79
89
  - sig/orthoses/content.rbs
90
+ - sig/orthoses/content/array_io.rbs
80
91
  - sig/orthoses/content/duplication_checker.rbs
81
92
  - sig/orthoses/content/environment.rbs
82
93
  - sig/orthoses/content/header_builder.rbs
@@ -84,13 +95,18 @@ files:
84
95
  - sig/orthoses/delegate_class.rbs
85
96
  - sig/orthoses/delegate_class/hook.rbs
86
97
  - sig/orthoses/filter.rbs
98
+ - sig/orthoses/lazy_trace_point.rbs
87
99
  - sig/orthoses/load_rbs.rbs
88
100
  - sig/orthoses/mixin.rbs
89
101
  - sig/orthoses/mixin/hook.rbs
90
102
  - sig/orthoses/name_space_error.rbs
91
103
  - sig/orthoses/object_space_all.rbs
104
+ - sig/orthoses/outputable.rbs
105
+ - sig/orthoses/outputable/avoid_recursive_ancestor_error.rbs
106
+ - sig/orthoses/path_helper.rbs
92
107
  - sig/orthoses/pp.rbs
93
108
  - sig/orthoses/rbs_prototype_rb.rbs
109
+ - sig/orthoses/rbs_prototype_runtime.rbs
94
110
  - sig/orthoses/store.rbs
95
111
  - sig/orthoses/tap.rbs
96
112
  - sig/orthoses/utils.rbs
@@ -117,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
133
  - !ruby/object:Gem::Version
118
134
  version: '0'
119
135
  requirements: []
120
- rubygems_version: 3.3.7
136
+ rubygems_version: 3.4.0.dev
121
137
  signing_key:
122
138
  specification_version: 4
123
139
  summary: Framework for Generate RBS
@@ -1,29 +0,0 @@
1
- module Orthoses
2
- class AvoidRecursiveAncestorError
3
- def initialize(loader)
4
- @loader = loader
5
- end
6
-
7
- def call
8
- @loader.call.tap do |store|
9
- object_mixins = {}
10
- set_object_mixins_recursive(store, "Object", object_mixins)
11
-
12
- object_mixins.each_key do |object_mixin|
13
- store[object_mixin].header = "module #{object_mixin} : BasicObject"
14
- end
15
- end
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
28
- end
29
- end