rbs 0.10.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +9 -9
  3. data/CHANGELOG.md +29 -0
  4. data/Gemfile +1 -0
  5. data/README.md +1 -1
  6. data/Rakefile +16 -6
  7. data/Steepfile +28 -0
  8. data/bin/steep +4 -0
  9. data/bin/test_runner.rb +7 -5
  10. data/docs/syntax.md +14 -1
  11. data/lib/rbs/ast/comment.rb +7 -1
  12. data/lib/rbs/ast/declarations.rb +15 -9
  13. data/lib/rbs/ast/members.rb +3 -8
  14. data/lib/rbs/buffer.rb +1 -1
  15. data/lib/rbs/cli.rb +72 -3
  16. data/lib/rbs/constant.rb +1 -1
  17. data/lib/rbs/constant_table.rb +9 -8
  18. data/lib/rbs/definition.rb +31 -14
  19. data/lib/rbs/definition_builder.rb +97 -67
  20. data/lib/rbs/environment.rb +28 -11
  21. data/lib/rbs/environment_loader.rb +67 -47
  22. data/lib/rbs/location.rb +1 -5
  23. data/lib/rbs/method_type.rb +5 -5
  24. data/lib/rbs/namespace.rb +14 -3
  25. data/lib/rbs/parser.y +2 -12
  26. data/lib/rbs/prototype/rb.rb +3 -5
  27. data/lib/rbs/prototype/rbi.rb +1 -4
  28. data/lib/rbs/prototype/runtime.rb +0 -4
  29. data/lib/rbs/substitution.rb +4 -3
  30. data/lib/rbs/test/setup.rb +5 -1
  31. data/lib/rbs/test/setup_helper.rb +15 -0
  32. data/lib/rbs/test/tester.rb +7 -5
  33. data/lib/rbs/test/type_check.rb +14 -2
  34. data/lib/rbs/type_name.rb +18 -1
  35. data/lib/rbs/type_name_resolver.rb +10 -3
  36. data/lib/rbs/types.rb +27 -21
  37. data/lib/rbs/variance_calculator.rb +9 -6
  38. data/lib/rbs/version.rb +1 -1
  39. data/lib/rbs/writer.rb +26 -17
  40. data/sig/annotation.rbs +26 -0
  41. data/sig/buffer.rbs +28 -0
  42. data/sig/builtin_names.rbs +41 -0
  43. data/sig/comment.rbs +26 -0
  44. data/sig/constant.rbs +21 -0
  45. data/sig/constant_table.rbs +30 -0
  46. data/sig/declarations.rbs +202 -0
  47. data/sig/definition.rbs +129 -0
  48. data/sig/definition_builder.rbs +94 -0
  49. data/sig/environment.rbs +94 -0
  50. data/sig/environment_loader.rbs +58 -0
  51. data/sig/location.rbs +52 -0
  52. data/sig/members.rbs +160 -0
  53. data/sig/method_types.rbs +40 -0
  54. data/sig/namespace.rbs +124 -0
  55. data/sig/polyfill.rbs +3 -0
  56. data/sig/rbs.rbs +3 -0
  57. data/sig/substitution.rbs +39 -0
  58. data/sig/type_name_resolver.rbs +24 -0
  59. data/sig/typename.rbs +70 -0
  60. data/sig/types.rbs +361 -0
  61. data/sig/util.rbs +13 -0
  62. data/sig/variance_calculator.rbs +35 -0
  63. data/sig/version.rbs +3 -0
  64. data/sig/writer.rbs +40 -0
  65. data/stdlib/bigdecimal/big_decimal.rbs +887 -0
  66. data/stdlib/bigdecimal/math/big_math.rbs +142 -0
  67. data/stdlib/builtin/array.rbs +2 -1
  68. data/stdlib/builtin/builtin.rbs +0 -3
  69. data/stdlib/builtin/hash.rbs +1 -1
  70. data/stdlib/builtin/kernel.rbs +2 -0
  71. data/stdlib/builtin/math.rbs +26 -26
  72. data/stdlib/builtin/struct.rbs +9 -10
  73. data/stdlib/date/date.rbs +1056 -0
  74. data/stdlib/date/date_time.rbs +582 -0
  75. data/stdlib/forwardable/forwardable.rbs +204 -0
  76. data/stdlib/pathname/pathname.rbs +2 -0
  77. data/stdlib/pty/pty.rbs +5 -29
  78. data/stdlib/set/set.rbs +1 -1
  79. data/stdlib/uri/file.rbs +167 -0
  80. data/stdlib/uri/generic.rbs +875 -0
  81. data/stdlib/uri/http.rbs +158 -0
  82. data/stdlib/uri/https.rbs +108 -0
  83. data/stdlib/uri/ldap.rbs +224 -0
  84. data/stdlib/uri/ldaps.rbs +108 -0
  85. data/stdlib/zlib/zlib.rbs +1 -1
  86. data/steep/Gemfile +3 -0
  87. data/steep/Gemfile.lock +51 -0
  88. metadata +45 -5
