rbs 0.12.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +10 -10
  3. data/.gitignore +0 -1
  4. data/CHANGELOG.md +24 -0
  5. data/Gemfile +3 -0
  6. data/README.md +8 -2
  7. data/Rakefile +9 -4
  8. data/Steepfile +1 -0
  9. data/bin/annotate-with-rdoc +1 -1
  10. data/bin/setup +0 -2
  11. data/bin/test_runner.rb +3 -6
  12. data/docs/CONTRIBUTING.md +1 -0
  13. data/goodcheck.yml +22 -5
  14. data/lib/rbs/ast/comment.rb +1 -1
  15. data/lib/rbs/cli.rb +12 -4
  16. data/lib/rbs/constant.rb +1 -1
  17. data/lib/rbs/constant_table.rb +9 -8
  18. data/lib/rbs/definition_builder.rb +4 -5
  19. data/lib/rbs/environment.rb +5 -1
  20. data/lib/rbs/environment_loader.rb +12 -12
  21. data/lib/rbs/namespace.rb +1 -1
  22. data/lib/rbs/parser.rb +3146 -0
  23. data/lib/rbs/parser.y +7 -2
  24. data/lib/rbs/test/setup_helper.rb +4 -4
  25. data/lib/rbs/test/type_check.rb +2 -2
  26. data/lib/rbs/type_name.rb +1 -1
  27. data/lib/rbs/variance_calculator.rb +2 -2
  28. data/lib/rbs/version.rb +1 -1
  29. data/lib/rbs/writer.rb +25 -15
  30. data/sig/constant.rbs +21 -0
  31. data/sig/constant_table.rbs +30 -0
  32. data/sig/declarations.rbs +1 -1
  33. data/sig/definition.rbs +1 -1
  34. data/sig/definition_builder.rbs +4 -5
  35. data/sig/environment_loader.rbs +54 -0
  36. data/sig/namespace.rbs +3 -3
  37. data/sig/parser.rbs +25 -0
  38. data/sig/substitution.rbs +3 -3
  39. data/sig/typename.rbs +1 -1
  40. data/sig/types.rbs +1 -1
  41. data/sig/version.rbs +3 -0
  42. data/sig/writer.rbs +40 -0
  43. data/stdlib/benchmark/benchmark.rbs +2 -2
  44. data/stdlib/builtin/basic_object.rbs +54 -54
  45. data/stdlib/builtin/binding.rbs +42 -42
  46. data/stdlib/builtin/class.rbs +33 -33
  47. data/stdlib/builtin/complex.rbs +90 -90
  48. data/stdlib/builtin/encoding.rbs +33 -33
  49. data/stdlib/builtin/enumerable.rbs +32 -32
  50. data/stdlib/builtin/enumerator.rbs +35 -35
  51. data/stdlib/builtin/errors.rbs +1 -1
  52. data/stdlib/builtin/exception.rbs +50 -50
  53. data/stdlib/builtin/false_class.rbs +6 -6
  54. data/stdlib/builtin/fiber.rbs +14 -14
  55. data/stdlib/builtin/fiber_error.rbs +1 -1
  56. data/stdlib/builtin/float.rbs +161 -161
  57. data/stdlib/builtin/gc.rbs +1 -1
  58. data/stdlib/builtin/io.rbs +83 -83
  59. data/stdlib/builtin/kernel.rbs +70 -68
  60. data/stdlib/builtin/match_data.rbs +1 -1
  61. data/stdlib/builtin/method.rbs +19 -19
  62. data/stdlib/builtin/nil_class.rbs +20 -20
  63. data/stdlib/builtin/numeric.rbs +101 -101
  64. data/stdlib/builtin/object.rbs +172 -172
  65. data/stdlib/builtin/proc.rbs +91 -91
  66. data/stdlib/builtin/range.rbs +2 -4
  67. data/stdlib/builtin/rational.rbs +83 -83
  68. data/stdlib/builtin/signal.rbs +7 -7
  69. data/stdlib/builtin/string.rbs +4 -4
  70. data/stdlib/builtin/string_io.rbs +1 -1
  71. data/stdlib/builtin/thread.rbs +185 -185
  72. data/stdlib/builtin/thread_group.rbs +2 -2
  73. data/stdlib/builtin/true_class.rbs +9 -9
  74. data/stdlib/builtin/warning.rbs +1 -1
  75. data/stdlib/date/date.rbs +2 -2
  76. data/stdlib/find/find.rbs +10 -10
  77. data/stdlib/pathname/pathname.rbs +2 -0
  78. data/stdlib/pty/pty.rbs +5 -29
  79. data/stdlib/tmpdir/tmpdir.rbs +12 -12
  80. data/stdlib/uri/generic.rbs +1 -1
  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/steep/Gemfile.lock +13 -17
  86. metadata +12 -3
