rbs 3.0.0.dev.2 → 3.0.0.dev.3

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 (112) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +2 -1
  3. data/.github/workflows/ruby.yml +4 -0
  4. data/Gemfile.lock +11 -11
  5. data/Rakefile +2 -2
  6. data/Steepfile +1 -1
  7. data/core/array.rbs +573 -423
  8. data/core/basic_object.rbs +11 -39
  9. data/core/binding.rbs +1 -1
  10. data/core/builtin.rbs +8 -0
  11. data/core/class.rbs +37 -0
  12. data/core/comparable.rbs +7 -18
  13. data/core/complex.rbs +2 -2
  14. data/core/data.rbs +419 -0
  15. data/core/dir.rbs +52 -104
  16. data/core/encoding.rbs +22 -181
  17. data/core/enumerable.rbs +212 -175
  18. data/core/enumerator/product.rbs +96 -0
  19. data/core/enumerator.rbs +57 -8
  20. data/core/errors.rbs +8 -2
  21. data/core/exception.rbs +41 -0
  22. data/core/fiber.rbs +95 -12
  23. data/core/file.rbs +840 -275
  24. data/core/file_test.rbs +34 -19
  25. data/core/float.rbs +40 -96
  26. data/core/gc.rbs +15 -3
  27. data/core/hash.rbs +113 -175
  28. data/core/integer.rbs +85 -145
  29. data/core/io/buffer.rbs +187 -60
  30. data/core/io/wait.rbs +28 -16
  31. data/core/io.rbs +1859 -1389
  32. data/core/kernel.rbs +525 -961
  33. data/core/match_data.rbs +306 -142
  34. data/core/math.rbs +506 -234
  35. data/core/method.rbs +0 -24
  36. data/core/module.rbs +110 -17
  37. data/core/nil_class.rbs +2 -0
  38. data/core/numeric.rbs +76 -144
  39. data/core/object.rbs +88 -212
  40. data/core/proc.rbs +17 -5
  41. data/core/process.rbs +22 -5
  42. data/core/ractor.rbs +1 -1
  43. data/core/random.rbs +20 -3
  44. data/core/range.rbs +91 -89
  45. data/core/rational.rbs +2 -3
  46. data/core/rbs/unnamed/argf.rbs +177 -120
  47. data/core/rbs/unnamed/env_class.rbs +89 -163
  48. data/core/rbs/unnamed/random.rbs +36 -12
  49. data/core/refinement.rbs +8 -0
  50. data/core/regexp.rbs +462 -272
  51. data/core/ruby_vm.rbs +210 -0
  52. data/{stdlib/set/0 → core}/set.rbs +43 -47
  53. data/core/string.rbs +1403 -1332
  54. data/core/string_io.rbs +191 -107
  55. data/core/struct.rbs +67 -63
  56. data/core/symbol.rbs +187 -201
  57. data/core/thread.rbs +40 -35
  58. data/core/time.rbs +902 -826
  59. data/core/trace_point.rbs +55 -6
  60. data/core/unbound_method.rbs +48 -24
  61. data/docs/collection.md +4 -0
  62. data/docs/syntax.md +55 -0
  63. data/ext/rbs_extension/parser.c +5 -6
  64. data/lib/rbs/cli.rb +6 -1
  65. data/lib/rbs/collection/cleaner.rb +8 -1
  66. data/lib/rbs/collection/config/lockfile.rb +3 -1
  67. data/lib/rbs/collection/config/lockfile_generator.rb +16 -14
  68. data/lib/rbs/collection/config.rb +1 -1
  69. data/lib/rbs/collection/sources/git.rb +9 -2
  70. data/lib/rbs/collection/sources/local.rb +79 -0
  71. data/lib/rbs/collection/sources.rb +8 -1
  72. data/lib/rbs/environment.rb +6 -5
  73. data/lib/rbs/environment_loader.rb +3 -2
  74. data/lib/rbs/errors.rb +18 -0
  75. data/lib/rbs/locator.rb +26 -7
  76. data/lib/rbs/sorter.rb +2 -2
  77. data/lib/rbs/version.rb +1 -1
  78. data/sig/collection/sources.rbs +32 -3
  79. data/sig/environment.rbs +2 -3
  80. data/sig/locator.rbs +14 -2
  81. data/sig/shims/{abstract_syntax_tree.rbs → _abstract_syntax_tree.rbs} +0 -0
  82. data/stdlib/bigdecimal/0/big_decimal.rbs +16 -13
  83. data/stdlib/cgi/0/core.rbs +16 -0
  84. data/stdlib/coverage/0/coverage.rbs +50 -8
  85. data/stdlib/csv/0/csv.rbs +1 -1
  86. data/stdlib/date/0/date.rbs +856 -726
  87. data/stdlib/date/0/date_time.rbs +83 -210
  88. data/stdlib/erb/0/erb.rbs +13 -36
  89. data/stdlib/etc/0/etc.rbs +127 -20
  90. data/stdlib/fileutils/0/fileutils.rbs +1290 -381
  91. data/stdlib/logger/0/logger.rbs +466 -316
  92. data/stdlib/net-http/0/net-http.rbs +2211 -534
  93. data/stdlib/nkf/0/nkf.rbs +5 -5
  94. data/stdlib/objspace/0/objspace.rbs +31 -14
  95. data/stdlib/openssl/0/openssl.rbs +11 -7
  96. data/stdlib/optparse/0/optparse.rbs +20 -17
  97. data/stdlib/pathname/0/pathname.rbs +21 -4
  98. data/stdlib/pstore/0/pstore.rbs +378 -154
  99. data/stdlib/pty/0/pty.rbs +24 -8
  100. data/stdlib/ripper/0/ripper.rbs +1650 -0
  101. data/stdlib/socket/0/addrinfo.rbs +9 -15
  102. data/stdlib/socket/0/socket.rbs +36 -3
  103. data/stdlib/strscan/0/string_scanner.rbs +7 -5
  104. data/stdlib/tempfile/0/tempfile.rbs +104 -44
  105. data/stdlib/time/0/time.rbs +2 -2
  106. data/stdlib/uri/0/file.rbs +5 -0
  107. data/stdlib/uri/0/generic.rbs +2 -2
  108. data/stdlib/yaml/0/yaml.rbs +2 -2
  109. data/stdlib/zlib/0/zlib.rbs +1 -1
  110. metadata +8 -6
  111. data/core/deprecated.rbs +0 -9
  112. data/sig/shims/ripper.rbs +0 -8
