orthoses 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +17 -7
  4. data/examples/rack-test/Gemfile.lock +3 -3
  5. data/examples/rack-test/out/rack/test/cookie.rbs +28 -0
  6. data/examples/rack-test/out/rack/test/cookie_jar.rbs +28 -0
  7. data/examples/rack-test/out/rack/test/fake_app.rbs +13 -0
  8. data/examples/rack-test/out/rack/test/input_rewinder.rbs +8 -0
  9. data/examples/rack-test/out/rack/test/methods.rbs +98 -0
  10. data/examples/rack-test/out/rack/test/session.rbs +186 -0
  11. data/examples/rack-test/out/rack/test/uploaded_file.rbs +18 -0
  12. data/examples/rack-test/out/rack/test/utils.rbs +112 -0
  13. data/examples/rack-test/out/rack/test.rbs +3 -0
  14. data/lib/orthoses/content/duplication_checker.rb +40 -18
  15. data/lib/orthoses/content/environment.rb +15 -2
  16. data/lib/orthoses/content.rb +46 -44
  17. data/lib/orthoses/filter.rb +2 -2
  18. data/lib/orthoses/rbs_prototype_rb.rb +16 -2
  19. data/lib/orthoses/version.rb +1 -1
  20. data/sig/orthoses/builder.rbs +9 -0
  21. data/sig/orthoses/call_tracer/capture.rbs +1 -1
  22. data/sig/orthoses/call_tracer/lazy.rbs +12 -0
  23. data/sig/orthoses/content/duplication_checker.rbs +3 -0
  24. data/sig/orthoses/content.rbs +1 -1
  25. data/sig/orthoses/filter.rbs +5 -0
  26. data/sig/orthoses/lazy_trace_point.rbs +8 -0
  27. data/sig/orthoses/outputable/avoid_recursive_ancestor_error.rbs +2 -0
  28. data/sig/orthoses/outputable/constantizable_filter.rbs +2 -0
  29. data/sig/orthoses/outputable/uniq_content_body.rbs +2 -0
  30. data/sig/orthoses/pp.rbs +2 -0
  31. data/sig/orthoses/rbs_prototype_rb.rbs +5 -0
  32. data/sig/orthoses/rbs_prototype_runtime.rbs +3 -0
  33. data/sig/orthoses/sort.rbs +1 -0
  34. data/sig/orthoses/store.rbs +2 -0
  35. data/sig/orthoses/tap.rbs +3 -0
  36. data/sig/orthoses/utils/type_list.rbs +1 -0
  37. data/sig/orthoses.rbs +1 -1
  38. metadata +12 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0bde1745c71d6d30b7b45ce7f956a1c02f0d44353932c3743211aa1c05f58d39
4
- data.tar.gz: bbe5b95a7665d39faab82b5f53e18cffd22962df1913f1c52698ea51c6045e2c
3
+ metadata.gz: e2915ad2b524676ac4ea67e61fcc90713bdaa8e79cb2ff01aeba74fe54b4885d
4
+ data.tar.gz: 0f8823a7e88b4030eb6554ac9f35a068730ac944378832f923c99cf3b4e8e6be
5
5
  SHA512:
6
- metadata.gz: 496d255f99751ac854e5b05ecac69b1e0dc7dbb5fca53bf99d6d622e2dbb154af643de7bf8de8190dca15ff1933fac35c17735da9285532a8a3246d7002836cd
7
- data.tar.gz: 56c77cf9074eeb75547c1be3868e9843b0d5337400d2248592879f76fd6cc14f99660d8dbbf593c1d66bac1152e1dafbaa4820ea45a49f5f47945027ce45d53a
6
+ metadata.gz: '06038e9dd28433a1c9358915720fe942f597caee2d68651ce7c54b47136633cc1d55288c7b8053766f393bacda9974b1ee662337f80d78b0796d405453b2cc32'
7
+ data.tar.gz: 92074fd8665515453126f44627604f7fd3da1dcb7a85ec25b1ef51424c6797f9b1f67925d2349db05b7ce7aace06dc7f3f2d2be737cfb5399383bed4f846b11f
data/Gemfile CHANGED
@@ -9,6 +9,7 @@ gem "rbs"
9
9
  gem "rake", "~> 13.0"
10
10
  gem "rgot", "~> 1.1"
11
11
  gem "activesupport"
12
+ gem "debug"
12
13
 
13
14
  group :steep do
14
15
  gem "steep", "1.4.0.dev.2"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- orthoses (1.6.0)
4
+ orthoses (1.7.0)
5
5
  rbs (~> 3.0)
6
6
 
7
7
  GEM
@@ -15,10 +15,16 @@ GEM
15
15
  ast (2.4.2)
16
16
  concurrent-ruby (1.2.2)
17
17
  csv (3.2.6)
18
+ debug (1.8.0)
19
+ irb (>= 1.5.0)
20
+ reline (>= 0.3.1)
18
21
  ffi (1.15.5)
19
- fileutils (1.7.0)
20
- i18n (1.12.0)
22
+ fileutils (1.7.1)
23
+ i18n (1.13.0)
21
24
  concurrent-ruby (~> 1.0)
25
+ io-console (0.6.0)
26
+ irb (1.6.4)
27
+ reline (>= 0.3.0)
22
28
  json (2.6.3)
23
29
  language_server-protocol (3.17.0.3)
24
30
  listen (3.8.0)
@@ -26,8 +32,8 @@ GEM
26
32
  rb-inotify (~> 0.9, >= 0.9.10)
27
33
  logger (1.5.3)
28
34
  minitest (5.18.0)
29
- parallel (1.22.1)
30
- parser (3.2.1.1)
35
+ parallel (1.23.0)
36
+ parser (3.2.2.1)
31
37
  ast (~> 2.4.1)
32
38
  pathname (0.2.1)
33
39
  rainbow (3.1.1)
@@ -35,7 +41,9 @@ GEM
35
41
  rb-fsevent (0.11.2)
36
42
  rb-inotify (0.10.1)
37
43
  ffi (~> 1.0)
38
- rbs (3.0.4)
44
+ rbs (3.1.0)
45
+ reline (0.3.3)
46
+ io-console (~> 0.5)
39
47
  rgot (1.3.0)
40
48
  securerandom (0.2.2)
41
49
  steep (1.4.0.dev.2)
@@ -62,10 +70,12 @@ GEM
62
70
  unicode-display_width (2.4.2)
63
71
 
64
72
  PLATFORMS
65
- ruby
73
+ x86_64-darwin-21
74
+ x86_64-linux
66
75
 
67
76
  DEPENDENCIES
68
77
  activesupport
78
+ debug
69
79
  orthoses!
70
80
  rake (~> 13.0)
71
81
  rbs
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- orthoses (1.4.0)
5
- rbs (~> 2.0)
4
+ orthoses (1.6.0)
5
+ rbs (~> 3.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -13,7 +13,7 @@ GEM
13
13
  minitest (> 5)
14
14
  rack (3.0.2)
15
15
  rake (13.0.6)
16
- rbs (2.8.1)
16
+ rbs (3.0.4)
17
17
 
18
18
  PLATFORMS
19
19
  arm64-darwin-21
@@ -0,0 +1,28 @@
1
+ class Rack::Test::Cookie
2
+ attr_reader name: String
3
+ attr_reader value: String
4
+ attr_reader raw: String
5
+ private def initialize: (String raw, ?URI::Generic uri, ?String default_host) -> void
6
+ | (String raw, ?nil uri, ?String default_host) -> void
7
+ | (String raw, ?URI::HTTPS uri, ?String default_host) -> void
8
+ | (String raw, ?URI::HTTP uri, ?String default_host) -> void
9
+ def domain: () -> String
10
+ def secure?: () -> bool
11
+ def valid?: (URI::Generic uri) -> (bool | URI::RFC3986_Parser)
12
+ | (URI::HTTPS uri) -> bool
13
+ | (nil uri) -> nil
14
+ | (URI::HTTP uri) -> bool
15
+ private def default_uri: () -> Array[String?]
16
+ def http_only?: () -> bool
17
+ def empty?: () -> bool
18
+ def to_h: () -> Hash[String, String | bool]
19
+ def expires: () -> Time?
20
+ def expired?: () -> Integer?
21
+ def matches?: (URI::HTTPS uri) -> (Array[Integer] | bool)
22
+ | (URI::Generic uri) -> (Array[Integer] | bool)
23
+ | (URI::HTTP uri) -> (Array[Integer] | bool)
24
+ def path: () -> String
25
+ def replaces?: (Rack::Test::Cookie other) -> String
26
+ def <=>: (Rack::Test::Cookie other) -> String
27
+ alias to_hash to_h
28
+ end
@@ -0,0 +1,28 @@
1
+ class Rack::Test::CookieJar
2
+ private def initialize: (?Array[untyped] cookies, ?String default_host) -> void
3
+ private def each_cookie_for: (URI::Generic uri) -> (Array[untyped] | String | bool)
4
+ | (URI::HTTP uri) -> (Array[untyped] | String | bool)
5
+ | (nil uri) -> String
6
+ | (URI::HTTPS uri) -> (Array[untyped] | String)
7
+ def for: (URI::Generic uri) -> (Array[Rack::Test::Cookie] | String | Time)
8
+ | (URI::HTTP uri) -> (Array[Rack::Test::Cookie] | String | Time)
9
+ | (nil uri) -> String
10
+ | (URI::HTTPS uri) -> (Array[Rack::Test::Cookie] | String)
11
+ def merge: (nil raw_cookies, ?URI::Generic uri) -> nil
12
+ | (String raw_cookies, ?URI::Generic uri) -> Rack::QueryParser::Params
13
+ | (nil raw_cookies, ?URI::HTTP uri) -> nil
14
+ | (String raw_cookies, ?nil uri) -> Array[nil]
15
+ | (nil raw_cookies, ?URI::HTTPS uri) -> nil
16
+ | (Array[String] raw_cookies, ?URI::Generic uri) -> Rack::QueryParser::Params
17
+ | (String raw_cookies, ?URI::HTTPS uri) -> Rack::QueryParser::Params
18
+ | (String raw_cookies, ?URI::HTTP uri) -> Rack::QueryParser::Params
19
+ | (Array[String] raw_cookies, ?nil uri) -> Array[nil]
20
+ def []: (String name) -> String?
21
+ | (Symbol name) -> String
22
+ private def initialize_copy: (Rack::Test::CookieJar other) -> Array[untyped]
23
+ def <<: (Rack::Test::Cookie new_cookie) -> (Array[Rack::Test::Cookie] | String)
24
+ def []=: (String name, String value) -> String
25
+ def to_hash: () -> (Hash[untyped, untyped] | String)
26
+ def get_cookie: (String name) -> String?
27
+ def delete: (String name) -> String
28
+ end
@@ -0,0 +1,13 @@
1
+ class Rack::Test::FakeApp
2
+ private def handle: (Hash[String, Rack::Lint::Wrapper::InputWrapper | Rack::Lint::Wrapper::ErrorWrapper | String | bool] env) -> nil
3
+ | (Hash[String, Hash[Symbol, Symbol] | Rack::Lint::Wrapper::InputWrapper | Rack::Lint::Wrapper::ErrorWrapper | String | bool] env) -> nil
4
+ | (Hash[String, Hash[Symbol, String] | Rack::Lint::Wrapper::InputWrapper | Rack::Lint::Wrapper::ErrorWrapper | String | bool] env) -> nil
5
+ | (Hash[String, Hash[untyped, untyped] | Rack::Lint::Wrapper::InputWrapper | Rack::Lint::Wrapper::ErrorWrapper | String | bool] env) -> nil
6
+ | (Hash[String, Hash[String, String] | Rack::Lint::Wrapper::InputWrapper | Rack::Lint::Wrapper::ErrorWrapper | String | bool] env) -> nil
7
+ def call: (Hash[String, Rack::Lint::Wrapper::InputWrapper | Rack::Lint::Wrapper::ErrorWrapper | String | bool] env) -> nil
8
+ | (Hash[String, Hash[Symbol, Symbol] | Rack::Lint::Wrapper::InputWrapper | Rack::Lint::Wrapper::ErrorWrapper | String | bool] env) -> nil
9
+ | (Hash[String, Hash[Symbol, String] | Rack::Lint::Wrapper::InputWrapper | Rack::Lint::Wrapper::ErrorWrapper | String | bool] env) -> nil
10
+ | (Hash[String, Hash[untyped, untyped] | Rack::Lint::Wrapper::InputWrapper | Rack::Lint::Wrapper::ErrorWrapper | String | bool] env) -> nil
11
+ | (Hash[String, Hash[String, String] | Rack::Lint::Wrapper::InputWrapper | Rack::Lint::Wrapper::ErrorWrapper | String | bool] env) -> nil
12
+ private def new_cookie_count: (Rack::Request req) -> Hash[untyped, untyped]
13
+ end
@@ -0,0 +1,8 @@
1
+ class Rack::Test::InputRewinder
2
+ private def initialize: (Rack::Lint app) -> void
3
+ def call: (Hash[String, StringIO | String | bool] env) -> Integer
4
+ | (Hash[String, Hash[Symbol, Symbol] | StringIO | String | bool] env) -> Integer
5
+ | (Hash[String, Hash[Symbol, String] | StringIO | String | bool] env) -> Integer
6
+ | (Hash[String, Hash[untyped, untyped] | StringIO | String | bool] env) -> Integer
7
+ | (Hash[String, Hash[String, String] | StringIO | String | bool] env) -> Integer
8
+ end
@@ -0,0 +1,98 @@
1
+ module Rack::Test::Methods
2
+ attr_accessor _rack_test_current_session: Rack::Test::Session?
3
+
4
+ def build_rack_test_session: (Symbol _name) -> (Rack::Test::InputRewinder | Proc | Rack::Test::Session)
5
+ | (bool _name) -> Rack::Test::InputRewinder
6
+ | (nil _name) -> Rack::Test::InputRewinder
7
+
8
+ def rack_test_session: (?Symbol name) -> (Rack::Test::Session | String)
9
+ | (?bool name) -> Rack::Test::Session
10
+ | (?nil name) -> Rack::Test::Session
11
+
12
+ def current_session: () -> Rack::Test::Session
13
+
14
+ def request: (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> (Array[nil] | Rack::Test::Session)
15
+ | (*Array[Hash[String, String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> (Array[nil] | Rack::Test::Session)
16
+ | (*Array[Hash[Symbol, Hash[String, String]] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
17
+ | (*Array[Hash[Symbol, Hash[untyped, untyped]] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
18
+ | (*Array[Hash[Symbol, String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
19
+ | (*Array[Hash[Symbol, Hash[String, String] | Symbol] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
20
+ | (*Array[Hash[Symbol, Hash[Symbol, Hash[Symbol, String]]] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
21
+ | (*Array[Hash[Symbol, Symbol] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
22
+ | (*Array[Hash[Symbol, Hash[Symbol, Hash[Symbol, String]] | Symbol] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
23
+ | (*Array[Hash[Symbol, Symbol | String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
24
+ | (*Array[Hash[Symbol | String, Hash[String, String] | Symbol | String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
25
+ | (*Array[Hash[Symbol, Hash[String, String] | Symbol | bool] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
26
+ | (*Array[Hash[Symbol, Hash[Symbol, Integer]] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
27
+ | (*Array[Hash[Symbol, bool] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
28
+ | (*Array[Hash[String, Hash[Symbol, Symbol]] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Array[nil]
29
+
30
+ def last_request: (*Array[untyped] args, **untyped) ?{ (*untyped) -> untyped } -> (Rack::Request | Rack::Test::Session)
31
+
32
+ def get: (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> (Array[nil] | Rack::Test::Session)
33
+ | (*Array[Hash[String, String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> (Array[nil] | Rack::Test::Session)
34
+ | (*Array[Hash[untyped, untyped] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
35
+ | (*Array[String?] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
36
+ | (*Array[Hash[Symbol, String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
37
+ | (*Array[Hash[String, Hash[String, String]] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
38
+ | (*Array[(Hash[String, String] | String)?] args, **untyped) ?{ (*untyped) -> untyped } -> Array[nil]
39
+
40
+ def last_response: (*Array[untyped] args, **untyped) ?{ (*untyped) -> untyped } -> (Rack::MockResponse | Rack::Test::Session)
41
+
42
+ def options: (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
43
+ | (*Array[String?] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
44
+ | (*Array[Hash[untyped, untyped] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
45
+
46
+ def custom_request: (*Array[Hash[untyped, untyped] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
47
+ | (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
48
+
49
+ def delete: (*Array[Hash[untyped, untyped] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
50
+ | (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
51
+ | (*Array[String?] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
52
+ | (*Array[Hash[Symbol, String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
53
+
54
+ def patch: (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
55
+ | (*Array[Hash[untyped, untyped] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
56
+ | (*Array[String?] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
57
+
58
+ def put: (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
59
+ | (*Array[Hash[untyped, untyped] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
60
+ | (*Array[String?] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
61
+
62
+ def post: (*Array[Hash[String, String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
63
+ | (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
64
+ | (*Array[String?] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
65
+ | (*Array[Hash[Symbol, String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
66
+ | (*Array[Hash[untyped, untyped] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
67
+ | (*Array[Hash[String, Array[Rack::Test::UploadedFile]] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
68
+ | (*Array[Hash[String, Hash[String, Hash[String, String]] | Rack::Test::UploadedFile] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
69
+ | (*Array[Hash[String, Hash[String, String] | Rack::Test::UploadedFile] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
70
+ | (*Array[Hash[String, Rack::Test::UploadedFile | String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
71
+ | (*Array[Hash[String, Rack::Test::UploadedFile] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
72
+ | (*Array[Hash[String, Rack::Test::UploadedFile] | Hash[String, String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
73
+ | (*Array[Hash[String, Array[String] | Rack::Test::UploadedFile] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
74
+
75
+ def env: (*Array[Hash[Symbol, String] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
76
+ | (*Array[Hash[Symbol, Symbol] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Hash[Symbol, Symbol]
77
+ | (*Array[String?] args, **untyped) ?{ (*untyped) -> untyped } -> Hash[Symbol, String]
78
+
79
+ def follow_redirect!: (*Array[untyped] args, **untyped) ?{ (*untyped) -> untyped } -> (Rack::Test::Session | String)
80
+
81
+ def header: (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> (Rack::Test::Session | String)
82
+ | (*Array[String?] args, **untyped) ?{ (*untyped) -> untyped } -> String
83
+
84
+ def head: (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
85
+ | (*Array[String?] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
86
+ | (*Array[Hash[untyped, untyped] | String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
87
+
88
+ def basic_authorize: (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
89
+
90
+ def set_cookie: (*Array[String] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
91
+ | (*Array[Array[String]] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::Session
92
+
93
+ def with_session: (Symbol name) -> Rack::Test::Session?
94
+
95
+ def clear_cookies: (*Array[untyped] args, **untyped) ?{ (*untyped) -> untyped } -> Rack::Test::CookieJar
96
+
97
+ alias rack_mock_session rack_test_session
98
+ end
@@ -0,0 +1,186 @@
1
+ class Rack::Test::Session
2
+ attr_accessor cookie_jar: Rack::Test::CookieJar
3
+ def clear_cookies: () -> Rack::Test::CookieJar
4
+ private def initialize: (Rack::Test::InputRewinder app, ?String default_host) -> void
5
+ | (Proc app, ?String default_host) -> void
6
+ def self.new: (Rack::Test::InputRewinder app, ?String default_host) -> Rack::Test::Session
7
+ | (Proc app, ?String default_host) -> Rack::Test::Session
8
+ | (Rack::Test::Session app, ?String default_host) -> Rack::Test::Session
9
+ private def parse_uri: (String path, Hash[untyped, untyped] env) -> Array[String?]
10
+ | (String path, Hash[String, String] env) -> Array[String?]
11
+ | (String path, Hash[Symbol, bool] env) -> Array[String?]
12
+ | (String path, Hash[Symbol, Hash[String, String]] env) -> Array[String?]
13
+ | (String path, Hash[Symbol, Hash[untyped, untyped]] env) -> Array[String?]
14
+ | (String path, Hash[Symbol, String] env) -> Array[String?]
15
+ | (String path, Hash[Symbol, Hash[String, String] | Symbol] env) -> Array[String?]
16
+ | (String path, Hash[Symbol, Hash[Symbol, Hash[Symbol, String]]] env) -> Array[String?]
17
+ | (String path, Hash[Symbol, Symbol] env) -> Array[String?]
18
+ | (String path, Hash[Symbol, Hash[Symbol, Hash[Symbol, String]] | Symbol] env) -> Array[String?]
19
+ | (String path, Hash[Symbol, Symbol | String] env) -> Array[String?]
20
+ | (String path, Hash[Symbol | String, Hash[String, String] | Symbol | String] env) -> Array[String?]
21
+ | (String path, Hash[Symbol, Hash[String, String] | Symbol | bool] env) -> Array[String?]
22
+ | (String path, Hash[Symbol, Hash[Symbol, Integer]] env) -> Array[String?]
23
+ | (String path, Hash[String, Hash[Symbol, Symbol]] env) -> Array[String?]
24
+ | (String path, Hash[String, Hash[untyped, untyped] | String] env) -> Array[String?]
25
+ | (String path, Hash[String, Hash[String, String]] env) -> Array[String?]
26
+ def request: (String uri, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> String?
27
+ | (String uri, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> nil
28
+ | (String uri, ?Hash[Symbol, Hash[String, String]] env) ?{ (*untyped) -> untyped } -> nil
29
+ | (String uri, ?Hash[Symbol, Hash[untyped, untyped]] env) ?{ (*untyped) -> untyped } -> nil
30
+ | (String uri, ?Hash[Symbol, String] env) ?{ (*untyped) -> untyped } -> nil
31
+ | (String uri, ?Hash[Symbol, Hash[String, String] | Symbol] env) ?{ (*untyped) -> untyped } -> nil
32
+ | (String uri, ?Hash[Symbol, Hash[Symbol, Hash[Symbol, String]]] env) ?{ (*untyped) -> untyped } -> nil
33
+ | (String uri, ?Hash[Symbol, Symbol] env) ?{ (*untyped) -> untyped } -> nil
34
+ | (String uri, ?Hash[Symbol, Hash[Symbol, Hash[Symbol, String]] | Symbol] env) ?{ (*untyped) -> untyped } -> nil
35
+ | (String uri, ?Hash[Symbol, Symbol | String] env) ?{ (*untyped) -> untyped } -> nil
36
+ | (String uri, ?Hash[Symbol | String, Hash[String, String] | Symbol | String] env) ?{ (*untyped) -> untyped } -> nil
37
+ | (String uri, ?Hash[Symbol, Hash[String, String] | Symbol | bool] env) ?{ (*untyped) -> untyped } -> nil
38
+ | (String uri, ?Hash[Symbol, Hash[Symbol, Integer]] env) ?{ (*untyped) -> untyped } -> nil
39
+ | (String uri, ?Hash[Symbol, bool] env) ?{ (*untyped) -> untyped } -> nil
40
+ | (String uri, ?Hash[String, Hash[Symbol, Symbol]] env) ?{ (*untyped) -> untyped } -> nil
41
+ private def env_for: (URI::Generic uri, Hash[untyped, untyped] env) -> (singleton(URI::Generic) | String)
42
+ | (URI::Generic uri, Hash[Symbol, Hash[untyped, untyped] | String] env) -> singleton(URI::Generic)
43
+ | (URI::Generic uri, Hash[Symbol, String?] env) -> singleton(URI::Generic)
44
+ | (URI::Generic uri, Hash[String | Symbol, Hash[untyped, untyped] | String] env) -> singleton(URI::Generic)
45
+ | (URI::HTTP uri, Hash[Symbol, Hash[untyped, untyped] | String] env) -> singleton(URI::HTTP)
46
+ | (URI::Generic uri, Hash[Symbol, Hash[untyped, untyped] | bool | String] env) -> singleton(URI::Generic)
47
+ | (URI::Generic uri, Hash[Symbol, String] env) -> singleton(URI::Generic)
48
+ | (URI::Generic uri, Hash[Symbol, Hash[Symbol, String] | String] env) -> singleton(URI::Generic)
49
+ | (URI::Generic uri, Hash[Symbol, Hash[String, String] | String] env) -> singleton(URI::Generic)
50
+ | (URI::Generic uri, Hash[Symbol, Hash[String, Array[Rack::Test::UploadedFile]] | String] env) -> singleton(URI::Generic)
51
+ | (URI::Generic uri, Hash[String, String] env) -> (singleton(URI::Generic) | String)
52
+ | (URI::Generic uri, Hash[Symbol, Hash[String, String]] env) -> singleton(URI::Generic)
53
+ | (URI::HTTPS uri, Hash[untyped, untyped] env) -> singleton(URI::HTTPS)
54
+ | (URI::Generic uri, Hash[Symbol, Hash[untyped, untyped]] env) -> singleton(URI::Generic)
55
+ | (URI::HTTP uri, Hash[untyped, untyped] env) -> singleton(URI::HTTP)
56
+ | (URI::Generic uri, Hash[Symbol, Hash[String, String] | Symbol] env) -> singleton(URI::Generic)
57
+ | (URI::Generic uri, Hash[Symbol, Hash[Symbol, Hash[Symbol, String]]] env) -> singleton(URI::Generic)
58
+ | (URI::Generic uri, Hash[Symbol, Symbol] env) -> singleton(URI::Generic)
59
+ | (URI::Generic uri, Hash[Symbol, Hash[Symbol, Hash[Symbol, String]] | Symbol] env) -> singleton(URI::Generic)
60
+ | (URI::Generic uri, Hash[Symbol, Symbol | String] env) -> singleton(URI::Generic)
61
+ | (URI::Generic uri, Hash[Symbol | String, Hash[String, String] | Symbol | String] env) -> singleton(URI::Generic)
62
+ | (URI::Generic uri, Hash[Symbol, Hash[String, String] | Symbol | bool] env) -> singleton(URI::Generic)
63
+ | (URI::Generic uri, Hash[Symbol, Hash[Symbol, Integer]] env) -> singleton(URI::Generic)
64
+ | (URI::Generic uri, Hash[Symbol, bool] env) -> singleton(URI::Generic)
65
+ | (URI::Generic uri, Hash[Symbol, Hash[String, Hash[String, Hash[String, String]] | Rack::Test::UploadedFile] | String] env) -> singleton(URI::Generic)
66
+ | (URI::Generic uri, Hash[Symbol, Hash[String, Hash[String, String] | Rack::Test::UploadedFile] | String] env) -> singleton(URI::Generic)
67
+ | (URI::Generic uri, Hash[Symbol, Hash[String, Rack::Test::UploadedFile | String] | String] env) -> singleton(URI::Generic)
68
+ | (URI::Generic uri, Hash[Symbol, Hash[String, Rack::Test::UploadedFile] | String] env) -> singleton(URI::Generic)
69
+ | (URI::Generic uri, Hash[String | Symbol, Hash[String, Rack::Test::UploadedFile] | String] env) -> singleton(URI::Generic)
70
+ | (URI::Generic uri, Hash[Symbol, Hash[String, Array[String] | Rack::Test::UploadedFile] | String] env) -> singleton(URI::Generic)
71
+ | (URI::Generic uri, Hash[String, Hash[Symbol, Symbol]] env) -> singleton(URI::Generic)
72
+ | (URI::HTTP uri, Hash[String | Symbol, Hash[untyped, untyped] | String] env) -> singleton(URI::HTTP)
73
+ | (URI::HTTPS uri, Hash[String | Symbol, Hash[untyped, untyped] | String] env) -> singleton(URI::HTTPS)
74
+ | (URI::Generic uri, Hash[Symbol, Hash[String, Hash[String, String]] | String] env) -> singleton(URI::Generic)
75
+ | (URI::Generic uri, Hash[String | Symbol, Hash[String, String] | String] env) -> singleton(URI::Generic)
76
+ | (URI::Generic uri, Hash[String | Symbol, String?] env) -> singleton(URI::Generic)
77
+ | (URI::HTTPS uri, Hash[Symbol, Hash[String, String] | String] env) -> singleton(URI::HTTPS)
78
+ | (URI::HTTPS uri, Hash[Symbol, Hash[untyped, untyped] | String] env) -> singleton(URI::HTTPS)
79
+ | (URI::HTTP uri, Hash[Symbol, Hash[String, String] | String] env) -> singleton(URI::HTTP)
80
+ private def process_request: (URI::Generic uri, Hash[String, StringIO | String | bool] env) -> Rack::Test::CookieJar
81
+ | (URI::HTTP uri, Hash[String, StringIO | String | bool] env) -> Rack::Test::CookieJar
82
+ | (URI::HTTPS uri, Hash[String, StringIO | String | bool] env) -> Rack::Test::CookieJar
83
+ | (URI::Generic uri, Hash[String, Hash[Symbol, Symbol] | StringIO | String | bool] env) -> Rack::Test::CookieJar
84
+ | (URI::Generic uri, Hash[String, Hash[Symbol, String] | StringIO | String | bool] env) -> Rack::Test::CookieJar
85
+ | (URI::HTTP uri, Hash[String, Hash[untyped, untyped] | StringIO | String | bool] env) -> Rack::Test::CookieJar
86
+ | (URI::HTTPS uri, Hash[String, Hash[untyped, untyped] | StringIO | String | bool] env) -> Rack::Test::CookieJar
87
+ | (URI::Generic uri, Hash[String, Hash[String, String] | StringIO | String | bool] env) -> Rack::Test::CookieJar
88
+ private def close_body: (Rack::Lint::Wrapper body) -> nil
89
+ | (untyped body) -> nil
90
+ | (Array[String] body) -> nil
91
+ | (Array[untyped] body) -> nil
92
+ def last_response: () -> Rack::MockResponse
93
+ def last_request: () -> Rack::Request
94
+ def after_request: () ?{ (*untyped) -> untyped } -> Array[Proc]
95
+ def custom_request: (String verb, String uri, ?Hash[untyped, untyped] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> String?
96
+ | (String verb, String uri, ?nil params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> nil
97
+ | (String verb, String uri, ?Hash[untyped, untyped] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> nil
98
+ | (String verb, String uri, ?Hash[untyped, untyped] params, ?Hash[Symbol, bool] env) ?{ (*untyped) -> untyped } -> nil
99
+ | (String verb, String uri, ?String params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> nil
100
+ | (String verb, String uri, ?Hash[Symbol, String] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> nil
101
+ | (String verb, String uri, ?Hash[String, String] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> String?
102
+ | (String verb, String uri, ?Hash[String, Array[Rack::Test::UploadedFile]] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> nil
103
+ | (String verb, String uri, ?Hash[String, Hash[String, Hash[String, String]] | Rack::Test::UploadedFile] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> nil
104
+ | (String verb, String uri, ?Hash[String, Hash[String, String] | Rack::Test::UploadedFile] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> nil
105
+ | (String verb, String uri, ?Hash[String, Rack::Test::UploadedFile | String] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> nil
106
+ | (String verb, String uri, ?Hash[String, Rack::Test::UploadedFile] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> nil
107
+ | (String verb, String uri, ?Hash[String, Rack::Test::UploadedFile] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> nil
108
+ | (String verb, String uri, ?Hash[String, Array[String] | Rack::Test::UploadedFile] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> nil
109
+ | (String verb, String uri, ?Hash[untyped, untyped] params, ?Hash[String, Hash[untyped, untyped] | String] env) ?{ (*untyped) -> untyped } -> String
110
+ | (String verb, String uri, ?Hash[String, String] params, ?Hash[String, Hash[untyped, untyped] | String] env) ?{ (*untyped) -> untyped } -> String
111
+ | (String verb, String uri, ?Hash[untyped, untyped] params, ?Hash[String, Hash[String, String]] env) ?{ (*untyped) -> untyped } -> nil
112
+ | (String verb, String uri, ?Hash[String, Hash[String, String]] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> nil
113
+ | (String verb, String uri, ?Hash[String, String] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> nil
114
+ | (String verb, String uri, ?nil params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> nil
115
+ def get: (String uri, ?Hash[untyped, untyped] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
116
+ | (String uri, ?Hash[String, String] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
117
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[String, Hash[String, String]] env) ?{ (*untyped) -> untyped } -> Array[nil]
118
+ | (String uri, ?nil params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
119
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> Array[nil]
120
+ | (String uri, ?Hash[Symbol, String] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
121
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[Symbol, bool] env) ?{ (*untyped) -> untyped } -> Array[nil]
122
+ | (String uri, ?Hash[String, Hash[String, String]] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
123
+ | (String uri, ?Hash[String, String] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> Array[nil]
124
+ | (String uri, ?nil params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> Array[nil]
125
+ private def append_query_params: (Array[nil] query_array, Hash[untyped, untyped] query_params) -> Array[String?]
126
+ | (Array[String] query_array, Hash[untyped, untyped] query_params) -> Array[String]
127
+ | (Array[nil] query_array, Hash[String, String] query_params) -> String
128
+ | (Array[String] query_array, String query_params) -> Hash[untyped, untyped]
129
+ | (Array[String?] query_array, Hash[String, String] query_params) -> String
130
+ | (Array[String] query_array, Hash[Symbol, Hash[Symbol, String]] query_params) -> String
131
+ | (Array[String] query_array, Hash[Symbol, Integer] query_params) -> String
132
+ | (Array[nil] query_array, Hash[Symbol, String] query_params) -> String
133
+ | (Array[nil] query_array, Hash[String, Hash[String, String]] query_params) -> String
134
+ def restore_state: () -> nil
135
+ def options: (String uri, ?Hash[untyped, untyped] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
136
+ | (String uri, ?nil params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
137
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> Array[nil]
138
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[Symbol, bool] env) ?{ (*untyped) -> untyped } -> Array[nil]
139
+ def delete: (String uri, ?Hash[untyped, untyped] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> Array[nil]
140
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
141
+ | (String uri, ?String params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
142
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[Symbol, bool] env) ?{ (*untyped) -> untyped } -> Array[nil]
143
+ | (String uri, ?nil params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
144
+ | (String uri, ?Hash[Symbol, String] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
145
+ def patch: (String uri, ?String params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
146
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
147
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> Array[nil]
148
+ | (String uri, ?nil params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
149
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[Symbol, bool] env) ?{ (*untyped) -> untyped } -> Array[nil]
150
+ def put: (String uri, ?Hash[untyped, untyped] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
151
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> Array[nil]
152
+ | (String uri, ?nil params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
153
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[Symbol, bool] env) ?{ (*untyped) -> untyped } -> Array[nil]
154
+ | (String uri, ?String params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
155
+ def post: (String uri, ?Hash[String, String] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
156
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
157
+ | (String uri, ?nil params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
158
+ | (String uri, ?Hash[Symbol, String] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
159
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[Symbol, bool] env) ?{ (*untyped) -> untyped } -> Array[nil]
160
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> Array[nil]
161
+ | (String uri, ?String params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
162
+ | (String uri, ?Hash[String, Array[Rack::Test::UploadedFile]] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
163
+ | (String uri, ?Hash[String, Hash[String, Hash[String, String]] | Rack::Test::UploadedFile] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
164
+ | (String uri, ?Hash[String, Hash[String, String] | Rack::Test::UploadedFile] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
165
+ | (String uri, ?Hash[String, Rack::Test::UploadedFile | String] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
166
+ | (String uri, ?Hash[String, Rack::Test::UploadedFile] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
167
+ | (String uri, ?Hash[String, Rack::Test::UploadedFile] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> Array[nil]
168
+ | (String uri, ?Hash[String, Array[String] | Rack::Test::UploadedFile] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
169
+ private def multipart_content_type: (Hash[String | Symbol, bool | String] env) -> String
170
+ | (Hash[String | Symbol, bool | String | Symbol] env) -> String
171
+ def env: (String name, Hash[Symbol, String] value) -> Hash[Symbol, String]
172
+ | (String name, Hash[Symbol, Symbol] value) -> Hash[Symbol, Symbol]
173
+ | (String name, nil value) -> (Hash[Symbol, String] | String)
174
+ | (String name, String value) -> String
175
+ def follow_redirect!: () -> bool?
176
+ def header: (String name, String value) -> String
177
+ | (String name, nil value) -> String
178
+ def head: (String uri, ?Hash[untyped, untyped] params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
179
+ | (String uri, ?nil params, ?Hash[untyped, untyped] env) ?{ (*untyped) -> untyped } -> Array[nil]
180
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[String, String] env) ?{ (*untyped) -> untyped } -> Array[nil]
181
+ | (String uri, ?Hash[untyped, untyped] params, ?Hash[Symbol, bool] env) ?{ (*untyped) -> untyped } -> Array[nil]
182
+ def basic_authorize: (String username, String password) -> String
183
+ def set_cookie: (String cookie, ?nil uri) -> Rack::Test::CookieJar
184
+ | (String cookie, ?URI::Generic uri) -> Rack::Test::CookieJar
185
+ | (Array[String] cookie, ?nil uri) -> Rack::Test::CookieJar
186
+ end
@@ -0,0 +1,18 @@
1
+ class Rack::Test::UploadedFile
2
+ attr_reader tempfile: Tempfile?
3
+ attr_reader original_filename: String
4
+ attr_accessor content_type: String
5
+ private def initialize_from_file_path: (String path) -> singleton(File)
6
+ private def initialize: (String content, ?String content_type, ?bool binary, ?original_filename: nil) -> void
7
+ | (StringIO content, ?String content_type, ?bool binary, ?original_filename: String) -> void
8
+ | (String content, ?String content_type, ?bool binary, ?original_filename: String) -> void
9
+ | (StringIO content, ?String content_type, ?bool binary, ?original_filename: nil) -> void
10
+ def self.finalize: (Tempfile file) -> Proc
11
+ private def respond_to_missing?: (Symbol method_name, ?bool include_private) -> Tempfile?
12
+ def method_missing: (Symbol method_name, *Array[untyped] args) ?{ (*untyped) -> untyped } -> Tempfile
13
+ | (Symbol method_name, *Array[Encoding] args) ?{ (*untyped) -> untyped } -> Tempfile
14
+ def append_to: (String buffer) -> Tempfile
15
+ private def initialize_from_stringio: (StringIO stringio) -> StringIO
16
+ def path: () -> Tempfile
17
+ def self.actually_finalize: (Tempfile file) -> nil
18
+ end
@@ -0,0 +1,112 @@
1
+ module Rack::Test::Utils
2
+ def build_nested_query: (Hash[Symbol, Hash[Symbol, Array[Integer]]] value, ?nil prefix) -> String
3
+ | (Hash[Symbol, Array[Integer]] value, ?String prefix) -> String
4
+ | (Array[Integer] value, ?String prefix) -> String
5
+ | (Integer value, ?String prefix) -> String
6
+ | (Hash[Symbol, nil] value, ?nil prefix) -> String
7
+ | (nil value, ?String prefix) -> String
8
+ | (Hash[Symbol, Integer] value, ?nil prefix) -> String
9
+ | (Hash[String, Array[Integer]] value, ?nil prefix) -> String
10
+ | (nil value, ?nil prefix) -> String
11
+ | (Hash[Symbol, Array[Integer]] value, ?nil prefix) -> String
12
+ | (Hash[Symbol, Hash[Symbol, Integer]] value, ?nil prefix) -> String
13
+ | (Hash[Symbol, Integer] value, ?String prefix) -> String
14
+ | (Hash[Symbol, Array[untyped]] value, ?nil prefix) -> String
15
+ | (Array[untyped] value, ?String prefix) -> String
16
+ | (String value, ?nil prefix) -> String
17
+ | (Hash[Symbol, Array[Hash[Symbol, Integer]]] value, ?nil prefix) -> String
18
+ | (Array[Hash[Symbol, Integer]] value, ?String prefix) -> String
19
+ | (Hash[untyped, untyped] value, ?nil prefix) -> String
20
+ | (Hash[Symbol, String] value, ?nil prefix) -> String
21
+ | (String value, ?String prefix) -> String
22
+ | (Hash[String, String] value, ?nil prefix) -> String
23
+ | (Hash[String, Hash[String, String]] value, ?nil prefix) -> String
24
+ | (Hash[String, String] value, ?String prefix) -> String
25
+ | (Hash[Symbol, Hash[Symbol, String]] value, ?nil prefix) -> String
26
+ | (Hash[Symbol, String] value, ?String prefix) -> String
27
+
28
+ def build_multipart: (Hash[untyped, untyped] params, ?bool _first, ?bool multipart) -> nil
29
+ | (Hash[Symbol, String] params, ?bool _first, ?bool multipart) -> nil
30
+ | (Hash[String, String] params, ?bool _first, ?bool multipart) -> String?
31
+ | (Hash[String, Array[Rack::Test::UploadedFile]] params, ?bool _first, ?bool multipart) -> bool
32
+ | (Hash[Symbol, Hash[Symbol, String]] params, ?bool _first, ?bool multipart) -> nil
33
+ | (Hash[String, Hash[String, Hash[String, String]] | Rack::Test::UploadedFile] params, ?bool _first, ?bool multipart) -> bool
34
+ | (Hash[String, Hash[String, String] | Rack::Test::UploadedFile] params, ?bool _first, ?bool multipart) -> bool
35
+ | (Hash[String, Rack::Test::UploadedFile | String] params, ?bool _first, ?bool multipart) -> bool
36
+ | (Hash[String, Rack::Test::UploadedFile] params, ?bool _first, ?bool multipart) -> bool
37
+ | (Hash[String, Array[String] | Rack::Test::UploadedFile] params, ?bool _first, ?bool multipart) -> bool
38
+ | (Hash[String, Array[Hash[String, String]]] params, ?bool _first, ?bool multipart) -> nil
39
+ | (Hash[String, Array[Rack::Test::UploadedFile] | String] params, ?bool _first, ?bool multipart) -> bool
40
+ | (Hash[String, Array[Hash[String, String | Rack::Test::UploadedFile]] | Array[String]] params, ?bool _first, ?bool multipart) -> bool
41
+ | (Hash[String, Array[Rack::Test::UploadedFile | String]] params, ?bool _first, ?bool multipart) -> bool
42
+ | (Hash[String, Hash[String, String] | String | Rack::Test::UploadedFile] params, ?bool _first, ?bool multipart) -> bool
43
+ | (Hash[String, untyped] params, ?bool _first, ?bool multipart) -> bool
44
+ | (Hash[String, Hash[String, Array[Hash[String, String] | Hash[String, Array[Hash[String, String]] | String]]] | Rack::Test::UploadedFile] params, ?bool _first, ?bool multipart) -> bool
45
+ | (Hash[String, Array[Hash[String, String | Rack::Test::UploadedFile] | Hash[String, Array[String] | String]]] params, ?bool _first, ?bool multipart) -> bool
46
+ | (Hash[String, Array[Hash[String, String]] | Rack::Test::UploadedFile] params, ?bool _first, ?bool multipart) -> bool
47
+ | (Hash[String, String | Rack::Test::UploadedFile] params, ?bool _first, ?bool multipart) -> bool
48
+ | (Hash[String, Array[Hash[String, Rack::Test::UploadedFile | String]] | Array[String]] params, ?bool _first, ?bool multipart) -> bool
49
+ | (Hash[String, Array[Hash[String, Array[String] | String]]] params, ?bool _first, ?bool multipart) -> String
50
+
51
+ private def normalize_multipart_params: (Hash[String, Array[Rack::Test::UploadedFile]] params, ?bool first) -> Hash[String, Array[Rack::Test::UploadedFile]]
52
+ | (Hash[String, String] params, ?bool first) -> Hash[String, String]
53
+ | (Hash[String, Hash[String, String]] params, ?bool first) -> Hash[String, String]
54
+ | (Hash[String, Hash[String, Hash[String, String]] | Rack::Test::UploadedFile] params, ?bool first) -> Hash[String, Rack::Test::UploadedFile | String]
55
+ | (Hash[String, Hash[String, String] | Rack::Test::UploadedFile] params, ?bool first) -> Hash[String, Rack::Test::UploadedFile | String]
56
+ | (Hash[String, Rack::Test::UploadedFile | String] params, ?bool first) -> Hash[String, Rack::Test::UploadedFile | String]
57
+ | (Hash[String, Rack::Test::UploadedFile] params, ?bool first) -> Hash[String, Rack::Test::UploadedFile]
58
+ | (Hash[String, Array[String] | Rack::Test::UploadedFile] params, ?bool first) -> Hash[String, Array[String] | Rack::Test::UploadedFile]
59
+ | (Hash[String, Array[Rack::Test::UploadedFile] | String] params, ?bool first) -> Hash[String, Array[Rack::Test::UploadedFile] | String]
60
+ | (Hash[String, String | Rack::Test::UploadedFile] params, ?bool first) -> Hash[String, String | Rack::Test::UploadedFile]
61
+ | (Hash[String, Array[Hash[String, String | Rack::Test::UploadedFile]] | Array[String]] params, ?bool first) -> Hash[String, Array[Hash[String, String | Rack::Test::UploadedFile]] | Array[String]]
62
+ | (Hash[String, Array[Rack::Test::UploadedFile | String]] params, ?bool first) -> Hash[String, Array[Rack::Test::UploadedFile | String]]
63
+ | (Hash[String, Hash[String, String] | String | Rack::Test::UploadedFile] params, ?bool first) -> Hash[String, String | Rack::Test::UploadedFile]
64
+ | (Hash[String, untyped] params, ?bool first) -> Hash[String, untyped]
65
+ | (Hash[String, Array[Hash[String, String]] | String] params, ?bool first) -> Hash[String, Array[Hash[String, String]] | String]
66
+ | (Hash[String, Array[Hash[String, String] | Hash[String, Array[Hash[String, String]] | String]]] params, ?bool first) -> Hash[String, Array[Hash[String, String] | Hash[String, Array[Hash[String, String]] | String]]]
67
+ | (Hash[String, Hash[String, Array[Hash[String, String] | Hash[String, Array[Hash[String, String]] | String]]] | Rack::Test::UploadedFile] params, ?bool first) -> Hash[String, Array[Hash[String, String] | Hash[String, Array[Hash[String, String]] | String]] | Rack::Test::UploadedFile]
68
+ | (Hash[String, Array[String] | String] params, ?bool first) -> Hash[String, Array[String] | String]
69
+ | (Hash[String, Array[Hash[String, String | Rack::Test::UploadedFile] | Hash[String, Array[String] | String]]] params, ?bool first) -> Hash[String, Array[Hash[String, String | Rack::Test::UploadedFile] | Hash[String, Array[String] | String]]]
70
+ | (Hash[String, Array[Hash[String, String]] | Rack::Test::UploadedFile] params, ?bool first) -> Hash[String, Array[Hash[String, String]] | Rack::Test::UploadedFile]
71
+ | (Hash[String, Array[Hash[String, Rack::Test::UploadedFile | String]] | Array[String]] params, ?bool first) -> Hash[String, Array[Hash[String, Rack::Test::UploadedFile | String]] | Array[String]]
72
+ | (Hash[String, Array[Hash[String, Array[String] | String]]] params, ?bool first) -> Hash[String, Array[Hash[String, Array[String] | String]]]
73
+
74
+ private def _build_parts: (String buffer, Hash[String, Array[Rack::Test::UploadedFile]] parameters) -> File
75
+ | (String buffer, Hash[String, String] parameters) -> Array[Array[String]]
76
+ | (String buffer, Hash[String, Rack::Test::UploadedFile | String] parameters) -> File
77
+ | (String buffer, Hash[String, Rack::Test::UploadedFile] parameters) -> File
78
+ | (String buffer, Hash[String, Array[String] | Rack::Test::UploadedFile] parameters) -> File
79
+ | (String buffer, Hash[String, Array[Rack::Test::UploadedFile] | String] parameters) -> File
80
+ | (String buffer, Hash[String, String | Rack::Test::UploadedFile] parameters) -> File
81
+ | (String buffer, Hash[String, Array[Hash[String, String | Rack::Test::UploadedFile]] | Array[String]] parameters) -> singleton(Object)
82
+ | (String buffer, Hash[String, Array[Rack::Test::UploadedFile | String]] parameters) -> File
83
+ | (String buffer, Hash[String, untyped] parameters) -> bool
84
+ | (String buffer, Hash[String, Array[Hash[String, String] | Hash[String, Array[Hash[String, String]] | String]] | Rack::Test::UploadedFile] parameters) -> File
85
+ | (String buffer, Hash[String, Array[Hash[String, String]] | String] parameters) -> Array[Array[String] | Array[Hash[String, String]]]
86
+ | (String buffer, Hash[String, Array[Hash[String, String | Rack::Test::UploadedFile] | Hash[String, Array[String] | String]]] parameters) -> singleton(Object)
87
+ | (String buffer, Hash[String, Array[String] | String] parameters) -> Array[Array[String]]
88
+ | (String buffer, Hash[String, Array[Hash[String, String]] | Rack::Test::UploadedFile] parameters) -> File
89
+ | (String buffer, Hash[String, Array[Hash[String, Rack::Test::UploadedFile | String]] | Array[String]] parameters) -> singleton(Object)
90
+ | (String buffer, Hash[String, Array[Hash[String, Array[String] | String]]] parameters) -> Array[Array[Hash[String, Array[String] | String]]]
91
+
92
+ private def build_parts: (String buffer, Hash[String, Array[Rack::Test::UploadedFile]] parameters) -> singleton(Object)
93
+ | (String buffer, Hash[String, String] parameters) -> String
94
+ | (String buffer, Hash[String, Rack::Test::UploadedFile | String] parameters) -> singleton(Object)
95
+ | (String buffer, Hash[String, Rack::Test::UploadedFile] parameters) -> singleton(Object)
96
+ | (String buffer, Hash[String, Array[String] | Rack::Test::UploadedFile] parameters) -> singleton(Object)
97
+ | (String buffer, Hash[String, Array[Rack::Test::UploadedFile] | String] parameters) -> singleton(Object)
98
+ | (String buffer, Hash[String, Array[Hash[String, String | Rack::Test::UploadedFile]] | Array[String]] parameters) -> bool
99
+ | (String buffer, Hash[String, Array[Rack::Test::UploadedFile | String]] parameters) -> singleton(Object)
100
+ | (String buffer, Hash[String, String | Rack::Test::UploadedFile] parameters) -> singleton(Object)
101
+ | (String buffer, Hash[String, untyped] parameters) -> bool
102
+ | (String buffer, Hash[String, Array[Hash[String, String] | Hash[String, Array[Hash[String, String]] | String]] | Rack::Test::UploadedFile] parameters) -> singleton(Object)
103
+ | (String buffer, Hash[String, Array[Hash[String, String | Rack::Test::UploadedFile] | Hash[String, Array[String] | String]]] parameters) -> bool
104
+ | (String buffer, Hash[String, Array[Hash[String, String]] | Rack::Test::UploadedFile] parameters) -> singleton(Object)
105
+ | (String buffer, Hash[String, Array[Hash[String, Rack::Test::UploadedFile | String]] | Array[String]] parameters) -> bool
106
+ | (String buffer, Hash[String, Array[Hash[String, Array[String] | String]]] parameters) -> String
107
+
108
+ private def build_file_part: (String buffer, String parameter_name, Rack::Test::UploadedFile uploaded_file) -> String
109
+ | (String buffer, String parameter_name, untyped uploaded_file) -> String
110
+
111
+ private def build_primitive_part: (String buffer, String parameter_name, String value) -> String
112
+ end
@@ -0,0 +1,3 @@
1
+ module Rack::Test
2
+ def self.encoding_aware_strings?: () -> String
3
+ end
@@ -9,32 +9,55 @@ module Orthoses
9
9
 
10
10
  def update_decl
11
11
  return unless @decl.respond_to?(:members)
12
- uniq_map = {}
13
- @decl.members.each do |member|
14
- if member.instance_of?(RBS::AST::Members::MethodDefinition) && member.overloading?
15
- # avoid to duplicate and keep order
16
- uniq_map[Object.new] = member
17
- else
18
- key = member_key(member)
19
- drop_member = uniq_map[key]
20
- uniq_map[key] = member
21
- if drop_member
22
- Orthoses.logger.info("#{@decl.name} \"#{member.location.source}\" was droped since duplication")
23
- end
24
- end
25
- end
12
+
13
+ uniq_map = uniq_members
14
+ drop_set_method_definition(uniq_map)
26
15
  drop_known_method_definition(uniq_map)
16
+
27
17
  @decl.members.replace(uniq_map.values)
28
18
  end
29
19
 
30
20
  private
31
21
 
22
+ def uniq_members
23
+ {}.tap do |uniq_map|
24
+ @decl.members.each do |member|
25
+ if member.instance_of?(RBS::AST::Members::MethodDefinition) && member.overloading?
26
+ # avoid to duplicate and keep order
27
+ uniq_map[Object.new] = member
28
+ else
29
+ key = member_key(member)
30
+ drop_member = uniq_map[key]
31
+ uniq_map[key] = member
32
+ if drop_member
33
+ Orthoses.logger.info("#{@decl.name} \"#{member.location.source}\" was droped since duplication")
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ def drop_set_method_definition(uniq_map)
41
+ attr_accessors = uniq_map.values.grep(RBS::AST::Members::AttrAccessor)
42
+ attr_accessors.each do |member|
43
+ uniq_map.delete([RBS::AST::Members::MethodDefinition, :"#{member.name}=", member.kind])
44
+ end
45
+ end
46
+
32
47
  def drop_known_method_definition(uniq_map)
33
48
  decl_name = @decl.name.absolute!
34
49
  if m_entry = @env.class_decls[decl_name]
35
50
  m_entry.decls.each do |d|
36
- d.decl.members.grep_v(RBS::AST::Members::LocationOnly).each do |member|
37
- uniq_map.delete(member_key(member))
51
+ d.decl.members.each do |member|
52
+ case member
53
+ when RBS::AST::Members::LocationOnly
54
+ # ignore
55
+ when RBS::AST::Members::AttrAccessor
56
+ uniq_map.delete([RBS::AST::Members::MethodDefinition, member.name, member.kind])
57
+ uniq_map.delete([RBS::AST::Members::MethodDefinition, :"#{member.name}=", member.kind])
58
+ else
59
+ uniq_map.delete(member_key(member))
60
+ end
38
61
  end
39
62
  end
40
63
  end
@@ -60,12 +83,11 @@ module Orthoses
60
83
  when RBS::AST::Members::Alias
61
84
  [RBS::AST::Members::MethodDefinition, member.new_name, member.kind]
62
85
  when RBS::AST::Members::AttrAccessor
63
- # FIXME: how to check "#{member.name}=" ?
64
86
  [RBS::AST::Members::MethodDefinition, member.name, member.kind]
65
87
  when RBS::AST::Members::AttrReader
66
88
  [RBS::AST::Members::MethodDefinition, member.name, member.kind]
67
89
  when RBS::AST::Members::AttrWriter
68
- [RBS::AST::Members::MethodDefinition, "#{member.name}=", member.kind]
90
+ [RBS::AST::Members::MethodDefinition, :"#{member.name}=", member.kind]
69
91
  else
70
92
  [member.class, member.name]
71
93
  end
@@ -16,9 +16,17 @@ module Orthoses
16
16
  end
17
17
  end
18
18
 
19
- def initialize(constant_filter: nil, mixin_filter: nil, attribute_filter: nil)
19
+ def initialize(
20
+ method_definition_filter: nil,
21
+ alias_filter: nil,
22
+ constant_filter: nil,
23
+ mixin_filter: nil,
24
+ attribute_filter: nil
25
+ )
20
26
  @load_env = RBS::Environment.new
21
27
  @known_env = Utils.rbs_environment(cache: false)
28
+ @method_definition_filter = method_definition_filter
29
+ @alias_filter = alias_filter
22
30
  @constant_filter = constant_filter
23
31
  @mixin_filter = mixin_filter
24
32
  @attribute_filter = attribute_filter
@@ -34,7 +42,8 @@ module Orthoses
34
42
  def write_to(store:)
35
43
  each do |add_content|
36
44
  content = store[add_content.name]
37
- content.header = add_content.header
45
+ content.header ||= add_content.header
46
+ content.comment ||= add_content.comment
38
47
  content.concat(add_content.body)
39
48
  end
40
49
  end
@@ -47,6 +56,7 @@ module Orthoses
47
56
  @load_env.class_decls.each do |type_name, m_entry|
48
57
  name = type_name.relative!.to_s
49
58
  content = Content.new(name: name)
59
+ content.comment = m_entry.primary.decl.comment&.string&.gsub(/^/, "# ")
50
60
  content.header = header_builder.build(entry: m_entry, name_hint: name)
51
61
  decls_to_lines(m_entry.decls.map(&:decl)).each do |line|
52
62
  content << line
@@ -94,9 +104,12 @@ module Orthoses
94
104
  when RBS::AST::Declarations::Constant
95
105
  next unless @constant_filter.nil? || @constant_filter.call(member)
96
106
  when RBS::AST::Members::MethodDefinition
107
+ next unless @method_definition_filter.nil? || @method_definition_filter.call(member)
97
108
  if last_visibility == :private && member.kind != :singleton_instance
98
109
  member.instance_variable_set(:@visibility, :private)
99
110
  end
111
+ when RBS::AST::Members::Alias
112
+ next unless @alias_filter.nil? || @alias_filter.call(member)
100
113
  when RBS::AST::Members::Mixin
101
114
  next unless @mixin_filter.nil? || @mixin_filter.call(member)
102
115
  when RBS::AST::Members::Attribute
@@ -74,12 +74,52 @@ module Orthoses
74
74
  end
75
75
 
76
76
  def original_rbs
77
- a = []
78
- a << @comment if @comment
79
- a << @header
80
- a << " #{@body.join("\n ")}" if @body.length > 0
81
- a << "end"
82
- a.join("\n")
77
+ io = StringIO.new
78
+ io.puts @comment if @comment
79
+ io.puts @header
80
+ @body.each do |line|
81
+ io.puts " #{line}"
82
+ end
83
+ io.puts "end"
84
+ io.string
85
+ end
86
+
87
+ def auto_header
88
+ env = Utils.rbs_environment
89
+ if entry = env.class_decls[TypeName(name).absolute!]
90
+ @header = Content::HeaderBuilder.new(env: env).build(entry: entry)
91
+ return
92
+ end
93
+
94
+ return unless @header.nil?
95
+
96
+ if interface?
97
+ self.header = "interface #{name}"
98
+ return
99
+ end
100
+
101
+ val = Object.const_get(name)
102
+
103
+ case val
104
+ when Class
105
+ superclass =
106
+ if val.superclass && val.superclass != Object
107
+ super_module_name = Utils.module_name(val.superclass)
108
+
109
+ if super_module_name && super_module_name != "Random::Base" # https://github.com/ruby/rbs/pull/977
110
+ " < ::#{super_module_name}#{temporary_type_params(super_module_name)}"
111
+ else
112
+ nil
113
+ end
114
+ else
115
+ nil
116
+ end
117
+ self.header = "class #{Utils.module_name(val)}#{type_params(name)}#{superclass}"
118
+ when Module
119
+ self.header = "module #{Utils.module_name(val)}#{type_params(name)}"
120
+ else
121
+ raise "#{val.inspect} is not class/module"
122
+ end
83
123
  end
84
124
 
85
125
  private
@@ -132,44 +172,6 @@ module Orthoses
132
172
  raise
133
173
  end
134
174
 
135
- def auto_header
136
- env = Utils.rbs_environment
137
- if entry = env.class_decls[TypeName(name).absolute!]
138
- @header = Content::HeaderBuilder.new(env: env).build(entry: entry)
139
- return
140
- end
141
-
142
- return unless @header.nil?
143
-
144
- if interface?
145
- self.header = "interface #{name}"
146
- return
147
- end
148
-
149
- val = Object.const_get(name)
150
-
151
- case val
152
- when Class
153
- superclass =
154
- if val.superclass && val.superclass != Object
155
- super_module_name = Utils.module_name(val.superclass)
156
-
157
- if super_module_name && super_module_name != "Random::Base" # https://github.com/ruby/rbs/pull/977
158
- " < ::#{super_module_name}#{temporary_type_params(super_module_name)}"
159
- else
160
- nil
161
- end
162
- else
163
- nil
164
- end
165
- self.header = "class #{Utils.module_name(val)}#{type_params(name)}#{superclass}"
166
- when Module
167
- self.header = "module #{Utils.module_name(val)}#{type_params(name)}"
168
- else
169
- raise "#{val.inspect} is not class/module"
170
- end
171
- end
172
-
173
175
  def temporary_type_params(name)
174
176
  Utils.known_type_params(name)&.then do |params|
175
177
  if params.empty?
@@ -16,8 +16,8 @@ module Orthoses
16
16
  def call
17
17
  @loader.call.tap do |store|
18
18
  store.filter! do |name, content|
19
- @block.call(name, content).tap do
20
- Orthoses.logger.debug("Filter pass [#{name}]")
19
+ @block.call(name, content).tap do |bool|
20
+ Orthoses.logger.debug("[Filter] #{bool ? "Pass" : "Reject"} [#{name}]")
21
21
  end
22
22
  end
23
23
  end
@@ -1,11 +1,23 @@
1
1
  module Orthoses
2
2
  # Call `rbs prototype rb` and add to store
3
3
  # use Orthoses::RBSPrototypeRB,
4
- # paths: Dir.glob("lib/**/*.rb")
4
+ # paths: Dir.glob("lib/**/*.rb"),
5
+ # method_definition_filter: ->(member) { false },
6
+ # alias_filter: ->(member) { false }
5
7
  class RBSPrototypeRB
6
- def initialize(loader, paths:, constant_filter: nil, mixin_filter: nil, attribute_filter: nil)
8
+ def initialize(
9
+ loader,
10
+ paths:,
11
+ method_definition_filter: nil,
12
+ alias_filter: nil,
13
+ constant_filter: nil,
14
+ mixin_filter: nil,
15
+ attribute_filter: nil
16
+ )
7
17
  @loader = loader
8
18
  @paths = paths
19
+ @method_definition_filter = method_definition_filter
20
+ @alias_filter = alias_filter
9
21
  @constant_filter = constant_filter
10
22
  @mixin_filter = mixin_filter
11
23
  @attribute_filter = attribute_filter
@@ -23,6 +35,8 @@ module Orthoses
23
35
  end
24
36
  end
25
37
  env = Orthoses::Content::Environment.new(
38
+ method_definition_filter: @method_definition_filter,
39
+ alias_filter: @alias_filter,
26
40
  constant_filter: @constant_filter,
27
41
  mixin_filter: @mixin_filter,
28
42
  attribute_filter: @attribute_filter,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orthoses
4
- VERSION = "1.6.0"
4
+ VERSION = "1.7.0"
5
5
  end
@@ -1,5 +1,14 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # Middleware builder like the Rack
4
+ # Builder.new do
5
+ # use Orthoses::CreateFileByName
6
+ # use Orthoses::Constant
7
+ # use Orthoses::Mixin
8
+ # use Orthoses::Walk,
9
+ # root: "Foo"
10
+ # run ->() { require 'foo' }
11
+ # end
3
12
  class Orthoses::Builder
4
13
  def initialize: () ?{ () -> untyped } -> void
5
14
  def use: (untyped middleware, *untyped args, **untyped key) ?{ () -> untyped } -> untyped
@@ -1,6 +1,6 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
- class Orthoses::CallTracer::Capture < ::Struct[untyped]
3
+ class Orthoses::CallTracer::Capture
4
4
  def method: () -> Method
5
5
  def argument: () -> Hash[Symbol, untyped]
6
6
  end
@@ -1,5 +1,17 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # CallTracer::Lazy is possible to perform a trace
4
+ # equivalent to CallTracer before method is defined.
5
+ # scope = CallTracerLazy.new
6
+ # scope.trace("ActiveRecord::Base#scope") do
7
+ # require 'active_record/all'
8
+ # @loader.call
9
+ # end
10
+ # scope.captures.each do |capture|
11
+ # capture.argument[:name]
12
+ # capture.argument[:body]
13
+ # capture.argument[:block]
14
+ # end
3
15
  class Orthoses::CallTracer::Lazy
4
16
  def initialize: () -> void
5
17
  def trace: (String name) ?{ () -> untyped } -> untyped
@@ -1,8 +1,11 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # Check and drop duplication method, const etc...
3
4
  class Orthoses::Content::DuplicationChecker
4
5
  def initialize: (untyped decl, ?env: untyped?) -> void
5
6
  def update_decl: () -> (nil | untyped)
7
+ private def uniq_members: () -> untyped
8
+ private def drop_set_method_definition: (untyped uniq_map) -> untyped
6
9
  private def drop_known_method_definition: (untyped uniq_map) -> untyped
7
10
  private def member_key: (untyped member) -> untyped
8
11
  end
@@ -12,10 +12,10 @@ class Orthoses::Content
12
12
  def uniq!: () -> untyped
13
13
  def sort!: () -> untyped
14
14
  def original_rbs: () -> untyped
15
+ def auto_header: () -> (nil | untyped)
15
16
  private def decl_to_lines: (untyped decl) -> untyped
16
17
  private def uniqed_body_string: () -> String
17
18
  private def uniqed_body_decl: () -> RBS::AST::Declarations::t
18
- private def auto_header: () -> (nil | untyped)
19
19
  private def temporary_type_params: (untyped name) -> untyped
20
20
  private def type_params: (untyped name) -> untyped
21
21
  attr_reader name: String
@@ -1,5 +1,10 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # Filter current store.
4
+ # filter stored key and value if proc return true
5
+ # use Orthoses::Filter do |name, content|
6
+ # Orthoses.rbs_defined_class?(name)
7
+ # end
3
8
  class Orthoses::Filter
4
9
  def initialize: (Orthoses::_Call loader) { (String, Orthoses::Content) -> boolish } -> void
5
10
  def call: () -> Orthoses::store
@@ -1,5 +1,13 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # TracePoint wrapper that allows setting hooks
4
+ # even if the target is undefined
5
+ # LazyTracePoint.new(:call) do |tp|
6
+ # ...
7
+ # end.enable(target: 'Class#class_attribute') do
8
+ # require 'active_support/core_ext/class/attribute'
9
+ # ...
10
+ # end
3
11
  class Orthoses::LazyTracePoint < ::TracePoint
4
12
  def method_added: (untyped id) -> untyped
5
13
  def singleton_method_added: (untyped id) -> untyped
@@ -1,5 +1,7 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # AvoidRecursiveAncestorError is an internal middleware
4
+ # It's using on orthoses/outputable.rb
3
5
  class Orthoses::Outputable::AvoidRecursiveAncestorError
4
6
  def initialize: (Orthoses::_Call loader) -> void
5
7
  def call: () -> Orthoses::store
@@ -1,5 +1,7 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # Constantizable is an internal middleware
4
+ # It's using on orthoses/outputable.rb
3
5
  class Orthoses::Outputable::ConstantizableFilter
4
6
  def initialize: (untyped loader) -> void
5
7
  def call: () -> untyped
@@ -1,5 +1,7 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # UniqContentBody is an internal middleware
4
+ # It's using on orthoses/outputable.rb
3
5
  class Orthoses::Outputable::UniqContentBody
4
6
  def initialize: (untyped loader) -> void
5
7
  def call: () -> untyped
data/sig/orthoses/pp.rbs CHANGED
@@ -1,5 +1,7 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # Debug current stored values
4
+ # use Orthoses::PP
3
5
  class Orthoses::PP
4
6
  def initialize: (untyped loader) -> void
5
7
  def call: () -> untyped
@@ -1,5 +1,10 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # Call `rbs prototype rb` and add to store
4
+ # use Orthoses::RBSPrototypeRB,
5
+ # paths: Dir.glob("lib/**/*.rb"),
6
+ # method_definition_filter: ->(member) { false },
7
+ # alias_filter: ->(member) { false }
3
8
  class Orthoses::RBSPrototypeRB
4
9
  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
10
  def call: () -> Orthoses::store
@@ -1,5 +1,8 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # Call `rbs prototype runtime` and add to store
4
+ # use Orthoses::RBSPrototypeRuntime,
5
+ # patterns: ['Foo::*']
3
6
  class Orthoses::RBSPrototypeRuntime
4
7
  def initialize: (untyped loader, patterns: untyped) -> void
5
8
  def call: () -> untyped
@@ -1,5 +1,6 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # use Orthoses::Sort
3
4
  class Orthoses::Sort
4
5
  def initialize: (untyped loader) -> void
5
6
  def call: () -> untyped
@@ -1,5 +1,7 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # Internal middleware for return store object
4
+ # Builder set this middleware on last stack by default
3
5
  class Orthoses::Store
4
6
  def initialize: (untyped loader) -> void
5
7
  def call: () -> untyped
data/sig/orthoses/tap.rbs CHANGED
@@ -1,5 +1,8 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # use Orthoses::Tap do |store|
4
+ # store["Foo::Bar"] << "def baz: () -> void"
5
+ # end
3
6
  class Orthoses::Tap
4
7
  def initialize: (Orthoses::_Call loader) -> void
5
8
  def call: () -> Orthoses::store
@@ -1,5 +1,6 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
+ # internal
3
4
  class Orthoses::Utils::TypeList
4
5
  def initialize: (untyped types) -> void
5
6
  def inject: () -> untyped
data/sig/orthoses.rbs CHANGED
@@ -1,7 +1,7 @@
1
1
  # THIS IS GENERATED CODE from `$ rake generate_self_sig`
2
2
 
3
3
  module Orthoses
4
- VERSION: "1.6.0"
4
+ VERSION: "1.7.0"
5
5
 
6
6
  attr_accessor self.logger: ::Logger
7
7
 
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.6.0
4
+ version: 1.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: 2023-03-15 00:00:00.000000000 Z
11
+ date: 2023-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbs
@@ -41,6 +41,15 @@ files:
41
41
  - examples/rack-test/Gemfile.lock
42
42
  - examples/rack-test/Rakefile
43
43
  - examples/rack-test/generate.rb
44
+ - examples/rack-test/out/rack/test.rbs
45
+ - examples/rack-test/out/rack/test/cookie.rbs
46
+ - examples/rack-test/out/rack/test/cookie_jar.rbs
47
+ - examples/rack-test/out/rack/test/fake_app.rbs
48
+ - examples/rack-test/out/rack/test/input_rewinder.rbs
49
+ - examples/rack-test/out/rack/test/methods.rbs
50
+ - examples/rack-test/out/rack/test/session.rbs
51
+ - examples/rack-test/out/rack/test/uploaded_file.rbs
52
+ - examples/rack-test/out/rack/test/utils.rbs
44
53
  - examples/simple_middleware.rb
45
54
  - examples/simple_middleware.rbs
46
55
  - lib/orthoses.rb
@@ -156,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
165
  - !ruby/object:Gem::Version
157
166
  version: '0'
158
167
  requirements: []
159
- rubygems_version: 3.4.8
168
+ rubygems_version: 3.4.10
160
169
  signing_key:
161
170
  specification_version: 4
162
171
  summary: Framework for Generate RBS