@@ -0,0 +1,224 @@
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
+ #
102
+ # LDAP URI SCHEMA (described in RFC2255).
103
+ # -
104
+ # ldap://<host>/<dn>[?<attrs>[?<scope>[?<filter>[?<extensions>]]]]
105
+ # +
106
+ class LDAP < Generic
107
+ # A Default port of 389 for URI::LDAP.
108
+ DEFAULT_PORT: Integer
109
+
110
+ # An Array of the available components for URI::LDAP.
111
+ COMPONENT: Array[Symbol]
112
+
113
+ # Scopes available for the starting point.
114
+ #
115
+ # * SCOPE_BASE - the Base DN
116
+ # * SCOPE_ONE - one level under the Base DN, not including the base DN and
117
+ # not including any entries under this
118
+ # * SCOPE_SUB - subtrees, all entries at all levels
119
+ #
120
+ SCOPE: Array[String]
121
+
122
+ #
123
+ # == Description
124
+ #
125
+ # Creates a new URI::LDAP object from components, with syntax checking.
126
+ #
127
+ # The components accepted are host, port, dn, attributes,
128
+ # scope, filter, and extensions.
129
+ #
130
+ # The components should be provided either as an Array, or as a Hash
131
+ # with keys formed by preceding the component names with a colon.
132
+ #
133
+ # If an Array is used, the components must be passed in the
134
+ # order <code>[host, port, dn, attributes, scope, filter, extensions]</code>.
135
+ #
136
+ # Example:
137
+ #
138
+ # uri = URI::LDAP.build({:host => 'ldap.example.com',
139
+ # :dn => '/dc=example'})
140
+ #
141
+ # uri = URI::LDAP.build(["ldap.example.com", nil,
142
+ # "/dc=example;dc=com", "query", nil, nil, nil])
143
+ #
144
+ def self.build: (Array[nil | String | Integer] args) -> URI::LDAP
145
+ | ({ host: String, port: Integer?, dn: String, attributes: String?, scope: String?, filter: String?, extensions: String? }) -> URI::LDAP
146
+
147
+ #
148
+ # == Description
149
+ #
150
+ # Creates a new URI::LDAP object from generic URI components as per
151
+ # RFC 2396. No LDAP-specific syntax checking is performed.
152
+ #
153
+ # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
154
+ # +opaque+, +query+, and +fragment+, in that order.
155
+ #
156
+ # Example:
157
+ #
158
+ # uri = URI::LDAP.new("ldap", nil, "ldap.example.com", nil, nil,
159
+ # "/dc=example;dc=com", nil, "query", nil)
160
+ #
161
+ # See also URI::Generic.new.
162
+ #
163
+ def initialize: (String schema, String? userinfo, String host, Integer? port, String? registry, String? path, String? opaque, String query, String? fragment) -> URI::LDAP
164
+
165
+ # Private method to cleanup +dn+ from using the +path+ component attribute.
166
+ def parse_dn: () -> nil
167
+
168
+ # Private method to cleanup +attributes+, +scope+, +filter+, and +extensions+
169
+ # from using the +query+ component attribute.
170
+ def parse_query: () -> nil
171
+
172
+ # Private method to assemble +query+ from +attributes+, +scope+, +filter+, and +extensions+.
173
+ def build_path_query: () -> String
174
+
175
+ # Returns dn.
176
+ def dn: () -> String
177
+
178
+ # Private setter for dn +val+.
179
+ def set_dn: (String val) -> String
180
+
181
+ # Setter for dn +val+.
182
+ def dn=: (String val) -> String
183
+
184
+ # Returns attributes.
185
+ def attributes: () -> String
186
+
187
+ # Private setter for attributes +val+.
188
+ def set_attributes: (String val) -> String
189
+
190
+ # Setter for attributes +val+.
191
+ def attributes=: (String val) -> String
192
+
193
+ # Returns scope.
194
+ def scope: () -> String
195
+
196
+ # Private setter for scope +val+.
197
+ def set_scope: (String val) -> String
198
+
199
+ # Setter for scope +val+.
200
+ def scope=: (String val) -> String
201
+
202
+ # Returns filter.
203
+ def filter: () -> String
204
+
205
+ # Private setter for filter +val+.
206
+ def set_filter: (String val) -> String
207
+
208
+ # Setter for filter +val+.
209
+ def filter=: (String val) -> String
210
+
211
+ # Returns extensions.
212
+ def extensions: () -> untyped
213
+
214
+ # Private setter for extensions +val+.
215
+ def set_extensions: (String val) -> String
216
+
217
+ # Setter for extensions +val+.
218
+ def extensions=: (String val) -> String
219
+
220
+ # Checks if URI has a path.
221
+ # For URI::LDAP this will return +false+.
222
+ def hierarchical?: () -> ::FalseClass
223
+ end
224
+ end
@@ -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
@@ -1,19 +1,7 @@
1
- PATH
2
- remote: ../../steep
3
- specs:
4
- steep (0.27.0)
5
- activesupport (>= 5.1)
6
- ast_utils (~> 0.3.0)
7
- language_server-protocol (~> 3.14.0.2)
8
- listen (~> 3.1)
9
- parser (~> 2.7.0)
10
- rainbow (>= 2.2.2, < 4.0)
11
- rbs (~> 0.11.0)
12
-
13
1
  GEM