data/stdlib/etc/0/etc.rbs CHANGED
@@ -1,10 +1,10 @@
1
1
  # <!-- rdoc-file=ext/etc/etc.c -->
2
2
  # The Etc module provides access to information typically stored in files in the
3
- # /etc directory on Unix systems.
3
+ # `/etc` directory on Unix systems.
4
4
  #
5
5
  # The information accessible consists of the information found in the
6
- # /etc/passwd and /etc/group files, plus information about the system's
7
- # temporary directory (/tmp) and configuration directory (/etc).
6
+ # `/etc/passwd` and `/etc/group` files, plus information about the system's
7
+ # temporary directory (`/tmp`) and configuration directory (`/etc`).
8
8
  #
9
9
  # The Etc module provides a more reliable way to access information about the
10
10
  # logged in user than environment variables such as +$USER+.
@@ -48,8 +48,8 @@ module Etc
48
48
  # rdoc-file=ext/etc/etc.c
49
49
  # - endgrent()
50
50
  # -->
51
- # Ends the process of scanning through the /etc/group file begun by ::getgrent,
52
- # and closes the file.
51
+ # Ends the process of scanning through the `/etc/group` file begun by
52
+ # ::getgrent, and closes the file.
53
53
  #
54
54
  def self?.endgrent: () -> void
55
55
 
@@ -57,7 +57,7 @@ module Etc
57
57
  # rdoc-file=ext/etc/etc.c
58
58
  # - endpwent()
59
59
  # -->
60
- # Ends the process of scanning through the /etc/passwd file begun with
60
+ # Ends the process of scanning through the `/etc/passwd` file begun with
61
61
  # ::getpwent, and closes the file.
62
62
  #
63
63
  def self?.endpwent: () -> void
@@ -66,7 +66,7 @@ module Etc
66
66
  # rdoc-file=ext/etc/etc.c
67
67
  # - getgrent()
68
68
  # -->
69
- # Returns an entry from the /etc/group file.
69
+ # Returns an entry from the `/etc/group` file.
70
70
  #
71
71
  # The first time it is called it opens the file and returns the first entry;
72
72
  # each successive call returns the next entry, or `nil` if the end of the file
@@ -83,7 +83,7 @@ module Etc
83
83
  # - getgrgid(group_id) -> Group
84
84
  # -->
85
85
  # Returns information about the group with specified integer `group_id`, as