@@ -0,0 +1,108 @@
1
+ # URI is a module providing classes to handle Uniform Resource Identifiers
2
+ # ([RFC2396](http://tools.ietf.org/html/rfc2396)).
3
+ #
4
+ # ## Features
5
+ #
6
+ # * Uniform way of handling URIs.
7
+ # * Flexibility to introduce custom URI schemes.
8
+ # * Flexibility to have an alternate URI::Parser (or just different patterns
9
+ # and regexp's).
10
+ #
11
+ #
12
+ # ## Basic example
13
+ #
14
+ # require 'uri'
15
+ #
16
+ # uri = URI("http://foo.com/posts?id=30&limit=5#time=1305298413")
17
+ # #=> #<URI::HTTP http://foo.com/posts?id=30&limit=5#time=1305298413>
18
+ #
19
+ # uri.scheme #=> "http"
20
+ # uri.host #=> "foo.com"
21
+ # uri.path #=> "/posts"
22
+ # uri.query #=> "id=30&limit=5"
23
+ # uri.fragment #=> "time=1305298413"
24
+ #
25
+ # uri.to_s #=> "http://foo.com/posts?id=30&limit=5#time=1305298413"
26
+ #
27
+ # ## Adding custom URIs
28
+ #
29
+ # module URI
30
+ # class RSYNC < Generic
31
+ # DEFAULT_PORT = 873
32
+ # end
33
+ # @@schemes['RSYNC'] = RSYNC
34
+ # end
35
+ # #=> URI::RSYNC
36
+ #
37
+ # URI.scheme_list
38
+ # #=> {"FILE"=>URI::File, "FTP"=>URI::FTP, "HTTP"=>URI::HTTP,
39
+ # # "HTTPS"=>URI::HTTPS, "LDAP"=>URI::LDAP, "LDAPS"=>URI::LDAPS,
40
+ # # "MAILTO"=>URI::MailTo, "RSYNC"=>URI::RSYNC}
41
+ #
42
+ # uri = URI("rsync://rsync.foo.com")
43
+ # #=> #<URI::RSYNC rsync://rsync.foo.com>
44
+ #
45
+ # ## RFC References
46
+ #
47
+ # A good place to view an RFC spec is http://www.ietf.org/rfc.html.
48
+ #
49
+ # Here is a list of all related RFC's:
50
+ # * [RFC822](http://tools.ietf.org/html/rfc822)
51
+ # * [RFC1738](http://tools.ietf.org/html/rfc1738)
52
+ # * [RFC2255](http://tools.ietf.org/html/rfc2255)
53
+ # * [RFC2368](http://tools.ietf.org/html/rfc2368)
54
+ # * [RFC2373](http://tools.ietf.org/html/rfc2373)
55
+ # * [RFC2396](http://tools.ietf.org/html/rfc2396)
56
+ # * [RFC2732](http://tools.ietf.org/html/rfc2732)
57
+ # * [RFC3986](http://tools.ietf.org/html/rfc3986)
58
+ #
59
+ #
60
+ # ## Class tree
61
+ #
62
+ # * URI::Generic (in uri/generic.rb)
63
+ # * URI::File - (in uri/file.rb)
64
+ # * URI::FTP - (in uri/ftp.rb)
65
+ # * URI::HTTP - (in uri/http.rb)
66
+ # * URI::HTTPS - (in uri/https.rb)
67
+ #
68
+ # * URI::LDAP - (in uri/ldap.rb)
69
+ # * URI::LDAPS - (in uri/ldaps.rb)
70
+ #
71
+ # * URI::MailTo - (in uri/mailto.rb)
72
+ #
73
+ # * URI::Parser - (in uri/common.rb)
74
+ # * URI::REGEXP - (in uri/common.rb)
75
+ # * URI::REGEXP::PATTERN - (in uri/common.rb)
76
+ #
77
+ # * URI::Util - (in uri/common.rb)
78
+ # * URI::Escape - (in uri/common.rb)
79
+ # * URI::Error - (in uri/common.rb)
80
+ # * URI::InvalidURIError - (in uri/common.rb)
81
+ # * URI::InvalidComponentError - (in uri/common.rb)
82
+ # * URI::BadURIError - (in uri/common.rb)
83
+ #
84
+ #
85
+ #
86
+ # ## Copyright Info
87
+ #
88
+ # Author
89
+ # : Akira Yamada <akira@ruby-lang.org>
90
+ # Documentation
91
+ # : Akira Yamada <akira@ruby-lang.org> Dmitry V. Sabanin <sdmitry@lrn.ru>
92
+ # Vincent Batts <vbatts@hashbangbash.com>
93
+ # License
94
+ # : Copyright (c) 2001 akira yamada <akira@ruby-lang.org> You can redistribute
95
+ # it and/or modify it under the same term as Ruby.
96
+ # Revision
97
+ # : $Id$
98
+ #
99
+ #
100
+ module URI
101
+ # The default port for LDAPS URIs is 636, and the scheme is 'ldaps:' rather
102
+ # than 'ldap:'. Other than that, LDAPS URIs are identical to LDAP URIs;
103
+ # see URI::LDAP.
104
+ class LDAPS < LDAP
105
+ # A Default port of 636 for URI::LDAPS
106
+ DEFAULT_PORT: Integer
107
+ end
108
+ end
@@ -82,7 +82,7 @@ module Zlib
82
82
  # #=> Adler32 checksum: 2820145
