rbs 2.8.0 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26f1a45c1e5dbf02bc102b1fc68c925979facec75a9971e9b405481087fc9ad9
4
- data.tar.gz: b6e8bee27043e2bc710a894fe9518266dac265a8d0afc685193ca157dc5e8cac
3
+ metadata.gz: 7260861dc5546d0f4673c4cbff61a97b222553fbedb0f0cf7b45fffa7e70fc29
4
+ data.tar.gz: 3a354b926470d26670ac209c3190f0a934289126b4ed484180eebf81d9c9a076
5
5
  SHA512:
6
- metadata.gz: 918413c661460215dc7de7404e6b9a6f117a56493e91b2c1f059524352c9fe84c6deff43c43987816eaca958224eb57c3206f463dd3fe09b7e402f2a5daed92d
7
- data.tar.gz: b743905981aa9b998c41b84a6dc9ae81b5d2456a89218c2840a490260552dc1919a7c2cc46d4293b49df120ccada9b220ffd06b25ebfe47f941a0632b4cc63fc
6
+ metadata.gz: '07842180f916e2726333424a6263e05f8cfff54a1165c144fd6dab1137ab26a129ca0a5d22531483868a2cf1b3008bc8e617893f98de4d9433bb0b482fc910ce'
7
+ data.tar.gz: 861ac0661a1784d29c2bff49683d4d679d84bf788f20bf899a5c6596d341437a38dc1eb8072f027c44f199f17b0e056203db097056306c6363ac5076072045a8
@@ -31,4 +31,5 @@ jobs:
31
31
  bin/setup
32
32
  - name: Check if `rake annotate` has been executed
33
33
  run: |
34
+ git config --global --add safe.directory `pwd`
34
35
  bundle exec rake annotate confirm_annotation
