orthoses 1.6.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -3
  3. data/lib/orthoses/builder.rb +7 -3
  4. data/lib/orthoses/content/duplication_checker.rb +54 -17
  5. data/lib/orthoses/content/environment.rb +14 -1
  6. data/lib/orthoses/content.rb +46 -44
  7. data/lib/orthoses/create_file_by_name.rb +38 -7
  8. data/lib/orthoses/filter.rb +2 -2
  9. data/lib/orthoses/missing_name.rb +81 -0
  10. data/lib/orthoses/mixin.rb +9 -4
  11. data/lib/orthoses/rbs_prototype_rb.rb +16 -2
  12. data/lib/orthoses/rbs_prototype_runtime.rb +21 -2
  13. data/lib/orthoses/utils.rb +1 -1
  14. data/lib/orthoses/version.rb +1 -1
  15. data/lib/orthoses.rb +1 -0
  16. data/sig/orthoses/_call.rbs +1 -1
  17. data/sig/orthoses/_middle_ware.rbs +1 -1
  18. data/sig/orthoses/attribute/hook.rbs +1 -1
  19. data/sig/orthoses/attribute.rbs +1 -1
  20. data/sig/orthoses/autoload/hook.rbs +1 -1
  21. data/sig/orthoses/autoload.rbs +1 -1
  22. data/sig/orthoses/builder/call_logable.rbs +1 -1
  23. data/sig/orthoses/builder.rbs +14 -4
  24. data/sig/orthoses/call_tracer/capturable.rbs +1 -1
  25. data/sig/orthoses/call_tracer/capture.rbs +1 -1
  26. data/sig/orthoses/call_tracer/lazy.rbs +14 -2
  27. data/sig/orthoses/call_tracer.rbs +1 -1
  28. data/sig/orthoses/const_load_error.rbs +1 -1
  29. data/sig/orthoses/constant.rbs +1 -1
  30. data/sig/orthoses/content/array_io.rbs +1 -1
  31. data/sig/orthoses/content/duplication_checker.rbs +7 -2
  32. data/sig/orthoses/content/environment.rbs +8 -3
  33. data/sig/orthoses/content/header_builder.rbs +1 -1
  34. data/sig/orthoses/content.rbs +3 -2
  35. data/sig/orthoses/create_file_by_name.rbs +2 -2
  36. data/sig/orthoses/delegate_class/hook.rbs +1 -1
  37. data/sig/orthoses/delegate_class.rbs +1 -1
  38. data/sig/orthoses/filter.rbs +6 -1
  39. data/sig/orthoses/lazy_trace_point.rbs +9 -1
  40. data/sig/orthoses/load_rbs.rbs +1 -1
  41. data/sig/orthoses/missing_name/missing_class.rbs +7 -0
  42. data/sig/orthoses/missing_name/missing_module.rbs +7 -0
  43. data/sig/orthoses/missing_name.rbs +6 -0
  44. data/sig/orthoses/mixin/hook.rbs +2 -2
  45. data/sig/orthoses/mixin.rbs +2 -2
  46. data/sig/orthoses/name_space_error.rbs +1 -1
  47. data/sig/orthoses/object_space_all.rbs +1 -1
  48. data/sig/orthoses/outputable/avoid_recursive_ancestor_error.rbs +3 -1
  49. data/sig/orthoses/outputable/constantizable_filter.rbs +3 -1
  50. data/sig/orthoses/outputable/uniq_content_body.rbs +3 -1
  51. data/sig/orthoses/outputable.rbs +1 -1
  52. data/sig/orthoses/path_helper.rbs +1 -1
  53. data/sig/orthoses/pp.rbs +3 -1
  54. data/sig/orthoses/rbs_prototype_rb.rbs +10 -3
  55. data/sig/orthoses/rbs_prototype_runtime.rbs +13 -3
  56. data/sig/orthoses/sort.rbs +2 -1
  57. data/sig/orthoses/store.rbs +3 -1
  58. data/sig/orthoses/tap.rbs +4 -1
  59. data/sig/orthoses/trace/attribute.rbs +1 -1
  60. data/sig/orthoses/trace/method/info.rbs +1 -1
  61. data/sig/orthoses/trace/method.rbs +1 -1
  62. data/sig/orthoses/trace/targetable.rbs +1 -1
  63. data/sig/orthoses/trace.rbs +1 -1
  64. data/sig/orthoses/utils/type_list.rbs +2 -1
  65. data/sig/orthoses/utils/underscore.rbs +1 -1
  66. data/sig/orthoses/utils.rbs +2 -2
  67. data/sig/orthoses/walk.rbs +1 -1
  68. data/sig/orthoses/writer.rbs +1 -1
  69. data/sig/orthoses.rbs +2 -2
  70. metadata +7 -13
  71. data/Gemfile +0 -15
  72. data/Gemfile.lock +0 -76
  73. data/examples/minitest/Rakefile +0 -56
  74. data/examples/rack-test/Gemfile +0 -8
  75. data/examples/rack-test/Gemfile.lock +0 -30
  76. data/examples/rack-test/Rakefile +0 -7
  77. data/examples/rack-test/generate.rb +0 -31
  78. data/examples/simple_middleware.rb +0 -11
  79. data/examples/simple_middleware.rbs +0 -7
  80. data/orthoses.gemspec +0 -36
