rbs 2.8.0.pre.1 → 2.8.0

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: a1d6bcfbb96db1bd762270824620e4a430057521398fdef7d8543cceaaaab127
4
- data.tar.gz: 4616fee00017d88cb942fa34f25dee2bd1959ba83bf3f8eedf7f57770792d2e0
3
+ metadata.gz: 26f1a45c1e5dbf02bc102b1fc68c925979facec75a9971e9b405481087fc9ad9
4
+ data.tar.gz: b6e8bee27043e2bc710a894fe9518266dac265a8d0afc685193ca157dc5e8cac
5
5
  SHA512:
6
- metadata.gz: 9bfb3f1cb6ed463fbc9d78181b6fdd683bbb476adfdbda4ef7a1009d8c225ee96f7f5d958dbba3d2f5b461f2253ad0d27e68072653efde251886550cf64973c3
7
- data.tar.gz: bb8b7a2984b4211d8bbb19d213b999f78caa9e676fef3584da29b49a18639362f2884233337e1c5aedad01ce495055085ae080df81f696ce135de1220638d34a
6
+ metadata.gz: 918413c661460215dc7de7404e6b9a6f117a56493e91b2c1f059524352c9fe84c6deff43c43987816eaca958224eb57c3206f463dd3fe09b7e402f2a5daed92d
7
+ data.tar.gz: b743905981aa9b998c41b84a6dc9ae81b5d2456a89218c2840a490260552dc1919a7c2cc46d4293b49df120ccada9b220ffd06b25ebfe47f941a0632b4cc63fc
@@ -12,23 +12,23 @@ jobs:
12
12
  container:
13
13
  image: rubylang/ruby:3.1-focal
14
14
  steps:
15
- - uses: actions/checkout@v3
16
- - name: Install dependencies
17
- run: |
18
- apt-get update
19
- apt-get install -y libdb-dev curl
20
- - name: Update rubygems & bundler
21
- run: |
22
- ruby -v
23
- gem update --system
24
- - name: bundle config set with
25
- run: |
26
- echo "NO_MINITEST=true" >> $GITHUB_ENV
27
- bundle config set --local without 'minitest'
28
- if: "contains(matrix.container_tag, 'master-nightly')"
29
- - name: bin/setup
30
- run: |
31
- bin/setup
32
- - name: Check if `rake annotate` has been executed
33
- run: |
34
- bundle exec rake annotate confirm_annotation
15
+ - uses: actions/checkout@v3
16
+ - name: Install dependencies
17
+ run: |
18
+ apt-get update
19
+ apt-get install -y libdb-dev curl
20
+ - name: Update rubygems & bundler
21
+ run: |
22
+ ruby -v
23
+ gem update --system
24
+ - name: bundle config set with
25
+ run: |
26
+ echo "NO_MINITEST=true" >> $GITHUB_ENV
27
+ bundle config set --local without 'minitest'
28
+ if: "contains(matrix.container_tag, 'master-nightly')"
29
+ - name: bin/setup
30
+ run: |
31
+ bin/setup
32
+ - name: Check if `rake annotate` has been executed
33
+ run: |
34
+ bundle exec rake annotate confirm_annotation
@@ -12,70 +12,70 @@ jobs:
12
12
  strategy:
13
13
  matrix:
14
14
  container_tag:
15
- - master-nightly-focal
16
- - 3.1-focal
17
- - 3.0-focal
18
- - 2.7-bionic
19
- - 2.6-bionic
15
+ - master-nightly-focal
16
+ - 3.1-focal
17
+ - 3.0-focal
18
+ - 2.7-bionic
19
+ - 2.6-bionic
20
20
  job:
21
- - test
22
- - stdlib_test
23
- - rubocop validate test_doc build test_generate_stdlib
24
- - lexer confirm_lexer
25
- - lexer compile
21
+ - test
22
+ - stdlib_test
23
+ - rubocop validate test_doc build test_generate_stdlib
24
+ - lexer confirm_lexer
25
+ - lexer compile
26
26
  exclude:
27
- - container_tag: master-nightly-focal
28
- job: confirm_lexer
29
- - container_tag: 2.6-bionic
30
- job: stdlib_test
31
- - container_tag: 2.7-bionic
32
- job: stdlib_test
33
- - container_tag: 3.0-focal
34
- job: stdlib_test
27
+ - container_tag: master-nightly-focal
28
+ job: confirm_lexer
29
+ - container_tag: 2.6-bionic
30
+ job: stdlib_test
31
+ - container_tag: 2.7-bionic
32
+ job: stdlib_test
33
+ - container_tag: 3.0-focal
34
+ job: stdlib_test
35
35
  container:
36
36
  image: rubylang/ruby:${{ matrix.container_tag }}
37
37
  steps:
38
- - uses: actions/checkout@v3
39
- - name: Set working directory as safe
40
- run: /usr/bin/git config --global --add safe.directory $(pwd)
41
- - name: Install dependencies
42
- run: |
43
- apt-get update
44
- apt-get install -y libdb-dev curl autoconf automake m4 libtool
45
- - name: Install Re2c
46
- if: contains(matrix.job, 'lexer')
47
- run: |
48
- cd /tmp
49
- curl -L https://github.com/skvadrik/re2c/archive/refs/tags/3.0.tar.gz > re2c-3.0.tar.gz
50
- tar xf re2c-3.0.tar.gz
51
- cd re2c-3.0
52
- autoreconf -i -W all
53
- ./configure
54
- make
55
- make install
56
- - name: Update rubygems & bundler
57
- run: |
58
- ruby -v
59
- gem update --system
60
- - name: bundle config set with
61
- run: |
62
- echo "NO_MINITEST=true" >> $GITHUB_ENV
63
- bundle config set --local without 'minitest'
64
- if: "contains(matrix.container_tag, 'master-nightly')"
65
- - name: bin/setup
66
- run: |
67
- bin/setup
68
- - name: Run test
69
- run: |
70
- bundle exec rake ${{ matrix.job }}
38
+ - uses: actions/checkout@v3
39
+ - name: Set working directory as safe
40
+ run: /usr/bin/git config --global --add safe.directory $(pwd)
41
+ - name: Install dependencies
42
+ run: |
43
+ apt-get update
44
+ apt-get install -y libdb-dev curl autoconf automake m4 libtool
45
+ - name: Install Re2c
46
+ if: contains(matrix.job, 'lexer')
47
+ run: |
48
+ cd /tmp
49
+ curl -L https://github.com/skvadrik/re2c/archive/refs/tags/3.0.tar.gz > re2c-3.0.tar.gz
50
+ tar xf re2c-3.0.tar.gz
51
+ cd re2c-3.0
52
+ autoreconf -i -W all
53
+ ./configure
54
+ make
55
+ make install
56
+ - name: Update rubygems & bundler
57
+ run: |
58
+ ruby -v
59
+ gem update --system
60
+ - name: bundle config set with
61
+ run: |
62
+ echo "NO_MINITEST=true" >> $GITHUB_ENV
63
+ bundle config set --local without 'minitest'
64
+ if: "contains(matrix.container_tag, 'master-nightly')"
65
+ - name: bin/setup
66
+ run: |
67
+ bin/setup
68
+ - name: Run test
69
+ run: |
70
+ bundle exec rake ${{ matrix.job }}
71
71
 
72
72
  windows:
73
73
  runs-on: ${{ matrix.os }}
74
74
  strategy:
75
75
  fail-fast: false
76
76
  matrix:
77
- os: [ windows-2019, windows-2022 ]
78
- ruby: [ ucrt, mswin ]
77
+ os: [windows-2019, windows-2022]
78
+ ruby: [ucrt, mswin]
79
79
  steps:
80
80
  - uses: actions/checkout@v3
81
81
  - name: load ruby