83
83
  #
84
84
  def self.adler32: () -> Integer
85
- | (String) -> Integer
85
+ | (String) -> Integer
86
86
  | (String, Integer) -> Integer
87
87
 
88
88
  # Combine two Adler-32 check values in to one. `alder1` is the first Adler-32
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "steep"
@@ -0,0 +1,51 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ activesupport (6.0.3.3)
5
+ concurrent-ruby (~> 1.0, >= 1.0.2)
6
+ i18n (>= 0.7, < 2)
7
+ minitest (~> 5.1)
8
+ tzinfo (~> 1.1)
9
+ zeitwerk (~> 2.2, >= 2.2.2)
10
+ ast (2.4.1)
11
+ ast_utils (0.3.0)
12
+ parser (~> 2.4)
13
+ thor (>= 0.19)
14
+ concurrent-ruby (1.1.7)
15
+ ffi (1.13.1)
16
+ i18n (1.8.5)
17
+ concurrent-ruby (~> 1.0)
18
+ language_server-protocol (3.14.0.2)
19
+ listen (3.2.1)
20
+ rb-fsevent (~> 0.10, >= 0.10.3)
21
+ rb-inotify (~> 0.9, >= 0.9.10)
22
+ minitest (5.14.2)
23
+ parser (2.7.1.5)
24
+ ast (~> 2.4.1)
25
+ rainbow (3.0.0)
26
+ rb-fsevent (0.10.4)
27
+ rb-inotify (0.10.1)
28
+ ffi (~> 1.0)
29
+ rbs (0.12.2)
30
+ steep (0.28.0)
31
+ activesupport (>= 5.1)
32
+ ast_utils (~> 0.3.0)
33
+ language_server-protocol (~> 3.14.0.2)
34
+ listen (~> 3.1)
35
+ parser (~> 2.7.0)
36
+ rainbow (>= 2.2.2, < 4.0)
37
+ rbs (~> 0.12.0)
38
+ thor (1.0.1)
39
+ thread_safe (0.3.6)
40
+ tzinfo (1.2.7)
41
+ thread_safe (~> 0.1)
42
+ zeitwerk (2.4.0)
43
+
44
+ PLATFORMS
45
+ ruby
46
+
47
+ DEPENDENCIES
48
+ steep
49
+
50
+ BUNDLED WITH
51
+ 2.1.4
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-10 00:00:00.000000000 Z
11
+ date: 2020-10-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RBS is the language for type signatures for Ruby and standard library
14
14
  definitions.
@@ -28,6 +28,7 @@ files:
28
28
  - Gemfile