data/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 2.8.1 (2022-11-28)
6
+
7
+ ### Signature updates
8
+
9
+ * Update documents based on ruby-3.1.3 ([#1160](https://github.com/ruby/rbs/pull/1160))
10
+
11
+ ### Library changes
12
+
13
+ #### rbs collection
14
+
15
+ * Delay loading `Gemfile` for unbundled environments ([#1161](https://github.com/ruby/rbs/pull/1161))
16
+
17
+ ### Miscellaneous
18
+
19
+ * Fix collection tests ([#1159](https://github.com/ruby/rbs/pull/1159), [#1162](https://github.com/ruby/rbs/pull/1162))
20
+
5
21
  ## 2.8.0 (2022-11-24)
6
22
 
7
23
  ### Signature updates
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs (2.8.0)
4
+ rbs (2.8.1)
5
5
 
6
6
  PATH
7
7
  remote: test/assets/test-gem
@@ -62,7 +62,7 @@ GEM
62
62
  diff-lcs (>= 1.2.0, < 2.0)
63
63
  rspec-support (~> 3.12.0)
64
64
  rspec-support (3.12.0)
65
- rubocop (1.38.0)
65
+ rubocop (1.39.0)
66
66
  json (~> 2.3)
67
67
  parallel (~> 1.10)
68
68
  parser (>= 3.1.2.1)
data/core/io/buffer.rbs CHANGED
@@ -88,11 +88,13 @@ class IO
88
88
 
89
89
  # <!--
90
90
  # rdoc-file=io_buffer.c
91
- # - IO::Buffer.for(string) -> io_buffer
91
+ # - IO::Buffer.for(string) -> readonly io_buffer
92
+ # - IO::Buffer.for(string) {|io_buffer| ... read/write io_buffer ...}
92
93
  # -->
93
- # Creates a IO::Buffer from the given string's memory. The buffer remains
94
- # associated with the string, and writing to a buffer will update the string's
95
- # contents.
94
+ # Creates a IO::Buffer from the given string's memory. Without a block a frozen
95
+ # internal copy of the string is created efficiently and used as the buffer
96
+ # source. When a block is provided, the buffer is associated directly with the
97
+ # string's internal data and updating the buffer will update the string.
96
98
  #
97
99
  # Until #free is invoked on the buffer, either explicitly or via the garbage
98
100
  # collector, the source string will be locked and cannot be modified.
@@ -101,7 +103,7 @@ class IO
101
103
  # modified.
102
104
  #
103
105
  # string = 'test'
104
- # buffer = IO::Buffer.for(str)
106
+ # buffer = IO::Buffer.for(string)
105
107
  # buffer.external? #=> true
106
108
  #
107
109
  # buffer.get_string(0, 1)
@@ -112,6 +114,12 @@ class IO
112
114
  # buffer.resize(100)
113
115
  # # in `resize': Cannot resize external buffer! (IO::Buffer::AccessError)
114
116
  #
117
+ # IO::Buffer.for(string) do |buffer|
118
+ # buffer.set_string("T")
119
+ # string
120
+ # # => "Test"
121
+ # end
122
+ #
115
123
  def self.for: (String) -> Buffer
116
124
 
117
125
  # <!--
data/core/method.rbs CHANGED
@@ -220,7 +220,15 @@ class Method < Object
220
220
  # rdoc-file=proc.c
221
221
  # - meth.owner -> class_or_module
222
222
  # -->
223
- # Returns the class or module that defines the method. See also Method#receiver.
223
+ # Returns the class or module on which this method is defined. In other words,
224
+ #
225
+ # meth.owner.instance_methods(false).include?(meth.name) # => true
226
+ #
227
+ # holds as long as the method is not removed/undefined/replaced, (with
228
+ # private_instance_methods instead of instance_methods if the method is
229
+ # private).
230
+ #
231
+ # See also Method#receiver.
224
232
  #
225
233
  # (1..3).method(:map).owner #=> Enumerable
226
234
  #
@@ -768,15 +768,15 @@ module RBS
768
768
 
769
769
  # <!--
770
770
  # rdoc-file=io.c
771
- # - ARGF.readlines(sep=$/) -> array
771
+ # - ARGF.readlines(sep = $/) -> array
772
772
  # - ARGF.readlines(limit) -> array
773
773
  # - ARGF.readlines(sep, limit) -> array
774
- # - ARGF.to_a(sep=$/) -> array
774
+ # - ARGF.to_a(sep = $/) -> array
775
775
  # - ARGF.to_a(limit) -> array
776
776
  # - ARGF.to_a(sep, limit) -> array
777
777
  # -->
778
- # Reads `ARGF`'s current file in its entirety, returning an `Array` of its
779
- # lines, one line per element. Lines are assumed to be separated by *sep*.
778
+ # Reads each file in `ARGF` in its entirety, returning an `Array` containing
779
+ # lines from the files. Lines are assumed to be separated by *sep*.
780
780
  #
781
781
  # lines = ARGF.readlines
782
782
  # lines[0] #=> "This is line one\n"
@@ -893,8 +893,8 @@ module RBS
893
893
  def tell: () -> Integer
894
894
 
895
895
  # <!-- rdoc-file=io.c -->
896
- # Reads `ARGF`'s current file in its entirety, returning an `Array` of its
897
- # lines, one line per element. Lines are assumed to be separated by *sep*.
896
+ # Reads each file in `ARGF` in its entirety, returning an `Array` containing
897
+ # lines from the files. Lines are assumed to be separated by *sep*.
898
898
  #
899
899
  # lines = ARGF.readlines
900
900
  # lines[0] #=> "This is line one\n"
@@ -155,8 +155,8 @@ module Gem
155
155
  # rdoc-file=lib/rubygems.rb
156
156
  # - activated_gem_paths()
157
157
  # -->
158
- # The number of paths in the `$LOAD_PATH` from activated gems. Used to
159
- # prioritize `-I` and `[ENV]('RUBYLIB`)` entries during `require`.
158
+ # The number of paths in the +$LOAD_PATH+ from activated gems. Used to
159
+ # prioritize `-I` and +[ENV]('RUBYLIB')+ entries during `require`.
160
160
  #
161
161
  def self.activated_gem_paths: () -> Integer
162
162
 
@@ -153,7 +153,15 @@ class UnboundMethod
153
153
  # rdoc-file=proc.c
154
154
  # - meth.owner -> class_or_module
155
155
  # -->
156
- # Returns the class or module that defines the method. See also Method#receiver.
156
+ # Returns the class or module on which this method is defined. In other words,
157
+ #
158
+ # meth.owner.instance_methods(false).include?(meth.name) # => true
159
+ #
160
+ # holds as long as the method is not removed/undefined/replaced, (with
161
+ # private_instance_methods instead of instance_methods if the method is
162
+ # private).
163
+ #
164
+ # See also Method#receiver.
157
165
  #
158
166
  # (1..3).method(:map).owner #=> Enumerable
159
167
  #
data/lib/rbs/cli.rb CHANGED
@@ -58,7 +58,7 @@ module RBS
58
58
  self.core_root = nil
59
59
  end
60
60
 
61
- opts.on('--collection PATH', "File path of collection configuration (default: #{Collection::Config::PATH})") do |path|
61
+ opts.on('--collection PATH', "File path of collection configuration (default: #{@config_path})") do |path|
62
62
  self.config_path = Pathname(path).expand_path
63
63
  end
64
64
 
@@ -1034,15 +1034,17 @@ EOB
1034
1034
  opts.order args.drop(1), into: params
1035
1035
  config_path = options.config_path or raise
1036
1036
  lock_path = Collection::Config.to_lockfile_path(config_path)
1037
- gemfile_lock_path = Bundler.default_lockfile
1038
1037
 
1039
1038
  case args[0]
1040
1039
  when 'install'
1041
1040
  unless params[:frozen]
1041
+ gemfile_lock_path = Bundler.default_lockfile
1042
1042
  Collection::Config.generate_lockfile(config_path: config_path, gemfile_lock_path: gemfile_lock_path)
1043
1043
  end
1044
1044
  Collection::Installer.new(lockfile_path: lock_path, stdout: stdout).install_from_lockfile
1045
1045
  when 'update'
1046
+ gemfile_lock_path = Bundler.default_lockfile
1047
+
1046
1048
  # TODO: Be aware of argv to update only specified gem
1047
1049
  Collection::Config.generate_lockfile(config_path: config_path, gemfile_lock_path: gemfile_lock_path, with_lockfile: false)
1048
1050
  Collection::Installer.new(lockfile_path: lock_path, stdout: stdout).install_from_lockfile
@@ -1101,6 +1103,8 @@ EOB
1101
1103
 
1102
1104
  # Update the RBSs
1103
1105
  $ rbs collection update
1106
+
1107
+ Options:
1104
1108
  HELP
1105
1109
  opts.on('--frozen') if args[0] == 'install'
1106
1110
  end
data/lib/rbs/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RBS
4
- VERSION = "2.8.0"
4
+ VERSION = "2.8.1"
5
5
  end
@@ -149,7 +149,7 @@
149
149
  # cgi.has_key?('field_name')
150
150
  # cgi.include?('field_name')
151
151
  #
152
- # CAUTION! [cgi]('field_name') returned an Array with the old cgi.rb(included in
152
+ # CAUTION! `cgi['field_name']` returned an Array with the old cgi.rb(included in
153
153
  # Ruby 1.6)
154
154
  #
155
155
  # ### Get form values as hash
@@ -713,8 +713,11 @@ class CGI
713
713
  #
714
714
  def domain: () -> String?
715
715
 
716
- # <!-- rdoc-file=lib/cgi/cookie.rb -->
717
- # Domain for which this cookie applies, as a `String`
716
+ # <!--
717
+ # rdoc-file=lib/cgi/cookie.rb
718
+ # - domain=(str)
719
+ # -->
720
+ # Set domain for which this cookie applies
718
721
  #
719
722
  def domain=: (String domain) -> String
720
723
 
@@ -756,8 +759,11 @@ class CGI
756
759
  #
757
760
  def name: () -> String
758
761
 
759
- # <!-- rdoc-file=lib/cgi/cookie.rb -->
760
- # Name of this cookie, as a `String`
762
+ # <!--
763
+ # rdoc-file=lib/cgi/cookie.rb
764
+ # - name=(str)
765
+ # -->
766
+ # Set name of this cookie
761
767
  #
762
768
  def name=: (String name) -> String
763
769
 
@@ -766,8 +772,11 @@ class CGI
766
772
  #
767
773
  def path: () -> String?
768
774
 
769
- # <!-- rdoc-file=lib/cgi/cookie.rb -->
770
- # Path for which this cookie applies, as a `String`
775
+ # <!--
776
+ # rdoc-file=lib/cgi/cookie.rb
777
+ # - path=(str)
778
+ # -->
779
+ # Set path for which this cookie applies
771
780
  #
772
781
  def path=: (String path) -> String
773
782
 
@@ -861,7 +870,7 @@ class CGI
861
870
  # rdoc-file=ext/cgi/escape/escape.c
862
871
  # - CGI.escape(string) -> string
863
872
  # -->
864
- # Returns URL-escaped string.
873
+ # Returns URL-escaped string (`application/x-www-form-urlencoded`).
865
874
  #
866
875
  def escape: (string str) -> String
867
876
 
@@ -877,7 +886,7 @@ class CGI
877
886
  # rdoc-file=ext/cgi/escape/escape.c
878
887
  # - CGI.unescape(string, encoding=@@accept_charset) -> string
879
888
  # -->
880
- # Returns URL-unescaped string.
889
+ # Returns URL-unescaped string (`application/x-www-form-urlencoded`).
881
890
  #
882
891
  def unescape: (string str, ?encoding encoding) -> String
883
892