data/Gemfile.lock DELETED
@@ -1,76 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- orthoses (1.6.0)
5
- rbs (~> 3.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activesupport (7.0.4.3)
11
- concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 1.6, < 2)
13
- minitest (>= 5.1)
14
- tzinfo (~> 2.0)
15
- ast (2.4.2)
16
- concurrent-ruby (1.2.2)
17
- csv (3.2.6)
18
- ffi (1.15.5)
19
- fileutils (1.7.0)
20
- i18n (1.12.0)
21
- concurrent-ruby (~> 1.0)
22
- json (2.6.3)
23
- language_server-protocol (3.17.0.3)
24
- listen (3.8.0)
25
- rb-fsevent (~> 0.10, >= 0.10.3)
26
- rb-inotify (~> 0.9, >= 0.9.10)
27
- logger (1.5.3)
28
- minitest (5.18.0)
29
- parallel (1.22.1)
30
- parser (3.2.1.1)
31
- ast (~> 2.4.1)
32
- pathname (0.2.1)
33
- rainbow (3.1.1)
34
- rake (13.0.6)
35
- rb-fsevent (0.11.2)
36
- rb-inotify (0.10.1)
37
- ffi (~> 1.0)
38
- rbs (3.0.4)
39
- rgot (1.3.0)
40
- securerandom (0.2.2)
41
- steep (1.4.0.dev.2)
42
- activesupport (>= 5.1)
43
- csv (>= 3.0.9)
44
- fileutils (>= 1.1.0)
45
- json (>= 2.1.0)
46
- language_server-protocol (>= 3.15, < 4.0)
47
- listen (~> 3.0)
48
- logger (>= 1.3.0)
49
- parallel (>= 1.0.0)
50
- parser (>= 3.1)
51
- pathname (>= 0.2.1)
52
- rainbow (>= 2.2.2, < 4.0)
53
- rbs (>= 2.8.0)
54
- securerandom (>= 0.1)
55
- strscan (>= 1.0.0)
56
- terminal-table (>= 2, < 4)
57
- strscan (3.0.6)
58
- terminal-table (3.0.2)
59
- unicode-display_width (>= 1.1.1, < 3)
60
- tzinfo (2.0.6)
61
- concurrent-ruby (~> 1.0)
62
- unicode-display_width (2.4.2)
63
-
64
- PLATFORMS
65
- ruby
66
-
67
- DEPENDENCIES
68
- activesupport
69
- orthoses!
70
- rake (~> 13.0)
71
- rbs
72
- rgot (~> 1.1)
73
- steep (= 1.4.0.dev.2)
74
-
75
- BUNDLED WITH
76
- 2.4.8
@@ -1,56 +0,0 @@
1
- file :src do
2
- sh "git clone https://github.com/minitest/minitest.git src"
3
- end
4
-
5
- desc "generate minitest"
6
- task :minitest => :src do
7
- $:.unshift(File.expand_path("src/lib"))
8
-
9
- out = Pathname('out')
10
- out.rmtree rescue nil
11
- require 'orthoses'
12
-
13
- Orthoses::Builder.new do
14
- use Orthoses::CreateFileByName,
15
- base_dir: out.to_s
16
- use Orthoses::Filter do |name, content|
17
- name.start_with?("Minitest") || name == "Kernel"
18
- end
19
- use Orthoses::Constant,
20
- strict: false,
21
- if: ->(current, const, val, rbs){
22
- !Orthoses::Utils.rbs_defined_const?("#{current}::#{const}")
23
- }
24
- use Orthoses::Mixin
25
- use Orthoses::Attribute
26
- use Orthoses::RBSPrototypeRB,
27
- paths: Dir.glob('src/lib/minitest{.rb,/*.rb}'),
28
- constant_filter: ->(_) { false },
29
- mixin_filter: ->(_) { false },
30
- attribute_filter: ->(_) { false }
31
- run ->(){
32
- require_relative 'src/lib/minitest'
33
- require_relative 'src/lib/minitest/test'
34
- require_relative 'src/lib/minitest/spec'
35
- require_relative 'src/lib/minitest/parallel'
36
- require_relative 'src/lib/minitest/mock'
37
- require_relative 'src/lib/minitest/benchmark'
38
-
39
- require_relative 'src/lib/minitest/pride_plugin'
40
- }
41
- end.call
42
-
43
- sh "rbs -r mutex_m -I #{out} validate --silent"
44
- out.join("manifest.yaml").write <<~YAML
45
- dependencies:
46
- - name: mutex_m
47
- YAML
48
- tmp = out.join("kernel.rbs").read
49
- out.join("kernel.rbs").open("w") do |f|
50
- f.puts "%a{annotate:rdoc:skip}"
51
- f.write tmp
52
- end
53
- sh "rbs annotate --gems out"
54
- end
55
-
56
- task default: :minitest
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "rack"
4
- gem "rake"
5
- gem "cgi"
6
- gem "minitest"
7
- gem "minitest-global_expectations"
8
- gem "orthoses", path: "../../"
@@ -1,30 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- orthoses (1.4.0)
5
- rbs (~> 2.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- cgi (0.3.6)
11
- minitest (5.16.3)
12
- minitest-global_expectations (1.0.1)
13
- minitest (> 5)
14
- rack (3.0.2)
15
- rake (13.0.6)
16
- rbs (2.8.1)
17
-
18
- PLATFORMS
19
- arm64-darwin-21
20
-
21
- DEPENDENCIES
22
- cgi
23
- minitest
24
- minitest-global_expectations
25
- orthoses!
26
- rack
27
- rake
28
-
29
- BUNDLED WITH
30
- 2.3.16
@@ -1,7 +0,0 @@
1
- file :src do
2
- sh "git clone --depth 1 https://github.com/rack/rack-test.git src"
3
- end
4
-
5
- task :generate => :src do
6
- load "generate.rb"
7
- end
@@ -1,31 +0,0 @@
1
- require 'pathname'
2
- require 'orthoses'
3
- require 'fileutils'
4
-
5
- include FileUtils
6
-
7
- out = Pathname('out')
8
- out.rmtree rescue nil
9
- Orthoses.logger.level = :warn
10
- Orthoses::Builder.new do
11
- use Orthoses::CreateFileByName,
12
- base_dir: out.to_s
13
- # use Orthoses::Sort
14
- use Orthoses::Filter do |name, content|
15
- name.start_with?("Rack::Test")
16
- end
17
- use Orthoses::Trace,
18
- patterns: ['Rack::Test*']
19
- run ->(){
20
- cd "src" do
21
- load "spec/all.rb"
22
- Minitest.run
23
- # avoid to run on at_exit
24
- module ::Minitest
25
- def self.run args = []
26
- 0
27
- end
28
- end
29
- end
30
- }
31
- end.call
@@ -1,11 +0,0 @@
1
- module Orthoses
2
- class Simple
3
- def initialize(loader)
4
- @loader = loader
5
- end
6
-
7
- def call
8
- @loader.call
9
- end
10
- end
11
- end
@@ -1,7 +0,0 @@
1
- module Orthoses
2
- class Simple
3
- @loader: Orthoses::_Call
4
- include Orthoses::_MiddleWare
5
- def initialize: (Orthoses::_Call loader) -> void
6
- end
7
- end
data/orthoses.gemspec DELETED
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/orthoses/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "orthoses"
7
- spec.version = Orthoses::VERSION
8
- spec.authors = ["ksss"]
9
- spec.email = ["co000ri@gmail.com"]
10
-
11
- spec.summary = "Framework for Generate RBS"
12
- spec.description = "Build RBS by Rack base architecture"
13
- spec.homepage = "https://github.com/ksss/orthoses"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.6.0"
16
-
17
- spec.metadata["homepage_uri"] = spec.homepage
18
- spec.metadata["source_code_uri"] = spec.homepage
19
-
20
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
- `git ls-files -z`.split("\x0").reject do |f|
22
- next true if (f == __FILE__)
23
- next true if f.match?(%r{\A(?:bin|known_sig)/}) # dir
24
- next true if f.match?(%r{\A\.(?:git)}) # git
25
- next true if f.match?(%r{\A(?:rbs_collection|Steepfile|Rakefile)}) # top file
26
- next true if f.match?(%r{_test\.rb\z}) # test
27
- false
28
- end
29
- end
30
-
31
- spec.bindir = "exe"
32
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
33
- spec.require_paths = ["lib"]
34
-
35
- spec.add_dependency "rbs", "~> 3.0"
36
- end