86
- # found in /etc/group.
86
+ # found in `/etc/group`.
87
87
  #
88
88
  # The information is returned as a Group struct.
89
89
  #
@@ -101,7 +101,7 @@ module Etc
101
101
  # - getgrnam(name) -> Group
102
102
  # -->
103
103
  # Returns information about the group with specified `name`, as found in
104
- # /etc/group.
104
+ # `/etc/group`.
105
105
  #
106
106
  # The information is returned as a Group struct.
107
107
  #
@@ -136,7 +136,7 @@ module Etc
136
136
  # rdoc-file=ext/etc/etc.c
137
137
  # - getpwent()
138
138
  # -->
139
- # Returns an entry from the /etc/passwd file.
139
+ # Returns an entry from the `/etc/passwd` file.
140
140
  #
141
141
  # The first time it is called it opens the file and returns the first entry;
142
142
  # each successive call returns the next entry, or `nil` if the end of the file
@@ -152,7 +152,8 @@ module Etc
152
152
  # rdoc-file=ext/etc/etc.c
153
153
  # - getpwnam(name) -> Passwd
154
154
  # -->
155
- # Returns the /etc/passwd information for the user with specified login `name`.
155
+ # Returns the `/etc/passwd` information for the user with specified login
156
+ # `name`.
156
157
  #
157
158
  # The information is returned as a Passwd struct.
158
159
  #
@@ -169,7 +170,8 @@ module Etc
169
170
  # rdoc-file=ext/etc/etc.c
170
171
  # - getpwuid(uid) -> Passwd
171
172
  # -->
172
- # Returns the /etc/passwd information for the user with the given integer `uid`.
173
+ # Returns the `/etc/passwd` information for the user with the given integer
174
+ # `uid`.
173
175
  #
174
176
  # The information is returned as a Passwd struct.
175
177
  #
@@ -189,7 +191,7 @@ module Etc
189
191
  # - group()
190
192
  # -->
191
193
  # Provides a convenient Ruby iterator which executes a block for each entry in
192
- # the /etc/group file.
194
+ # the `/etc/group` file.
193
195
  #
194
196
  # The code block is passed an Group struct.
195
197
  #
@@ -242,7 +244,7 @@ module Etc
242
244
  # - Etc.passwd -> Passwd
243
245
  # -->
244
246
  # Provides a convenient Ruby iterator which executes a block for each entry in
245
- # the /etc/passwd file.
247
+ # the `/etc/passwd` file.
246
248
  #
247
249
  # The code block is passed an Passwd struct.
248
250
  #
@@ -263,7 +265,7 @@ module Etc
263
265
  # rdoc-file=ext/etc/etc.c
264
266
  # - setgrent()
265
267
  # -->
266
- # Resets the process of reading the /etc/group file, so that the next call to
268
+ # Resets the process of reading the `/etc/group` file, so that the next call to
267
269
  # ::getgrent will return the first entry again.
268
270
  #
269
271
  def self?.setgrent: () -> void
@@ -272,7 +274,7 @@ module Etc
272
274
  # rdoc-file=ext/etc/etc.c
273
275
  # - setpwent()
274
276
  # -->
275
- # Resets the process of reading the /etc/passwd file, so that the next call to
277
+ # Resets the process of reading the `/etc/passwd` file, so that the next call to
276
278
  # ::getpwent will return the first entry again.
277
279
  #
278
280
  def self?.setpwent: () -> void
@@ -299,10 +301,11 @@ module Etc
299
301
  # -->
300
302
  # Returns system configuration directory.
301
303
  #
302
- # This is typically "/etc", but is modified by the prefix used when Ruby was
303
- # compiled. For example, if Ruby is built and installed in /usr/local, returns
304
- # "/usr/local/etc" on other platforms than Windows. On Windows, this always
305
- # returns the directory provided by the system.
304
+ # This is typically `"/etc"`, but is modified by the prefix used when Ruby was
305
+ # compiled. For example, if Ruby is built and installed in `/usr/local`, returns
306
+ # `"/usr/local/etc"` on other platforms than Windows.
307
+ #
308
+ # On Windows, this always returns the directory provided by the system.
306
309
  #
307
310
  def self?.sysconfdir: () -> ::String
308
311
 
@@ -651,11 +654,51 @@ module Etc
651
654
 
652
655
  VERSION: String
653
656
 