14
2
  remote: https://rubygems.org/
15
3
  specs:
16
- activesupport (6.0.3.2)
4
+ activesupport (6.0.3.3)
17
5
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
6
  i18n (>= 0.7, < 2)
19
7
  minitest (~> 5.1)
@@ -32,13 +20,21 @@ GEM
32
20
  rb-fsevent (~> 0.10, >= 0.10.3)
33
21
  rb-inotify (~> 0.9, >= 0.9.10)
34
22
  minitest (5.14.2)
35
- parser (2.7.1.4)
23
+ parser (2.7.1.5)
36
24
  ast (~> 2.4.1)
37
25
  rainbow (3.0.0)
38
26
  rb-fsevent (0.10.4)
39
27
  rb-inotify (0.10.1)
40
28
  ffi (~> 1.0)
41
- rbs (0.11.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)
42
38
  thor (1.0.1)
43
39
  thread_safe (0.3.6)
44
40
  tzinfo (1.2.7)
@@ -49,7 +45,7 @@ PLATFORMS
49
45
  ruby
50
46
 
51
47
  DEPENDENCIES
52
- steep!
48
+ steep
53
49
 
54
50
  BUNDLED WITH
55
- 2.1.3
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.12.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-15 00:00:00.000000000 Z
11
+ date: 2020-10-17 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.
@@ -101,6 +101,8 @@ files:
101
101
  - sig/buffer.rbs
102
102
  - sig/builtin_names.rbs
103
103
  - sig/comment.rbs
104
+ - sig/constant.rbs
105
+ - sig/constant_table.rbs
104
106
  - sig/declarations.rbs
105
107
  - sig/definition.rbs
106
108
  - sig/definition_builder.rbs
@@ -110,6 +112,7 @@ files:
110
112
  - sig/members.rbs
111
113
  - sig/method_types.rbs
112
114
  - sig/namespace.rbs
115
+ - sig/parser.rbs
113
116
  - sig/polyfill.rbs
114
117
  - sig/rbs.rbs
115
118
  - sig/substitution.rbs
@@ -118,6 +121,8 @@ files:
118
121
  - sig/types.rbs
119
122
  - sig/util.rbs
120
123
  - sig/variance_calculator.rbs
124
+ - sig/version.rbs
125
+ - sig/writer.rbs
121
126
  - stdlib/abbrev/abbrev.rbs
122
127
  - stdlib/base64/base64.rbs
123
128
  - stdlib/benchmark/benchmark.rbs
@@ -204,6 +209,10 @@ files:
204
209
  - stdlib/tmpdir/tmpdir.rbs
205
210
  - stdlib/uri/file.rbs
206
211
  - stdlib/uri/generic.rbs
212
+ - stdlib/uri/http.rbs
213
+ - stdlib/uri/https.rbs
214
+ - stdlib/uri/ldap.rbs
215
+ - stdlib/uri/ldaps.rbs
207
216
  - stdlib/zlib/zlib.rbs
208
217
  - steep/Gemfile
209
218
  - steep/Gemfile.lock
@@ -230,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
239
  - !ruby/object:Gem::Version
231
240
  version: '0'
232
241
  requirements: []
233
- rubygems_version: 3.0.8
242
+ rubygems_version: 3.1.2
234
243
  signing_key:
235
244
  specification_version: 4
236
245
  summary: Type signature for Ruby.