rbs 2.3.1 → 2.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79b2c9781565a156da1f9a40c4e5facddac2112036a8a225fff739b647b3ff87
4
- data.tar.gz: 6477d9d8ebd4eecbae21449c267a62d62835787570880fcc57cebe8da24d2670
3
+ metadata.gz: 72915c0f663f0fafeda4cbabba1de64b1d1d0c09fe8296308cb66b57c20311f1
4
+ data.tar.gz: feb1ae7af7f99635e9a16ae86d39cdb0220672e52aa5a264cff31705d7f892cc
5
5
  SHA512:
6
- metadata.gz: 6d1775cf14742b238334c2269c95446f0d7940a8ca33053cda9fe9bea6ed4a0f2dd3c4e8dee7090e2b469360af0391c01a4eb31bb9a1077df930410dc2e90161
7
- data.tar.gz: '074178e6adf827eff91b13774ac77f45737d143ccc0679874ff9bafde373c606fdb052dea25cf7daa1d5ff8dfd05102be98c4398129a8db8c409752326ef5385'
6
+ metadata.gz: 3f66fa2748f6b1e042498a3bf6a200968d80eca238251e85657f994ebd9a5d4716d162c15168fcebb02890f89c689877ed8d0eecdae0671fcf721220d68d1ded
7
+ data.tar.gz: a331220a1d7908ac0166b4fbb0e2b0d8c4ca6bb2a79437b9ecd44bd016f88e98dc16b01571e5829620b33d8ba5821b09c6d55c1f18512e5e76863067da509e60
data/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 2.3.2 (2022-04-06)
6
+
7
+ ### Library changes
8
+
9
+ * Let modules have constants under `::Object` ([\#972](https://github.com/ruby/rbs/pull/972))
10
+
11
+ ### Miscellaneous
12
+
13
+ * Delete `-Wold-style-definition` ([\#971](https://github.com/ruby/rbs/pull/971))
14
+ * `\e` is not defined in C90 ([\#970](https://github.com/ruby/rbs/pull/970))
15
+
5
16
  ## 2.3.1 (2022-04-05)
6
17
 
7
18
  ### Library changes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs (2.3.1)
4
+ rbs (2.3.2)
5
5
 
6
6
  PATH
7
7
  remote: test/assets/test-gem
@@ -1,4 +1,4 @@
1
1
  require 'mkmf'
2
2
  $INCFLAGS << " -I$(top_srcdir)" if $extmk
3
- append_cflags ['-std=c99', '-Wold-style-definition']
3
+ $CFLAGS += " -std=c99 "
4
4
  create_makefile 'rbs_extension'
@@ -22,7 +22,7 @@ void rbs_unescape_string(VALUE string) {
22
22
  rb_global_variable(&HASH);
23
23
  rb_hash_aset(HASH, rb_str_new_literal("\\a"), rb_str_new_literal("\a"));
24
24
  rb_hash_aset(HASH, rb_str_new_literal("\\b"), rb_str_new_literal("\b"));
25
- rb_hash_aset(HASH, rb_str_new_literal("\\e"), rb_str_new_literal("\e"));
25
+ rb_hash_aset(HASH, rb_str_new_literal("\\e"), rb_str_new_literal("\033"));
26
26
  rb_hash_aset(HASH, rb_str_new_literal("\\f"), rb_str_new_literal("\f"));
27
27
  rb_hash_aset(HASH, rb_str_new_literal("\\n"), rb_str_new_literal("\n"));
28
28
  rb_hash_aset(HASH, rb_str_new_literal("\\r"), rb_str_new_literal("\r"));
@@ -158,21 +158,11 @@ module RBS
158
158
  end
159
159
 
160
160
  def constants_from_ancestors(module_name, constants:)
161
- if (entry = builder.env.class_decls[module_name]).is_a?(Environment::ModuleEntry)
162
- self_types = entry.self_types
163
- if self_types.empty?
164
- self_types << AST::Declarations::Module::Self.new(
165
- name: BuiltinNames::Object.name,
166
- args: [],
167
- location: nil
168
- )
169
- end
161
+ entry = builder.env.class_decls[module_name]
170
162
 
171
- self_types.each do |self_type|
172
- if self_type.name.class?
173
- constants_from_ancestors(self_type.name, constants: constants)
174
- end
175
- end
163
+ if entry.is_a?(Environment::ModuleEntry)
164
+ constants.merge!(table.children(BuiltinNames::Object.name) || raise)
165
+ constants.merge!(table.toplevel)
176
166
  end
177
167
 
178
168
  builder.ancestor_builder.instance_ancestors(module_name).ancestors.reverse_each do |ancestor|
@@ -180,7 +170,7 @@ module RBS
180
170
  case ancestor.source
181
171
  when AST::Members::Include, :super, nil
182
172
  consts = table.children(ancestor.name) or raise
183
- if ancestor.name == BuiltinNames::Object.name
173
+ if ancestor.name == BuiltinNames::Object.name && entry.is_a?(Environment::ClassEntry)
184
174
  # Insert toplevel constants as ::Object's constants
185
175
  consts.merge!(table.toplevel)
186
176
  end
data/lib/rbs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RBS
2
- VERSION = "2.3.1"
2
+ VERSION = "2.3.2"
3
3
  end
data/steep/Gemfile.lock CHANGED
@@ -23,8 +23,8 @@ GEM
23
23
  rb-fsevent (0.11.1)
24
24
  rb-inotify (0.10.1)
25
25
  ffi (~> 1.0)
26
- rbs (2.3.0)
27
- steep (0.51.0)
26
+ rbs (2.3.1)
27
+ steep (0.52.0)
28
28
  activesupport (>= 5.1)
29
29
  language_server-protocol (>= 3.15, < 4.0)
30
30
  listen (~> 3.0)
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.3.1
4
+ version: 2.3.2
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-04-05 00:00:00.000000000 Z
11
+ date: 2022-04-06 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.