657
+ # <!-- rdoc-file=ext/etc/etc.c -->
658
+ # Group is a placeholder Struct for user group database on Unix systems.
659
+ #
660
+ # ### The struct contains the following members
661
+ #
662
+ # name
663
+ # : contains the name of the group as a String.
664
+ # passwd
665
+ # : contains the encrypted password as a String. An `'x'` is returned if
666
+ # password access to the group is not available; an empty string is returned
667
+ # if no password is needed to obtain membership of the group. This is
668
+ # system-dependent.
669
+ # gid
670
+ # : contains the group's numeric ID as an integer.
671
+ # mem
672
+ # : is an Array of Strings containing the short login names of the members of
673
+ # the group.
674
+ #
654
675
  class Group < Struct[untyped]
655
676
  extend Enumerable[untyped]
656
677
 
657
678
  def self.[]: (*untyped) -> untyped
658
679
 
680
+ # <!--
681
+ # rdoc-file=ext/etc/etc.c
682
+ # - Etc::Group.each { |group| block } -> obj
683
+ # - Etc::Group.each -> Enumerator
684
+ # -->
685
+ # Iterates for each entry in the `/etc/group` file if a block is given.
686
+ #
687
+ # If no block is given, returns the Enumerator.
688
+ #
689
+ # The code block is passed a Group struct.
690
+ #
691
+ # Example:
692
+ #
693
+ # require 'etc'
694
+ #
695
+ # Etc::Group.each {|g|
696
+ # puts g.name + ": " + g.mem.join(', ')
697
+ # }
698
+ #
699
+ # Etc::Group.collect {|g| g.name}
700
+ # Etc::Group.select {|g| !g.mem.empty?}
701
+ #
659
702
  def self.each: () -> untyped
660
703
 
661
704
  def self.inspect: () -> untyped
@@ -685,11 +728,75 @@ module Etc
685
728
  def passwd=: (String new_passwd) -> void
686
729
  end
687
730
 
731
+ # <!-- rdoc-file=ext/etc/etc.c -->
732
+ # Passwd is a placeholder Struct for user database on Unix systems.
733
+ #
734
+ # ### The struct contains the following members
735
+ #
736
+ # name
737
+ # : contains the short login name of the user as a String.
738
+ # passwd
739
+ # : contains the encrypted password of the user as a String. an `'x'` is
740
+ # returned if shadow passwords are in use. An `'*'` is returned if the user
741
+ # cannot log in using a password.
742
+ # uid
743
+ # : contains the integer user ID (uid) of the user.
744
+ # gid
745
+ # : contains the integer group ID (gid) of the user's primary group.
746
+ # dir
747
+ # : contains the path to the home directory of the user as a String.
748
+ # shell
749
+ # : contains the path to the login shell of the user as a String.
750
+ #
751
+ #
752
+ # ### The following members below are system-dependent
753
+ #
754
+ # gecos
755
+ # : contains a longer String description of the user, such as a full name.
756
+ # Some Unix systems provide structured information in the gecos field, but
757
+ # this is system-dependent.
758
+ # change
759
+ # : password change time(integer).
760
+ # quota
761
+ # : quota value(integer).
762
+ # age
763
+ # : password age(integer).
764
+ # class
765
+ # : user access class(string).
766
+ # comment
767
+ # : comment(string).
768
+ # expire
769
+ # : account expiration time(integer).
770
+ #
688
771
  class Passwd < Struct[untyped]
689
772
  extend Enumerable[untyped]
690
773
 
691
774
  def self.[]: (*untyped) -> untyped
692
775
 
776
+ # <!--
777
+ # rdoc-file=ext/etc/etc.c
778
+ # - Etc::Passwd.each { |struct| block } -> Passwd
779
+ # - Etc::Passwd.each -> Enumerator
780
+ # -->
781
+ # Iterates for each entry in the `/etc/passwd` file if a block is given.
782
+ #
783
+ # If no block is given, returns the Enumerator.
784
+ #
785
+ # The code block is passed an Passwd struct.
786
+ #
787
+ # See Etc.getpwent above for details.
788
+ #
789
+ # Example:
790
+ #
791
+ # require 'etc'
792
+ #
793
+ # Etc::Passwd.each {|u|
794
+ # puts u.name + " = " + u.gecos
795
+ # }
796
+ #
797
+ # Etc::Passwd.collect {|u| u.gecos}
798
+ # Etc::Passwd.collect {|u| u.gecos}
799
+ #
693
800
  def self.each: () -> untyped
694
801
 
695
802
  def self.inspect: () -> untyped