data/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 2.8.0 (2022-11-24)
6
+
7
+ ### Signature updates
8
+
9
+ * random ([#1144](https://github.com/ruby/rbs/pull/1144))
10
+
11
+ ### Library changes
12
+
13
+ * Fix SEGV when give invalid object to `variables:` ([#1153](https://github.com/ruby/rbs/pull/1153))
14
+
15
+ ### Miscellaneous
16
+
17
+ * Fix some typos ([#1155](https://github.com/ruby/rbs/pull/1155))
18
+ * Fix a formatting some YAML files ([#1154](https://github.com/ruby/rbs/pull/1154))
19
+
5
20
  ## 2.8.0.pre.1 (2022-11-17)
6
21
 
7
22
  ### Signature updates
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs (2.8.0.pre.1)
4
+ rbs (2.8.0)
5
5
 
6
6
  PATH
7
7
  remote: test/assets/test-gem
data/core/random.rbs CHANGED
@@ -21,6 +21,26 @@
21
21
  # use SecureRandom for security purpose, instead of this PRNG.
22
22
  #
23
23
  class Random < RBS::Unnamed::Random_Base
24
+ # <!--
25
+ # rdoc-file=random.c
26
+ # - Random.new(seed = Random.new_seed) -> prng
27
+ # -->
28
+ # Creates a new PRNG using `seed` to set the initial state. If `seed` is
29
+ # omitted, the generator is initialized with Random.new_seed.
30
+ #
31
+ # See Random.srand for more information on the use of seed values.
32
+ #
33
+ def initialize: (?Integer seed) -> void
34
+
35
+ # <!--
36
+ # rdoc-file=random.c
37
+ # - Random.bytes(size) -> string
38
+ # -->
39
+ # Returns a random binary string. The argument `size` specifies the length of
40
+ # the returned string.
41
+ #
42
+ def self.bytes: (Integer size) -> String
43
+
24
44
  # <!--
25
45
  # rdoc-file=random.c
26
46
  # - prng1 == prng2 -> true or false
@@ -71,6 +91,7 @@ class Random < RBS::Unnamed::Random_Base
71
91
  def self.rand: () -> Float
72
92
  | (Integer | ::Range[Integer] max) -> Integer
73
93
  | (Float | ::Range[Float] max) -> Float
94
+ | [T < Numeric] (::Range[T]) -> T
74
95
 
75
96
  # <!--
76
97
  # rdoc-file=random.c
@@ -95,6 +116,52 @@ class Random < RBS::Unnamed::Random_Base
95
116
  # [ rand, rand ] # => [0.1915194503788923, 0.6221087710398319]
96
117
  #
97
118
  def self.srand: (?Integer number) -> Integer
119
+
120
+ # <!--
121
+ # rdoc-file=random.c
122
+ # - Random.urandom(size) -> string
123
+ # -->
124
+ # Returns a string, using platform providing features. Returned value is
125
+ # expected to be a cryptographically secure pseudo-random number in binary form.
126
+ # This method raises a RuntimeError if the feature provided by platform failed
127
+ # to prepare the result.
128
+ #
129
+ # In 2017, Linux manpage random(7) writes that "no cryptographic primitive
130
+ # available today can hope to promise more than 256 bits of security". So it
131
+ # might be questionable to pass size > 32 to this method.
132
+ #
133
+ # Random.urandom(8) #=> "\x78\x41\xBA\xAF\x7D\xEA\xD8\xEA"
134
+ #
135
+ def self.urandom: (Integer) -> String
136
+
137
+ # <!--
138
+ # rdoc-file=random.c
139
+ # - prng.seed -> integer
140
+ # -->
141
+ # Returns the seed value used to initialize the generator. This may be used to
142
+ # initialize another generator with the same state at a later time, causing it
143
+ # to produce the same sequence of numbers.
144
+ #
145
+ # prng1 = Random.new(1234)
146
+ # prng1.seed #=> 1234
147
+ # prng1.rand(100) #=> 47
148
+ #
149
+ # prng2 = Random.new(prng1.seed)
150
+ # prng2.rand(100) #=> 47
151
+ #
152
+ def seed: () -> Integer
153
+
154
+ private
155
+
156
+ def initialize_copy: (self object) -> self
157
+
158
+ def left: () -> untyped
159
+
160
+ def marshal_dump: () -> untyped
161
+
162
+ def marshal_load: (untyped) -> untyped
163
+
164
+ def state: () -> untyped
98
165
  end
99
166
 
100
167
  Random::DEFAULT: Random
@@ -176,7 +176,7 @@ the type variable `Elem`, and the `?` suffix nilable marker.
176
176
  When called with an `Integer` positional argument, the return value will be an
177
177
  `Array` of whatever type is contained.
178
178
 
179
- The `?` syntax is a convenient shorthand for a union with nil. An equivalent union type woould be `(Elem | nil)`.
179
+ The `?` syntax is a convenient shorthand for a union with nil. An equivalent union type would be `(Elem | nil)`.
180
180
 
181
181
  ### Keyword Arguments
182
182
 
@@ -28,7 +28,7 @@ typedef struct {
28
28
  VALUE rbs_new_location(VALUE buffer, range rg);
29
29
 
30
30
  /**
31
- * Return rbs_loc assiciated with the RBS::Location object.
31
+ * Return rbs_loc associated with the RBS::Location object.
32
32
  * */
33
33
  rbs_loc *rbs_check_location(VALUE location);
34
34
 
@@ -537,8 +537,8 @@ EOP:
537
537
  }
538
538
 
539
539
  /*
540
- optinal ::= {} <simple_type>
541
- | {} simple_type <`?`>
540
+ optional ::= {} <simple_type>
541
+ | {} simple_type <`?`>
542
542
  */
543
543
  static VALUE parse_optional(parserstate *state) {
544
544
  range rg;
@@ -299,6 +299,12 @@ parserstate *alloc_parser(VALUE buffer, int start_pos, int end_pos, VALUE variab
299
299
  parser_advance(parser);
300
300
 
301
301
  if (!NIL_P(variables)) {
302
+ if (!RB_TYPE_P(variables, T_ARRAY)) {
303
+ rb_raise(rb_eTypeError,
304
+ "wrong argument type %"PRIsVALUE" (must be array or nil)",
305
+ rb_obj_class(variables));
306
+ }
307
+
302
308
  parser_push_typevar_table(parser, true);
303
309
 
304
310
  for (long i = 0; i < rb_array_len(variables); i++) {
data/lib/rbs/cli.rb CHANGED
@@ -58,11 +58,11 @@ module RBS
58
58
  self.core_root = nil
59
59
  end
60
60
 
61
- opts.on('--collection PATH', "File path of collection configration (default: #{Collection::Config::PATH})") do |path|
61
+ opts.on('--collection PATH', "File path of collection configuration (default: #{Collection::Config::PATH})") do |path|
62
62
  self.config_path = Pathname(path).expand_path
63
63
  end
64
64
 
65
- opts.on('--no-collection', 'Ignore collection configration') do
65
+ opts.on('--no-collection', 'Ignore collection configuration') do
66
66
  self.config_path = nil
67
67
  end
68
68
 
@@ -1093,7 +1093,7 @@ EOB
1093
1093
 
1094
1094
  Examples:
1095
1095
 
1096
- # Initialize the configration file
1096
+ # Initialize the configuration file
1097
1097
  $ rbs collection init
1098
1098
 
1099
1099
  # Generate the lock file and install RBSs from the lock file
@@ -3,7 +3,7 @@
3
3
  module RBS
4
4
  module Collection
5
5
 
6
- # This class represent the configration file.
6
+ # This class represent the configuration file.
7
7
  class Config
8
8
  class CollectionNotAvailable < StandardError
9
9
  def initialize
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.pre.1"
4
+ VERSION = "2.8.0"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  module RBS
2
2
  module Collection
3
- # This class represent the configration file.
3
+ # This class represent the configuration file.
4
4
  class Config
5
5
  class CollectionNotAvailable < StandardError
6
6
  def initialize: () -> void
data/sig/rdoc/rbs.rbs CHANGED
@@ -49,7 +49,7 @@ module RBS
49
49
  # * If `#comment" returns a Comment object, it returns its `#string` value
50
50
  # * If `#comment` returns `nil`, it raises an error
51
51
  #
52
- # Note that you have to confirm if the `#comment` of given declartion exists.
52
+ # Note that you have to confirm if the `#comment` of given declaration exists.
53
53
  #
54
54
  # ```ruby
55
55
  # comment = construct_comment(context: context, comment: comment_string(decl)) if decl.comment
@@ -14,7 +14,7 @@ module RBS
14
14
  # result = calculator.in_type_alias(name: name, args: args, variables: variables)
15
15
  # ```
16
16
  #
17
- # See `RBS::VarianceCaluculator::Result` for information recorded in the `Result` object.
17
+ # See `RBS::VarianceCalculator::Result` for information recorded in the `Result` object.
18
18
  #
19
19
  class VarianceCalculator
20
20
  type variance = :unused | :covariant | :contravariant | :invariant
data/sig/vendorer.rbs CHANGED
@@ -12,7 +12,7 @@ module RBS
12
12
  # loader.add(path: Pathname("sig")) # Dirs will be ignored.
13
13
  #
14
14
  # vendorer = RBS::Vendorer.new(vendor_dir: Pathname("vendor/rbs"), loader: loader)
15
- # vendorer.clearn!
15
+ # vendorer.clean!
16
16
  # vendorer.copy!
17
17
  # ```
18
18
  #
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.8.0.pre.1
4
+ version: 2.8.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: 2022-11-17 00:00:00.000000000 Z
11
+ date: 2022-11-24 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.
@@ -437,9 +437,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
437
437
  version: '2.6'
438
438
  required_rubygems_version: !ruby/object:Gem::Requirement
439
439
  requirements:
440
- - - ">"
440
+ - - ">="
441
441
  - !ruby/object:Gem::Version
442
- version: 1.3.1
442
+ version: '0'
443
443
  requirements: []
444
444
  rubygems_version: 3.3.7
445
445
  signing_key: