rbs 2.7.0 → 2.8.0.pre.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/Gemfile.lock +18 -18
- data/Steepfile +2 -4
- data/core/io/buffer.rbs +15 -0
- data/core/io.rbs +6 -0
- data/docs/syntax.md +77 -32
- data/docs/tools.md +16 -0
- data/ext/rbs_extension/lexer.h +2 -0
- data/ext/rbs_extension/lexstate.c +9 -3
- data/ext/rbs_extension/parser.c +28 -11
- data/ext/rbs_extension/parserstate.c +7 -3
- data/ext/rbs_extension/parserstate.h +1 -1
- data/lib/rbs/cli.rb +4 -3
- data/lib/rbs/collection/config/lockfile_generator.rb +28 -2
- data/lib/rbs/collection/config.rb +21 -0
- data/lib/rbs/definition_builder/ancestor_builder.rb +6 -0
- data/lib/rbs/errors.rb +21 -1
- data/lib/rbs/parser_aux.rb +9 -6
- data/lib/rbs/version.rb +1 -1
- data/sig/collection/config.rbs +8 -0
- data/sig/errors.rbs +14 -0
- data/sig/manifest.yaml +0 -1
- data/sig/parser.rbs +41 -11
- data/stdlib/ipaddr/0/ipaddr.rbs +15 -0
- data/stdlib/socket/0/addrinfo.rbs +2 -1
- data/stdlib/socket/0/constants.rbs +2295 -0
- data/stdlib/socket/0/socket.rbs +899 -8
- data/stdlib/socket/0/socket_error.rbs +5 -0
- data/stdlib/yaml/0/dbm.rbs +1 -49
- data/stdlib/yaml/0/yaml.rbs +171 -0
- data/steep/Gemfile.lock +21 -9
- metadata +8 -4
data/stdlib/yaml/0/dbm.rbs
CHANGED
@@ -1,52 +1,4 @@
|
|
1
|
-
|
2
|
-
# YAML Ain't Markup Language
|
3
|
-
#
|
4
|
-
# This module provides a Ruby interface for data serialization in YAML format.
|
5
|
-
#
|
6
|
-
# The YAML module is an alias of Psych, the YAML engine for Ruby.
|
7
|
-
#
|
8
|
-
# ## Usage
|
9
|
-
#
|
10
|
-
# Working with YAML can be very simple, for example:
|
11
|
-
#
|
12
|
-
# require 'yaml'
|
13
|
-
# # Parse a YAML string
|
14
|
-
# YAML.load("--- foo") #=> "foo"
|
15
|
-
#
|
16
|
-
# # Emit some YAML
|
17
|
-
# YAML.dump("foo") # => "--- foo\n...\n"
|
18
|
-
# { :a => 'b'}.to_yaml # => "---\n:a: b\n"
|
19
|
-
#
|
20
|
-
# As the implementation is provided by the Psych library, detailed documentation
|
21
|
-
# can be found in that library's docs (also part of standard library).
|
22
|
-
#
|
23
|
-
# ## Security
|
24
|
-
#
|
25
|
-
# Do not use YAML to load untrusted data. Doing so is unsafe and could allow
|
26
|
-
# malicious input to execute arbitrary code inside your application. Please see
|
27
|
-
# doc/security.rdoc for more information.
|
28
|
-
#
|
29
|
-
# ## History
|
30
|
-
#
|
31
|
-
# Syck was the original YAML implementation in Ruby's standard library developed
|
32
|
-
# by why the lucky stiff.
|
33
|
-
#
|
34
|
-
# You can still use Syck, if you prefer, for parsing and emitting YAML, but you
|
35
|
-
# must install the 'syck' gem now in order to use it.
|
36
|
-
#
|
37
|
-
# In older Ruby versions, ie. <= 1.9, Syck is still provided, however it was
|
38
|
-
# completely removed with the release of Ruby 2.0.0.
|
39
|
-
#
|
40
|
-
# ## More info
|
41
|
-
#
|
42
|
-
# For more advanced details on the implementation see Psych, and also check out
|
43
|
-
# http://yaml.org for spec details and other helpful information.
|
44
|
-
#
|
45
|
-
# Psych is maintained by Aaron Patterson on github:
|
46
|
-
# https://github.com/ruby/psych
|
47
|
-
#
|
48
|
-
# Syck can also be found on github: https://github.com/ruby/syck
|
49
|
-
#
|
1
|
+
%a{annotate:rdoc:skip}
|
50
2
|
module YAML
|
51
3
|
# <!-- rdoc-file=lib/yaml/dbm.rb -->
|
52
4
|
# YAML + DBM = YDBM
|
@@ -0,0 +1,171 @@
|
|
1
|
+
# <!-- rdoc-file=lib/yaml.rb -->
|
2
|
+
# YAML Ain't Markup Language
|
3
|
+
#
|
4
|
+
# This module provides a Ruby interface for data serialization in YAML format.
|
5
|
+
#
|
6
|
+
# The YAML module is an alias of Psych, the YAML engine for Ruby.
|
7
|
+
#
|
8
|
+
# ## Usage
|
9
|
+
#
|
10
|
+
# Working with YAML can be very simple, for example:
|
11
|
+
#
|
12
|
+
# require 'yaml'
|
13
|
+
# # Parse a YAML string
|
14
|
+
# YAML.load("--- foo") #=> "foo"
|
15
|
+
#
|
16
|
+
# # Emit some YAML
|
17
|
+
# YAML.dump("foo") # => "--- foo\n...\n"
|
18
|
+
# { :a => 'b'}.to_yaml # => "---\n:a: b\n"
|
19
|
+
#
|
20
|
+
# As the implementation is provided by the Psych library, detailed documentation
|
21
|
+
# can be found in that library's docs (also part of standard library).
|
22
|
+
#
|
23
|
+
# ## Security
|
24
|
+
#
|
25
|
+
# Do not use YAML to load untrusted data. Doing so is unsafe and could allow
|
26
|
+
# malicious input to execute arbitrary code inside your application. Please see
|
27
|
+
# doc/security.rdoc for more information.
|
28
|
+
#
|
29
|
+
# ## History
|
30
|
+
#
|
31
|
+
# Syck was the original YAML implementation in Ruby's standard library developed
|
32
|
+
# by why the lucky stiff.
|
33
|
+
#
|
34
|
+
# You can still use Syck, if you prefer, for parsing and emitting YAML, but you
|
35
|
+
# must install the 'syck' gem now in order to use it.
|
36
|
+
#
|
37
|
+
# In older Ruby versions, ie. <= 1.9, Syck is still provided, however it was
|
38
|
+
# completely removed with the release of Ruby 2.0.0.
|
39
|
+
#
|
40
|
+
# ## More info
|
41
|
+
#
|
42
|
+
# For more advanced details on the implementation see Psych, and also check out
|
43
|
+
# http://yaml.org for spec details and other helpful information.
|
44
|
+
#
|
45
|
+
# Psych is maintained by Aaron Patterson on github:
|
46
|
+
# https://github.com/ruby/psych
|
47
|
+
#
|
48
|
+
# Syck can also be found on github: https://github.com/ruby/syck
|
49
|
+
#
|
50
|
+
module YAML
|
51
|
+
# <!--
|
52
|
+
# rdoc-file=ext/psych/lib/psych.rb
|
53
|
+
# - Psych.dump(o) -> string of yaml
|
54
|
+
# - Psych.dump(o, options) -> string of yaml
|
55
|
+
# - Psych.dump(o, io) -> io object passed in
|
56
|
+
# - Psych.dump(o, io, options) -> io object passed in
|
57
|
+
# -->
|
58
|
+
# Dump Ruby object `o` to a YAML string. Optional `options` may be passed in to
|
59
|
+
# control the output format. If an IO object is passed in, the YAML will be
|
60
|
+
# dumped to that IO object.
|
61
|
+
#
|
62
|
+
# Currently supported options are:
|
63
|
+
#
|
64
|
+
# `:indentation`
|
65
|
+
# : Number of space characters used to indent. Acceptable value should be in
|
66
|
+
# `0..9` range, otherwise option is ignored.
|
67
|
+
#
|
68
|
+
# Default: `2`.
|
69
|
+
# `:line_width`
|
70
|
+
# : Max character to wrap line at.
|
71
|
+
#
|
72
|
+
# Default: `0` (meaning "wrap at 81").
|
73
|
+
# `:canonical`
|
74
|
+
# : Write "canonical" YAML form (very verbose, yet strictly formal).
|
75
|
+
#
|
76
|
+
# Default: `false`.
|
77
|
+
# `:header`
|
78
|
+
# : Write `%YAML [version]` at the beginning of document.
|
79
|
+
#
|
80
|
+
# Default: `false`.
|
81
|
+
#
|
82
|
+
#
|
83
|
+
# Example:
|
84
|
+
#
|
85
|
+
# # Dump an array, get back a YAML string
|
86
|
+
# Psych.dump(['a', 'b']) # => "---\n- a\n- b\n"
|
87
|
+
#
|
88
|
+
# # Dump an array to an IO object
|
89
|
+
# Psych.dump(['a', 'b'], StringIO.new) # => #<StringIO:0x000001009d0890>
|
90
|
+
#
|
91
|
+
# # Dump an array with indentation set
|
92
|
+
# Psych.dump(['a', ['b']], indentation: 3) # => "---\n- a\n- - b\n"
|
93
|
+
#
|
94
|
+
# # Dump an array to an IO with indentation set
|
95
|
+
# Psych.dump(['a', ['b']], StringIO.new, indentation: 3)
|
96
|
+
#
|
97
|
+
%a{annotate:rdoc:copy:Psych.dump}
|
98
|
+
def self.dump: (untyped o, ?indentation: Integer, ?line_width: Integer, ?canonical: bool, ?header: bool) -> String
|
99
|
+
| [IO] (untyped o, IO, ?indentation: Integer, ?line_width: Integer, ?canonical: bool, ?header: bool) -> IO
|
100
|
+
|
101
|
+
# <!--
|
102
|
+
# rdoc-file=ext/psych/lib/psych.rb
|
103
|
+
# - load(yaml, filename: nil, fallback: false, symbolize_names: false, freeze: false)
|
104
|
+
# -->
|
105
|
+
#
|
106
|
+
%a{annotate:rdoc:copy:Psych.load}
|
107
|
+
def self.load: (String yaml, ?filename: String | _ToStr | _ToS?, ?fallback: untyped, ?symbolize_names: bool, ?freeze: bool) -> untyped
|
108
|
+
|
109
|
+
# <!--
|
110
|
+
# rdoc-file=ext/psych/lib/psych.rb
|
111
|
+
# - load_file(filename, **kwargs)
|
112
|
+
# -->
|
113
|
+
# Loads the document contained in `filename`. Returns the yaml contained in
|
114
|
+
# `filename` as a Ruby object, or if the file is empty, it returns the specified
|
115
|
+
# `fallback` return value, which defaults to `false`. See load for options.
|
116
|
+
#
|
117
|
+
%a{annotate:rdoc:copy:Psych.load_file}
|
118
|
+
def self.load_file: (string, ?fallback: untyped, ?symbolize_names: bool, ?freeze: bool) -> untyped
|
119
|
+
|
120
|
+
# <!--
|
121
|
+
# rdoc-file=ext/psych/lib/psych.rb
|
122
|
+
# - safe_load(yaml, permitted_classes: [], permitted_symbols: [], aliases: false, filename: nil, fallback: nil, symbolize_names: false, freeze: false)
|
123
|
+
# -->
|
124
|
+
# Safely load the yaml string in `yaml`. By default, only the following classes
|
125
|
+
# are allowed to be deserialized:
|
126
|
+
#
|
127
|
+
# * TrueClass
|
128
|
+
# * FalseClass
|
129
|
+
# * NilClass
|
130
|
+
# * Integer
|
131
|
+
# * Float
|
132
|
+
# * String
|
133
|
+
# * Array
|
134
|
+
# * Hash
|
135
|
+
#
|
136
|
+
#
|
137
|
+
# Recursive data structures are not allowed by default. Arbitrary classes can
|
138
|
+
# be allowed by adding those classes to the `permitted_classes` keyword
|
139
|
+
# argument. They are additive. For example, to allow Date deserialization:
|
140
|
+
#
|
141
|
+
# Psych.safe_load(yaml, permitted_classes: [Date])
|
142
|
+
#
|
143
|
+
# Now the Date class can be loaded in addition to the classes listed above.
|
144
|
+
#
|
145
|
+
# Aliases can be explicitly allowed by changing the `aliases` keyword argument.
|
146
|
+
# For example:
|
147
|
+
#
|
148
|
+
# x = []
|
149
|
+
# x << x
|
150
|
+
# yaml = Psych.dump x
|
151
|
+
# Psych.safe_load yaml # => raises an exception
|
152
|
+
# Psych.safe_load yaml, aliases: true # => loads the aliases
|
153
|
+
#
|
154
|
+
# A Psych::DisallowedClass exception will be raised if the yaml contains a class
|
155
|
+
# that isn't in the `permitted_classes` list.
|
156
|
+
#
|
157
|
+
# A Psych::BadAlias exception will be raised if the yaml contains aliases but
|
158
|
+
# the `aliases` keyword argument is set to false.
|
159
|
+
#
|
160
|
+
# `filename` will be used in the exception message if any exception is raised
|
161
|
+
# while parsing.
|
162
|
+
#
|
163
|
+
# When the optional `symbolize_names` keyword argument is set to a true value,
|
164
|
+
# returns symbols for keys in Hash objects (default: strings).
|
165
|
+
#
|
166
|
+
# Psych.safe_load("---\n foo: bar") # => {"foo"=>"bar"}
|
167
|
+
# Psych.safe_load("---\n foo: bar", symbolize_names: true) # => {:foo=>"bar"}
|
168
|
+
#
|
169
|
+
%a{annotate:rdoc:copy:Psych.safe_load}
|
170
|
+
def self.safe_load: (String yaml, ?permitted_classes: Array[Class], ?permitted_symbols: Array[Symbol], ?aliases: bool, ?filename: String | _ToStr | _ToS?, ?fallback: untyped, ?symbolize_names: bool, ?freeze: bool) -> untyped
|
171
|
+
end
|
data/steep/Gemfile.lock
CHANGED
@@ -1,43 +1,55 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (7.0.
|
4
|
+
activesupport (7.0.4)
|
5
5
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
6
6
|
i18n (>= 1.6, < 2)
|
7
7
|
minitest (>= 5.1)
|
8
8
|
tzinfo (~> 2.0)
|
9
9
|
ast (2.4.2)
|
10
10
|
concurrent-ruby (1.1.10)
|
11
|
+
csv (3.2.5)
|
11
12
|
ffi (1.15.5)
|
13
|
+
fileutils (1.6.0)
|
12
14
|
i18n (1.12.0)
|
13
15
|
concurrent-ruby (~> 1.0)
|
14
|
-
|
16
|
+
json (2.6.2)
|
17
|
+
language_server-protocol (3.17.0.1)
|
15
18
|
listen (3.7.1)
|
16
19
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
17
20
|
rb-inotify (~> 0.9, >= 0.9.10)
|
18
|
-
|
21
|
+
logger (1.5.1)
|
22
|
+
minitest (5.16.3)
|
19
23
|
parallel (1.22.1)
|
20
|
-
parser (3.1.2.
|
24
|
+
parser (3.1.2.1)
|
21
25
|
ast (~> 2.4.1)
|
22
26
|
rainbow (3.1.1)
|
23
|
-
rb-fsevent (0.11.
|
27
|
+
rb-fsevent (0.11.2)
|
24
28
|
rb-inotify (0.10.1)
|
25
29
|
ffi (~> 1.0)
|
26
|
-
rbs (2.
|
27
|
-
|
30
|
+
rbs (2.7.0)
|
31
|
+
securerandom (0.2.0)
|
32
|
+
steep (1.2.1)
|
28
33
|
activesupport (>= 5.1)
|
34
|
+
csv (>= 3.0.9)
|
35
|
+
fileutils (>= 1.1.0)
|
36
|
+
json (>= 2.1.0)
|
29
37
|
language_server-protocol (>= 3.15, < 4.0)
|
30
38
|
listen (~> 3.0)
|
39
|
+
logger (>= 1.3.0)
|
31
40
|
parallel (>= 1.0.0)
|
32
41
|
parser (>= 3.1)
|
33
42
|
rainbow (>= 2.2.2, < 4.0)
|
34
|
-
rbs (>= 2.
|
43
|
+
rbs (>= 2.7.0)
|
44
|
+
securerandom (>= 0.1)
|
45
|
+
strscan (>= 1.0.0)
|
35
46
|
terminal-table (>= 2, < 4)
|
47
|
+
strscan (3.0.4)
|
36
48
|
terminal-table (3.0.2)
|
37
49
|
unicode-display_width (>= 1.1.1, < 3)
|
38
50
|
tzinfo (2.0.5)
|
39
51
|
concurrent-ruby (~> 1.0)
|
40
|
-
unicode-display_width (2.
|
52
|
+
unicode-display_width (2.3.0)
|
41
53
|
|
42
54
|
PLATFORMS
|
43
55
|
ruby
|
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: 2.
|
4
|
+
version: 2.8.0.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-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.
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- docs/sigs.md
|
121
121
|
- docs/stdlib.md
|
122
122
|
- docs/syntax.md
|
123
|
+
- docs/tools.md
|
123
124
|
- exe/rbs
|
124
125
|
- ext/rbs_extension/constants.c
|
125
126
|
- ext/rbs_extension/constants.h
|
@@ -380,8 +381,10 @@ files:
|
|
380
381
|
- stdlib/singleton/0/singleton.rbs
|
381
382
|
- stdlib/socket/0/addrinfo.rbs
|
382
383
|
- stdlib/socket/0/basic_socket.rbs
|
384
|
+
- stdlib/socket/0/constants.rbs
|
383
385
|
- stdlib/socket/0/ip_socket.rbs
|
384
386
|
- stdlib/socket/0/socket.rbs
|
387
|
+
- stdlib/socket/0/socket_error.rbs
|
385
388
|
- stdlib/socket/0/tcp_server.rbs
|
386
389
|
- stdlib/socket/0/tcp_socket.rbs
|
387
390
|
- stdlib/socket/0/udp_socket.rbs
|
@@ -411,6 +414,7 @@ files:
|
|
411
414
|
- stdlib/yaml/0/dbm.rbs
|
412
415
|
- stdlib/yaml/0/manifest.yaml
|
413
416
|
- stdlib/yaml/0/store.rbs
|
417
|
+
- stdlib/yaml/0/yaml.rbs
|
414
418
|
- stdlib/zlib/0/zlib.rbs
|
415
419
|
- steep/Gemfile
|
416
420
|
- steep/Gemfile.lock
|
@@ -433,9 +437,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
433
437
|
version: '2.6'
|
434
438
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
435
439
|
requirements:
|
436
|
-
- - "
|
440
|
+
- - ">"
|
437
441
|
- !ruby/object:Gem::Version
|
438
|
-
version:
|
442
|
+
version: 1.3.1
|
439
443
|
requirements: []
|
440
444
|
rubygems_version: 3.3.7
|
441
445
|
signing_key:
|