29
29
  - README.md
30
30
  - Rakefile
31
+ - Steepfile
31
32
  - bin/annotate-with-rdoc
32
33
  - bin/console
33
34
  - bin/query-rdoc
@@ -35,6 +36,7 @@ files:
35
36
  - bin/run_in_md.rb
36
37
  - bin/setup
37
38
  - bin/sort
39
+ - bin/steep
38
40
  - bin/test_runner.rb
39
41
  - docs/CONTRIBUTING.md
40
42
  - docs/sigs.md
@@ -95,9 +97,36 @@ files:
95
97
  - schema/members.json
96
98
  - schema/methodType.json
97
99
  - schema/types.json
100
+ - sig/annotation.rbs
101
+ - sig/buffer.rbs
102
+ - sig/builtin_names.rbs
103
+ - sig/comment.rbs
104
+ - sig/constant.rbs
105
+ - sig/constant_table.rbs
106
+ - sig/declarations.rbs
107
+ - sig/definition.rbs
108
+ - sig/definition_builder.rbs
109
+ - sig/environment.rbs
110
+ - sig/environment_loader.rbs
111
+ - sig/location.rbs
112
+ - sig/members.rbs
113
+ - sig/method_types.rbs
114
+ - sig/namespace.rbs
115
+ - sig/polyfill.rbs
116
+ - sig/rbs.rbs
117
+ - sig/substitution.rbs
118
+ - sig/type_name_resolver.rbs
119
+ - sig/typename.rbs
120
+ - sig/types.rbs
121
+ - sig/util.rbs
122
+ - sig/variance_calculator.rbs
123
+ - sig/version.rbs
124
+ - sig/writer.rbs
98
125
  - stdlib/abbrev/abbrev.rbs
99
126
  - stdlib/base64/base64.rbs
100
127
  - stdlib/benchmark/benchmark.rbs
128
+ - stdlib/bigdecimal/big_decimal.rbs
129
+ - stdlib/bigdecimal/math/big_math.rbs
101
130
  - stdlib/builtin/array.rbs
102
131
  - stdlib/builtin/basic_object.rbs
103
132
  - stdlib/builtin/binding.rbs
@@ -156,9 +185,12 @@ files:
156
185
  - stdlib/builtin/warning.rbs
157
186
  - stdlib/coverage/coverage.rbs
158
187
  - stdlib/csv/csv.rbs
188
+ - stdlib/date/date.rbs
189
+ - stdlib/date/date_time.rbs
159
190
  - stdlib/erb/erb.rbs
160
191
  - stdlib/fiber/fiber.rbs
161
192
  - stdlib/find/find.rbs
193
+ - stdlib/forwardable/forwardable.rbs
162
194
  - stdlib/ipaddr/ipaddr.rbs
163
195
  - stdlib/json/json.rbs
164
196
  - stdlib/logger/formatter.rbs
@@ -174,7 +206,15 @@ files:
174
206
  - stdlib/securerandom/securerandom.rbs
175
207
  - stdlib/set/set.rbs
176
208
  - stdlib/tmpdir/tmpdir.rbs
209
+ - stdlib/uri/file.rbs
210
+ - stdlib/uri/generic.rbs
211
+ - stdlib/uri/http.rbs
212
+ - stdlib/uri/https.rbs
213
+ - stdlib/uri/ldap.rbs
214
+ - stdlib/uri/ldaps.rbs
177
215
  - stdlib/zlib/zlib.rbs
216
+ - steep/Gemfile
217
+ - steep/Gemfile.lock
178
218
  homepage: https://github.com/ruby/rbs
179
219
  licenses:
180
220
  - BSD-2-Clause
@@ -183,7 +223,7 @@ metadata:
183
223
  homepage_uri: https://github.com/ruby/rbs
184
224
  source_code_uri: https://github.com/ruby/rbs.git
185
225
  changelog_uri: https://github.com/ruby/rbs/blob/master/CHANGELOG.md
186
- post_install_message:
226
+ post_install_message:
187
227
  rdoc_options: []
188
228
  require_paths:
189
229
  - lib
@@ -199,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
239
  version: '0'
200
240
  requirements: []
201
241
  rubygems_version: 3.1.2
202
- signing_key:
242
+ signing_key:
203
243
  specification_version: 4
204
244
  summary: Type signature for Ruby.
205
245
  test_files: []